Commit 65316421 authored by krit@webkit.org's avatar krit@webkit.org
Browse files

2010-03-12 Dirk Schulze <krit@webkit.org>

        Reviewed by Nikolas Zimmermann.

        SVG Glyphs - transform path not context
        https://bugs.webkit.org/show_bug.cgi?id=36070

        SVGFont should transform the path of a glyph, not the context. Modifying
        the context causes wrong gradient transformations. This bug doesn't
        influence CG because we generally fill or stroke texts with a mask image.
        All other platforms provide a direct way to make the drawings.

        * svg/SVGFont.cpp:
        (WebCore::Font::drawTextUsingSVGFont):
2010-03-12  Dirk Schulze  <krit@webkit.org>

        Reviewed by Nikolas Zimmermann.

        SVG Glyphs - transform path not context
        https://bugs.webkit.org/show_bug.cgi?id=36070

        Some tests don't look pixel perfect after the SVGFont changes (difference of 0.1%).
        They just need an update.
        Tests for the changes on other platforms than CG are
            * svg/batik/text/textEffect.svg
            * svg/batik/text/textEffect3.svg
            * svg/W3C-SVG-1.1/pservers-grad-08-b.svg

        * platform/mac-leopard/svg/custom/svg-fonts-in-html-expected.checksum:
        * platform/mac-leopard/svg/custom/svg-fonts-in-html-expected.png:
        * platform/mac/svg/W3C-SVG-1.1/animate-elem-03-t-expected.checksum:
        * platform/mac/svg/W3C-SVG-1.1/animate-elem-03-t-expected.png:
        * platform/mac/svg/W3C-SVG-1.1/animate-elem-36-t-expected.checksum:
        * platform/mac/svg/W3C-SVG-1.1/animate-elem-36-t-expected.png:
        * platform/mac/svg/W3C-SVG-1.1/animate-elem-40-t-expected.checksum:
        * platform/mac/svg/W3C-SVG-1.1/animate-elem-40-t-expected.png:
        * platform/mac/svg/W3C-SVG-1.1/pservers-grad-08-b-expected.checksum:
        * platform/mac/svg/W3C-SVG-1.1/pservers-grad-08-b-expected.png:
        * platform/mac/svg/batik/text/textEffect-expected.checksum:
        * platform/mac/svg/batik/text/textEffect-expected.png:
        * platform/mac/svg/batik/text/textEffect3-expected.checksum:
        * platform/mac/svg/batik/text/textEffect3-expected.png:
        * platform/mac/svg/text/selection-doubleclick-expected.png:
        * platform/mac/svg/text/selection-tripleclick-expected.png:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55949 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 5ac12f3f
