Changeset 51496 in webkit


Ignore:
Timestamp:
Nov 30, 2009 9:25:00 AM (14 years ago)
Author:
eric@webkit.org
Message:

2009-11-30 Dirk Schulze <krit@webkit.org>

Reviewed by Nikolas Zimmermann.

Complex test of mask with every combination of maskUnits and maskContentUnits
as well as different values for size and position of the mask and it's content.

  • platform/mac/svg/custom/mask-with-all-units-expected.checksum: Added.
  • platform/mac/svg/custom/mask-with-all-units-expected.png: Added.
  • platform/mac/svg/custom/mask-with-all-units-expected.txt: Added.
  • svg/custom/mask-with-all-units.svg: Added.

2009-11-30 Dirk Schulze <krit@webkit.org>

Reviewed by Nikolas Zimmermann.

REGRESSION (r49757): masking-mask-01-b.svg rendered incorrectly
https://bugs.webkit.org/show_bug.cgi?id=31980

It turns out, that we did not handle maskUnits="userSpaceOnUse"
correctly. We just need to move the context of the maskImage
if maskContentUnits="objectBoundingBox". The context gets scaled
on this unit combination, so we have to substract the position of
the targetRect. On userSpaceOnUse the position just depends on the
position of the mask element.
I added a test with some senseless and reasonable values for size
and postion of the mask and it's contents. I also used every
combination of maskUnits and maskContentUnits to be sure, that it
is fixed this time.

Test: svg/custom/mask-with-all-units.svg

  • svg/SVGMaskElement.cpp: (WebCore::SVGMaskElement::drawMaskerContent):
Location:
trunk
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r51482 r51496  
     12009-11-30  Dirk Schulze  <krit@webkit.org>
     2
     3        Reviewed by Nikolas Zimmermann.
     4
     5        Complex test of mask with every combination of maskUnits and maskContentUnits
     6        as well as different values for size and position of the mask and it's content.
     7
     8        * platform/mac/svg/custom/mask-with-all-units-expected.checksum: Added.
     9        * platform/mac/svg/custom/mask-with-all-units-expected.png: Added.
     10        * platform/mac/svg/custom/mask-with-all-units-expected.txt: Added.
     11        * svg/custom/mask-with-all-units.svg: Added.
     12
    1132009-11-30  Csaba Osztrogonác  <ossy@webkit.org>
    214
  • trunk/WebCore/ChangeLog

    r51495 r51496  
     12009-11-30  Dirk Schulze  <krit@webkit.org>
     2
     3        Reviewed by Nikolas Zimmermann.
     4
     5        REGRESSION (r49757): masking-mask-01-b.svg rendered incorrectly
     6        [https://bugs.webkit.org/show_bug.cgi?id=31980]
     7
     8        It turns out, that we did not handle maskUnits="userSpaceOnUse"
     9        correctly. We just need to move the context of the maskImage
     10        if maskContentUnits="objectBoundingBox". The context gets scaled
     11        on this unit combination, so we have to substract the position of
     12        the targetRect. On userSpaceOnUse the position just depends on the
     13        position of the mask element.
     14        I added a test with some senseless and reasonable values for size
     15        and postion of the mask and it's contents. I also used every
     16        combination of maskUnits and maskContentUnits to be sure, that it
     17        is fixed this time.
     18
     19        Test: svg/custom/mask-with-all-units.svg
     20
     21        * svg/SVGMaskElement.cpp:
     22        (WebCore::SVGMaskElement::drawMaskerContent):
     23
    1242009-11-30  Steve Block  <steveblock@google.com>
    225
  • trunk/WebCore/svg/SVGMaskElement.cpp

    r50583 r51496  
    33                  2004, 2005, 2006, 2007 Rob Buis <buis@kde.org>
    44                  2005 Alexander Kellett <lypanov@kde.org>
     5                  2009 Dirk Schulze <krit@webkit.org>
    56
    67    This library is free software; you can redistribute it and/or
     
    157158
    158159    FloatPoint maskContextLocation = maskDestRect.location();
    159     if (maskUnits() == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX)
     160    if (maskUnits() == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX) {
    160161        maskDestRect.move(targetRect.x(), targetRect.y());
    161 
    162     if (maskContentUnits() != SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX)
    163         maskContextLocation.move(targetRect.x(), targetRect.y());
     162        if (maskContentUnits() == SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE)
     163            maskContextLocation.move(targetRect.x(), targetRect.y());
     164    } else {
     165        if (maskContentUnits() == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX)
     166            maskContextLocation.move(-targetRect.x(), -targetRect.y());
     167    }
    164168
    165169    GraphicsContext* maskImageContext = maskImage->context();
Note: See TracChangeset for help on using the changeset viewer.