Changeset 55949 in webkit


Ignore:
Timestamp:
Mar 12, 2010 11:07:43 PM (14 years ago)
Author:
krit@webkit.org
Message:

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:
Location:
trunk
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r55941 r55949  
     12010-03-12  Dirk Schulze  <krit@webkit.org>
     2
     3        Reviewed by Nikolas Zimmermann.
     4
     5        SVG Glyphs - transform path not context
     6        https://bugs.webkit.org/show_bug.cgi?id=36070
     7
     8        Some tests don't look pixel perfect after the SVGFont changes (difference of 0.1%).
     9        They just need an update.
     10        Tests for the changes on other platforms than CG are
     11            * svg/batik/text/textEffect.svg
     12            * svg/batik/text/textEffect3.svg
     13            * svg/W3C-SVG-1.1/pservers-grad-08-b.svg
     14
     15        * platform/mac-leopard/svg/custom/svg-fonts-in-html-expected.checksum:
     16        * platform/mac-leopard/svg/custom/svg-fonts-in-html-expected.png:
     17        * platform/mac/svg/W3C-SVG-1.1/animate-elem-03-t-expected.checksum:
     18        * platform/mac/svg/W3C-SVG-1.1/animate-elem-03-t-expected.png:
     19        * platform/mac/svg/W3C-SVG-1.1/animate-elem-36-t-expected.checksum:
     20        * platform/mac/svg/W3C-SVG-1.1/animate-elem-36-t-expected.png:
     21        * platform/mac/svg/W3C-SVG-1.1/animate-elem-40-t-expected.checksum:
     22        * platform/mac/svg/W3C-SVG-1.1/animate-elem-40-t-expected.png:
     23        * platform/mac/svg/W3C-SVG-1.1/pservers-grad-08-b-expected.checksum:
     24        * platform/mac/svg/W3C-SVG-1.1/pservers-grad-08-b-expected.png:
     25        * platform/mac/svg/batik/text/textEffect-expected.checksum:
     26        * platform/mac/svg/batik/text/textEffect-expected.png:
     27        * platform/mac/svg/batik/text/textEffect3-expected.checksum:
     28        * platform/mac/svg/batik/text/textEffect3-expected.png:
     29        * platform/mac/svg/text/selection-doubleclick-expected.png:
     30        * platform/mac/svg/text/selection-tripleclick-expected.png:
     31
    1322010-03-12  Enrica Casucci  <enrica@apple.com>
    233
  • trunk/LayoutTests/platform/mac-leopard/svg/custom/svg-fonts-in-html-expected.checksum

    r53576 r55949  
    1 7eb935f50fa8d28f77764806f42db2e7
     128c0d6305c1f0c064015177e725c877b
  • trunk/LayoutTests/platform/mac/svg/W3C-SVG-1.1/animate-elem-03-t-expected.checksum

    r44224 r55949  
    1 25e8155e853f84f24b8fee6d44bfca28
     12700ef95357f49203d5ad3b3a200bc33
  • trunk/LayoutTests/platform/mac/svg/W3C-SVG-1.1/animate-elem-36-t-expected.checksum

    r44224 r55949  
    1 6401ffb9c48a543836bced04aca42b19
     139465072d46accc011bb8c74a1ffbef0
  • trunk/LayoutTests/platform/mac/svg/W3C-SVG-1.1/animate-elem-40-t-expected.checksum

    r44224 r55949  
    1 d02b0c5a824b946118112cb43682d2cf
     18a223479ab3868054ed1e3ecce18e150
  • trunk/LayoutTests/platform/mac/svg/W3C-SVG-1.1/pservers-grad-08-b-expected.checksum

    r54483 r55949  
    1 c20724b86fc042efc5b8885ae96555be
     1a7ac274b1c9b01997afc4fd8fb806a9c
  • trunk/LayoutTests/platform/mac/svg/batik/text/textEffect-expected.checksum

    r54483 r55949  
    1 ce9ad62697190c25783eac8c958517bf
     1a9173017ad8129b9759bed91b7e888dd
  • trunk/LayoutTests/platform/mac/svg/batik/text/textEffect3-expected.checksum

    r54483 r55949  
    1 263252e4e22836a27381a99586b82ede
     116a59caf983f9383a59c06baabfb34fd
  • trunk/WebCore/ChangeLog

    r55946 r55949  
     12010-03-12  Dirk Schulze  <krit@webkit.org>
     2
     3        Reviewed by Nikolas Zimmermann.
     4
     5        SVG Glyphs - transform path not context
     6        https://bugs.webkit.org/show_bug.cgi?id=36070
     7
     8        SVGFont should transform the path of a glyph, not the context. Modifying
     9        the context causes wrong gradient transformations. This bug doesn't
     10        influence CG because we generally fill or stroke texts with a mask image.
     11        All other platforms provide a direct way to make the drawings.
     12
     13        * svg/SVGFont.cpp:
     14        (WebCore::Font::drawTextUsingSVGFont):
     15
    1162010-03-12  Beth Dakin  <bdakin@apple.com>
    217
  • trunk/WebCore/svg/SVGFont.cpp

    r54556 r55949  
    11/**
    22 * Copyright (C) 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org>
     3 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
    34 *
    45 * This library is free software; you can redistribute it and/or
     
    529530                    }
    530531
    531                     context->translate(xStartOffset + currentPoint.x() + glyphOrigin.x(), currentPoint.y() + glyphOrigin.y());
    532                     context->scale(FloatSize(scale, -scale));
     532                    AffineTransform glyphPathTransform;
     533                    glyphPathTransform.translate(xStartOffset + currentPoint.x() + glyphOrigin.x(), currentPoint.y() + glyphOrigin.y());
     534                    glyphPathTransform.scale(scale, -scale);
     535
     536                    Path glyphPath = identifier.pathData;
     537                    glyphPath.transform(glyphPathTransform);
    533538
    534539                    context->beginPath();
    535                     context->addPath(identifier.pathData);
    536 
    537                     // FIXME: setup() tries to get objectBoundingBox() from run.referencingRenderObject()
    538                     // which is wrong.  We need to change setup() to take a bounding box instead, or pass
    539                     // a RenderObject which would return the bounding box for identifier.pathData
     540                    context->addPath(glyphPath);
    540541                    if (activePaintServer->setup(context, run.referencingRenderObject(), targetType)) {
    541                         // Spec: Any properties specified on a text elements which represents a length, such as the
    542                         // 'stroke-width' property, might produce surprising results since the length value will be
    543                         // processed in the coordinate system of the glyph. (TODO: What other lengths? miter-limit? dash-offset?)
    544                         if (targetType == ApplyToStrokeTargetType && scale != 0.0f)
    545                             context->setStrokeThickness(context->strokeThickness() / scale);
    546 
    547542                        activePaintServer->renderPath(context, run.referencingRenderObject(), targetType);
    548543                        activePaintServer->teardown(context, run.referencingRenderObject(), targetType);
Note: See TracChangeset for help on using the changeset viewer.