Changeset 35694 in webkit


Ignore:
Timestamp:
Aug 12, 2008 2:11:17 PM (16 years ago)
Author:
Nikolas Zimmermann
Message:

Reviewed by Dave.

Fixes: https://bugs.webkit.org/show_bug.cgi?id=19798
Masks are translated, and the mask images are swapped on the y-axis.

Turned out that http://trac.webkit.org/changeset/31830/trunk/WebCore/svg/graphics/cg/SVGResourceMaskerCg.mm
is guilty. GraphicsContext::clipToImageBuffer() does some extra transformations that SVGResourcesMaskerCg does not want.

Long term goal is to remove the SVGResource*/SVGPaintServer* classes anyway, so it's okay to duplicate
the "clip to image buffer" functionality, in the CG specific SVGResourceMaskerCg class - as it was before.

Location:
trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r35693 r35694  
     12008-08-12  Nikolas Zimmermann  <zimmermann@kde.org>
     2
     3        Reviewed by Dave.
     4
     5        Fix mask regressions.
     6
     7        * platform/mac/svg/W3C-SVG-1.1/coords-viewattr-02-b-expected.checksum:
     8        * platform/mac/svg/W3C-SVG-1.1/coords-viewattr-02-b-expected.png:
     9        * platform/mac/svg/W3C-SVG-1.1/masking-intro-01-f-expected.checksum:
     10        * platform/mac/svg/W3C-SVG-1.1/masking-intro-01-f-expected.png:
     11        * platform/mac/svg/W3C-SVG-1.1/masking-mask-01-b-expected.checksum:
     12        * platform/mac/svg/W3C-SVG-1.1/masking-mask-01-b-expected.png:
     13        * platform/mac/svg/batik/masking/maskRegions-expected.checksum:
     14        * platform/mac/svg/batik/masking/maskRegions-expected.png:
     15        * platform/mac/svg/custom/grayscale-gradient-mask-expected.checksum:
     16        * platform/mac/svg/custom/grayscale-gradient-mask-expected.png:
     17
    1182008-08-12  Nikolas Zimmermann  <zimmermann@kde.org>
    219
  • trunk/LayoutTests/platform/mac/svg/W3C-SVG-1.1/coords-viewattr-02-b-expected.checksum

    r35366 r35694  
    1 509b58139e12cd0c4e3b38d338804550
     1be73e6c5a39a298401e8db705c302dff
  • trunk/LayoutTests/platform/mac/svg/W3C-SVG-1.1/masking-intro-01-f-expected.checksum

    r35366 r35694  
    1 4569ef085008a08747e925836ede7aad
     1c812df45c4af54284c403ea394fa30a5
  • trunk/LayoutTests/platform/mac/svg/W3C-SVG-1.1/masking-mask-01-b-expected.checksum

    r35366 r35694  
    1 73bba09f5d59356e55badea094466267
     1999c8b450c55e903547b1407ecfbace7
  • trunk/LayoutTests/platform/mac/svg/batik/masking/maskRegions-expected.checksum

    r35366 r35694  
    1 f5d1c5798b00a4f96be7ccc75f8e4920
     19501fd201fe62aafbff484083139d1d5
  • trunk/LayoutTests/platform/mac/svg/custom/grayscale-gradient-mask-expected.checksum

    r35366 r35694  
    1 f80f406231e330c9bd5c44b95b554662
     1fca46210d4dfadde21f8781c78c11531
  • trunk/WebCore/ChangeLog

    r35691 r35694  
     12008-08-12  Nikolas Zimmermann  <zimmermann@kde.org>
     2
     3        Reviewed by Dave.
     4   
     5        Fixes: https://bugs.webkit.org/show_bug.cgi?id=19798
     6        Masks are translated, and the mask images are swapped on the y-axis.
     7
     8        Turned out that http://trac.webkit.org/changeset/31830/trunk/WebCore/svg/graphics/cg/SVGResourceMaskerCg.mm
     9        is guilty. GraphicsContext::clipToImageBuffer() does some extra transformations that SVGResourcesMaskerCg does not want.
     10
     11        Long term goal is to remove the SVGResource*/SVGPaintServer* classes anyway, so it's okay to duplicate
     12        the "clip to image buffer" functionality, in the CG specific SVGResourceMaskerCg class - as it was before.
     13
     14        * svg/graphics/cg/SVGResourceMaskerCg.mm:
     15        (WebCore::SVGResourceMasker::applyMask): Changed back to use CG clipping again.
     16
    1172008-08-12  Dan Bernstein  <mitz@apple.com>
    218
  • trunk/WebCore/svg/graphics/cg/SVGResourceMaskerCg.mm

    r31830 r35694  
    9797    if (!m_mask)
    9898        m_mask.set(m_ownerElement->drawMaskerContent(boundingBox, m_maskRect).release());
     99
    99100    if (!m_mask)
    100101        return;
    101    
     102
    102103    IntSize maskSize(static_cast<int>(m_maskRect.width()), static_cast<int>(m_maskRect.height()));
    103104    clampImageBufferSizeToViewport(m_ownerElement->document()->renderer(), maskSize);
     
    107108    if (!grayScaleImage.get())
    108109        return;
    109    
     110
    110111    BEGIN_BLOCK_OBJC_EXCEPTIONS
    111112    CGContextRef grayScaleContext = grayScaleImage->context()->platformContext();
     
    116117    if (!colorMask)
    117118        return;
     119
    118120    CIImage* grayScaleMask = transformImageIntoGrayscaleMask(colorMask);
    119121    [ciGrayscaleContext drawImage:grayScaleMask atPoint:CGPointZero fromRect:CGRectMake(0, 0, maskSize.width(), maskSize.height())];
    120122
    121     context->clipToImageBuffer(m_maskRect, grayScaleImage.get());
     123    CGContextClipToMask(context->platformContext(), m_maskRect, grayScaleImage->cgImage());
    122124    END_BLOCK_OBJC_EXCEPTIONS
    123125}
Note: See TracChangeset for help on using the changeset viewer.