2010-03-12 Dirk Schulze <krit@webkit.org>
Reviewed by Nikolas Zimmermann.
SVG Glyphs - transform path not context
https://bugs.webkit.org/show_bug.cgi?id=36070
Some tests don't look pixel perfect after the SVGFont changes (difference of 0.1%).
They just need an update.
Tests for the changes on other platforms than CG are
* svg/batik/text/textEffect.svg
* svg/batik/text/textEffect3.svg
* svg/W3C-SVG-1.1/pservers-grad-08-b.svg
* platform/mac-leopard/svg/custom/svg-fonts-in-html-expected.checksum:
* platform/mac-leopard/svg/custom/svg-fonts-in-html-expected.png:
* platform/mac/svg/W3C-SVG-1.1/animate-elem-03-t-expected.checksum:
* platform/mac/svg/W3C-SVG-1.1/animate-elem-03-t-expected.png:
* platform/mac/svg/W3C-SVG-1.1/animate-elem-36-t-expected.checksum:
* platform/mac/svg/W3C-SVG-1.1/animate-elem-36-t-expected.png:
* platform/mac/svg/W3C-SVG-1.1/animate-elem-40-t-expected.checksum:
* platform/mac/svg/W3C-SVG-1.1/animate-elem-40-t-expected.png:
* platform/mac/svg/W3C-SVG-1.1/pservers-grad-08-b-expected.checksum:
* platform/mac/svg/W3C-SVG-1.1/pservers-grad-08-b-expected.png:
* platform/mac/svg/batik/text/textEffect-expected.checksum:
* platform/mac/svg/batik/text/textEffect-expected.png:
* platform/mac/svg/batik/text/textEffect3-expected.checksum:
* platform/mac/svg/batik/text/textEffect3-expected.png:
* platform/mac/svg/text/selection-doubleclick-expected.png:
* platform/mac/svg/text/selection-tripleclick-expected.png:
2010-03-12 Enrica Casucci <enrica@apple.com>
Reviewed by Simon Fraser.
......
7eb935f50fa8d28f77764806f42db2e7
\ No newline at end of file
28c0d6305c1f0c064015177e725c877b
\ No newline at end of file
25e8155e853f84f24b8fee6d44bfca28
\ No newline at end of file
2700ef95357f49203d5ad3b3a200bc33
\ No newline at end of file
6401ffb9c48a543836bced04aca42b19
\ No newline at end of file
39465072d46accc011bb8c74a1ffbef0
\ No newline at end of file
d02b0c5a824b946118112cb43682d2cf
\ No newline at end of file
8a223479ab3868054ed1e3ecce18e150
\ No newline at end of file
c20724b86fc042efc5b8885ae96555be
\ No newline at end of file
a7ac274b1c9b01997afc4fd8fb806a9c
\ No newline at end of file
ce9ad62697190c25783eac8c958517bf
\ No newline at end of file
a9173017ad8129b9759bed91b7e888dd
\ No newline at end of file
263252e4e22836a27381a99586b82ede
\ No newline at end of file
16a59caf983f9383a59c06baabfb34fd
\ No newline at end of file
2010-03-12 Dirk Schulze <krit@webkit.org>
Reviewed by Nikolas Zimmermann.
SVG Glyphs - transform path not context
https://bugs.webkit.org/show_bug.cgi?id=36070
SVGFont should transform the path of a glyph, not the context. Modifying
the context causes wrong gradient transformations. This bug doesn't
influence CG because we generally fill or stroke texts with a mask image.
All other platforms provide a direct way to make the drawings.
* svg/SVGFont.cpp:
(WebCore::Font::drawTextUsingSVGFont):
2010-03-12 Beth Dakin <bdakin@apple.com>
 
Reviewed by Simon Fraser.
......
/**
* Copyright (C) 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org>
* Copyright (C) Research In Motion Limited 2010. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
......@@ -528,22 +529,16 @@ void Font::drawTextUsingSVGFont(GraphicsContext* context, const TextRun& run,
glyphOrigin.setY(identifier.verticalOriginY * scale);
}
context->translate(xStartOffset + currentPoint.x() + glyphOrigin.x(), currentPoint.y() + glyphOrigin.y());
context->scale(FloatSize(scale, -scale));
AffineTransform glyphPathTransform;
glyphPathTransform.translate(xStartOffset + currentPoint.x() + glyphOrigin.x(), currentPoint.y() + glyphOrigin.y());
glyphPathTransform.scale(scale, -scale);
context->beginPath();
context->addPath(identifier.pathData);
Path glyphPath = identifier.pathData;
glyphPath.transform(glyphPathTransform);
// FIXME: setup() tries to get objectBoundingBox() from run.referencingRenderObject()
// which is wrong. We need to change setup() to take a bounding box instead, or pass
// a RenderObject which would return the bounding box for identifier.pathData
context->beginPath();
context->addPath(glyphPath);
if (activePaintServer->setup(context, run.referencingRenderObject(), targetType)) {
// Spec: Any properties specified on a text elements which represents a length, such as the
// 'stroke-width' property, might produce surprising results since the length value will be
// processed in the coordinate system of the glyph. (TODO: What other lengths? miter-limit? dash-offset?)
if (targetType == ApplyToStrokeTargetType && scale != 0.0f)
context->setStrokeThickness(context->strokeThickness() / scale);
activePaintServer->renderPath(context, run.referencingRenderObject(), targetType);
activePaintServer->teardown(context, run.referencingRenderObject(), targetType);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment