2010-08-12 Nikolas Zimmermann <nzimmermann@rim.com>
authorzimmermann@webkit.org <zimmermann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 Aug 2010 10:11:08 +0000 (10:11 +0000)
committerzimmermann@webkit.org <zimmermann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 Aug 2010 10:11:08 +0000 (10:11 +0000)
commitacdbe42a49a33edf98c0712ce8a99154643d1372
tree4fb93079177281e2a36de7832f9e96ace3edfa49
parent1eca63b3667f680b92ab8e62e363d9c20661765a
2010-08-12  Nikolas Zimmermann  <nzimmermann@rim.com>

        Reviewed by Dirk Schulze.

        SVG masking performance very slow
        https://bugs.webkit.org/show_bug.cgi?id=43622

        Create ImageBuffers only as large as the final rendered size on screen. Only gradient on text on CG handled this correctly so far.
        Refactored the code into a new SVGImageBufferTools class, and use the code from RenderSVGResourceMasker -> makes the IE9 demo SVG dice usable.
        Clippers, Patterns and Filters remain to be converted.

        Test: svg/zoom/page/zoom-mask-with-percentages.svg

        * Android.mk: Add SVGImageBufferTools.* to build.
        * CMakeLists.txt: Ditto.
        * GNUmakefile.am: Ditto.
        * WebCore.gypi: Ditto.
        * WebCore.pro: Ditto.
        * WebCore.xcodeproj/project.pbxproj: Ditto.
        * rendering/RenderSVGAllInOne.cpp: Ditto.
        * rendering/RenderSVGResourceGradient.cpp: Refactored CG gradient specific "create image buffer in absolute coordinates" code into SVGImageBufferTools class.
        (WebCore::createMaskAndSwapContextForTextGradient):
        (WebCore::clipToTextMask):
        (WebCore::RenderSVGResourceGradient::applyResource):
        * rendering/RenderSVGResourceMasker.cpp: Use new SVGImageBufferTools class, to avoid pixelation when zooming and to create image buffers as big as the final rendered size on screen, not more.
        (WebCore::RenderSVGResourceMasker::invalidateClients):
        (WebCore::RenderSVGResourceMasker::applyResource):
        (WebCore::RenderSVGResourceMasker::drawContentIntoMaskImage):
        (WebCore::RenderSVGResourceMasker::calculateMaskContentRepaintRect):
        (WebCore::RenderSVGResourceMasker::resourceBoundingBox):
        * rendering/RenderSVGResourceMasker.h:
        * rendering/SVGImageBufferTools.cpp: Added.
        (WebCore::SVGImageBufferTools::absoluteTransformFromContext):
        (WebCore::SVGImageBufferTools::createImageBuffer):
        (WebCore::SVGImageBufferTools::clipToImageBuffer):
        * rendering/SVGImageBufferTools.h: Added.
        (WebCore::SVGImageBufferTools::SVGImageBufferTools):
        (WebCore::SVGImageBufferTools::~SVGImageBufferTools):

2010-08-12  Nikolas Zimmermann  <nzimmermann@rim.com>

        Reviewed by Dirk Schulze.

        SVG masking performance very slow
        https://bugs.webkit.org/show_bug.cgi?id=43622

        Update mask results, now that mask image buffers are as big as the finaled rendered size on screen.
        Add new test covering zooming into masks, to show that it doesn't pixelate anymore.

        * platform/mac/svg/W3C-SVG-1.1/masking-intro-01-f-expected.checksum:
        * platform/mac/svg/W3C-SVG-1.1/masking-intro-01-f-expected.png:
        * platform/mac/svg/batik/masking/maskRegions-expected.checksum:
        * platform/mac/svg/batik/masking/maskRegions-expected.png:
        * platform/mac/svg/custom/grayscale-gradient-mask-expected.checksum:
        * platform/mac/svg/custom/grayscale-gradient-mask-expected.png:
        * platform/mac/svg/zoom/page/zoom-mask-with-percentages-expected.checksum: Added.
        * platform/mac/svg/zoom/page/zoom-mask-with-percentages-expected.png: Added.
        * platform/mac/svg/zoom/page/zoom-mask-with-percentages-expected.txt: Added.
        * svg/zoom/page/zoom-mask-with-percentages.svg: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@65229 268f45cc-cd09-0410-ab3c-d52691b4dbfc
25 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/mac/svg/W3C-SVG-1.1/masking-intro-01-f-expected.checksum
LayoutTests/platform/mac/svg/W3C-SVG-1.1/masking-intro-01-f-expected.png
LayoutTests/platform/mac/svg/batik/masking/maskRegions-expected.checksum
LayoutTests/platform/mac/svg/batik/masking/maskRegions-expected.png
LayoutTests/platform/mac/svg/custom/grayscale-gradient-mask-expected.checksum
LayoutTests/platform/mac/svg/custom/grayscale-gradient-mask-expected.png
LayoutTests/platform/mac/svg/zoom/page/zoom-mask-with-percentages-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac/svg/zoom/page/zoom-mask-with-percentages-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/svg/zoom/page/zoom-mask-with-percentages-expected.txt [new file with mode: 0644]
LayoutTests/svg/zoom/page/zoom-mask-with-percentages.svg [new file with mode: 0644]
LayoutTests/svg/zoom/page/zoom-mask.svg [new file with mode: 0644]
WebCore/Android.mk
WebCore/CMakeLists.txt
WebCore/ChangeLog
WebCore/GNUmakefile.am
WebCore/WebCore.gypi
WebCore/WebCore.pro
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/rendering/RenderSVGAllInOne.cpp
WebCore/rendering/RenderSVGResourceGradient.cpp
WebCore/rendering/RenderSVGResourceMasker.cpp
WebCore/rendering/RenderSVGResourceMasker.h
WebCore/rendering/SVGImageBufferTools.cpp [new file with mode: 0644]
WebCore/rendering/SVGImageBufferTools.h [new file with mode: 0644]