Skip to content
  • zimmermann@webkit.org's avatar
    2012-01-27 Branimir Lambov <blambov@google.com> · 902caa70
    zimmermann@webkit.org authored
            SVG filters incorrectly move elements
            https://bugs.webkit.org/show_bug.cgi?id=73643
    
            Reviewed by Nikolas Zimmermann.
    
            New tests and updated expectations.
    
            * platform/chromium-linux/svg/W3C-SVG-1.1/filters-color-01-b-expected.png:
            * platform/chromium-linux/svg/W3C-SVG-1.1/filters-comptran-01-b-expected.png:
            * platform/chromium-linux/svg/W3C-SVG-1.1/filters-example-01-b-expected.png:
            * platform/chromium-linux/svg/W3C-SVG-1.1/filters-morph-01-f-expected.png:
            * platform/chromium-linux/svg/W3C-SVG-1.1/fonts-elem-04-b-expected.png: Removed.
            * platform/chromium-linux/svg/W3C-SVG-1.1/fonts-elem-04-b-expected.txt: Removed.
            * platform/chromium-linux/svg/W3C-SVG-1.1/masking-path-01-b-expected.png:
            * platform/chromium-linux/svg/batik/filters/feTile-expected.png:
            * platform/chromium-linux/svg/clip-path/clipper-placement-issue-expected.png: Added.
            * platform/chromium-linux/svg/clip-path/deep-nested-clip-in-mask-different-unitTypes-expected.png:
            * platform/chromium-linux/svg/custom/feComponentTransfer-Discrete-expected.png:
            * platform/chromium-linux/svg/custom/feComponentTransfer-Gamma-expected.png:
            * platform/chromium-linux/svg/custom/feComponentTransfer-Linear-expected.png:
            * platform/chromium-linux/svg/custom/feComponentTransfer-Table-expected.png:
            * platform/chromium-linux/svg/dynamic-updates/SVGFEColorMatrixElement-dom-in-attr-expected.png:
            * platform/chromium-linux/svg/dynamic-updates/SVGFEColorMatrixElement-dom-type-attr-expected.png:
            * platform/chromium-linux/svg/dynamic-updates/SVGFEColorMatrixElement-dom-values-attr-expected.png:
            * platform/chromium-linux/svg/dynamic-updates/SVGFEColorMatrixElement-svgdom-in-prop-expected.png:
            * platform/chromium-linux/svg/dynamic-updates/SVGMaskElement-dom-height-attr-expected.png:
            * platform/chromium-linux/svg/dynamic-updates/SVGMaskElement-dom-maskContentUnits-attr-expected.png:
            * platform/chromium-linux/svg/dynamic-updates/SVGMaskElement-dom-width-attr-expected.png:
            * platform/chromium-linux/svg/dynamic-updates/SVGMaskElement-dom-x-attr-expected.png:
            * platform/chromium-linux/svg/dynamic-updates/SVGMaskElement-dom-y-attr-expected.png:
            * platform/chromium-linux/svg/dynamic-updates/SVGMaskElement-svgdom-height-prop-expected.png:
            * platform/chromium-linux/svg/dynamic-updates/SVGMaskElement-svgdom-maskContentUnits-prop-expected.png:
            * platform/chromium-linux/svg/dynamic-updates/SVGMaskElement-svgdom-width-prop-expected.png:
            * platform/chromium-linux/svg/dynamic-updates/SVGMaskElement-svgdom-x-prop-expected.png:
            * platform/chromium-linux/svg/dynamic-updates/SVGMaskElement-svgdom-y-prop-expected.png:
            * platform/chromium-linux/svg/filters/big-sized-filter-expected.png: Added.
            * platform/chromium-linux/svg/filters/feDropShadow-expected.png:
            * platform/chromium-linux/svg/filters/filter-placement-issue-expected.png: Added.
            * platform/chromium-linux/svg/filters/filterRes-expected.png:
            * platform/chromium-linux/svg/filters/filterRes-expected.txt: Removed.
            * platform/chromium-linux/svg/filters/filterRes2-expected.png: Added.
            * platform/chromium-linux/svg/wicd/test-scalable-background-image1-expected.png:
            * platform/chromium-win/svg/as-background-image/svg-as-background-2-expected.png:
            * platform/chromium-win/svg/filters/big-sized-filter-expected.png:
            * platform/chromium/test_expectations.txt:
            * platform/mac-snowleopard/svg/W3C-SVG-1.1/filters-color-01-b-expected.png:
            * platform/mac-snowleopard/svg/W3C-SVG-1.1/filters-comptran-01-b-expected.png:
            * platform/mac-snowleopard/svg/W3C-SVG-1.1/filters-morph-01-f-expected.png:
            * platform/mac-snowleopard/svg/custom/absolute-sized-content-with-resources-expected.png:
            * platform/mac-snowleopard/svg/custom/feComponentTransfer-Discrete-expected.png:
            * platform/mac-snowleopard/svg/custom/feComponentTransfer-Gamma-expected.png:
            * platform/mac-snowleopard/svg/custom/feComponentTransfer-Linear-expected.png:
            * platform/mac-snowleopard/svg/custom/feComponentTransfer-Table-expected.png:
            * platform/mac-snowleopard/svg/dynamic-updates/SVGFEColorMatrixElement-dom-in-attr-expected.png:
            * platform/mac-snowleopard/svg/dynamic-updates/SVGFEColorMatrixElement-dom-type-attr-expected.png:
            * platform/mac-snowleopard/svg/dynamic-updates/SVGFEColorMatrixElement-dom-values-attr-expected.png:
            * platform/mac-snowleopard/svg/dynamic-updates/SVGFEColorMatrixElement-svgdom-in-prop-expected.png:
            * platform/mac-snowleopard/svg/dynamic-updates/SVGFEColorMatrixElement-svgdom-type-prop-expected.png:
            * platform/mac-snowleopard/svg/dynamic-updates/SVGFEColorMatrixElement-svgdom-values-prop-expected.png:
            * platform/mac/svg/W3C-SVG-1.1/filters-color-01-b-expected.png:
            * platform/mac/svg/W3C-SVG-1.1/filters-comptran-01-b-expected.png:
            * platform/mac/svg/W3C-SVG-1.1/filters-example-01-b-expected.png:
            * platform/mac/svg/W3C-SVG-1.1/filters-morph-01-f-expected.png:
            * platform/mac/svg/W3C-SVG-1.1/masking-path-01-b-expected.png:
            * platform/mac/svg/W3C-SVG-1.1/pservers-grad-08-b-expected.png:
            * platform/mac/svg/as-background-image/svg-as-background-6-expected.png:
            * platform/mac/svg/batik/filters/feTile-expected.png:
            * platform/mac/svg/batik/masking/maskRegions-expected.png:
            * platform/mac/svg/clip-path/clip-in-clip-expected.png: Added.
            * platform/mac/svg/clip-path/clip-in-clip-expected.txt: Added.
            * platform/mac/svg/clip-path/clipper-placement-issue-expected.png: Added.
            * platform/mac/svg/clip-path/clipper-placement-issue-expected.txt: Added.
            * platform/mac/svg/custom/absolute-sized-content-with-resources-expected.png:
            * platform/mac/svg/custom/feComponentTransfer-Discrete-expected.png:
            * platform/mac/svg/custom/feComponentTransfer-Gamma-expected.png:
            * platform/mac/svg/custom/feComponentTransfer-Linear-expected.png:
            * platform/mac/svg/custom/feComponentTransfer-Table-expected.png:
            * platform/mac/svg/custom/grayscale-gradient-mask-2-expected.png:
            * platform/mac/svg/custom/grayscale-gradient-mask-expected.png:
            * platform/mac/svg/custom/js-late-gradient-and-object-creation-expected.png:
            * platform/mac/svg/custom/js-late-gradient-creation-expected.png:
            * platform/mac/svg/custom/text-rotated-gradient-expected.png:
            * platform/mac/svg/dynamic-updates/SVGFEColorMatrixElement-dom-in-attr-expected.png:
            * platform/mac/svg/dynamic-updates/SVGFEColorMatrixElement-dom-type-attr-expected.png:
            * platform/mac/svg/dynamic-updates/SVGFEColorMatrixElement-dom-values-attr-expected.png:
            * platform/mac/svg/dynamic-updates/SVGFEColorMatrixElement-svgdom-in-prop-expected.png:
            * platform/mac/svg/dynamic-updates/SVGFEColorMatrixElement-svgdom-type-prop-expected.png:
            * platform/mac/svg/dynamic-updates/SVGFEColorMatrixElement-svgdom-values-prop-expected.png:
            * platform/mac/svg/dynamic-updates/SVGMaskElement-dom-height-attr-expected.png:
            * platform/mac/svg/dynamic-updates/SVGMaskElement-dom-maskContentUnits-attr-expected.png:
            * platform/mac/svg/dynamic-updates/SVGMaskElement-dom-width-attr-expected.png:
            * platform/mac/svg/dynamic-updates/SVGMaskElement-dom-x-attr-expected.png:
            * platform/mac/svg/dynamic-updates/SVGMaskElement-dom-y-attr-expected.png:
            * platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-height-prop-expected.png:
            * platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-maskContentUnits-prop-expected.png:
            * platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-width-prop-expected.png:
            * platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-x-prop-expected.png:
            * platform/mac/svg/dynamic-updates/SVGMaskElement-svgdom-y-prop-expected.png:
            * platform/mac/svg/filters/big-sized-filter-expected.png:
            * platform/mac/svg/filters/feDropShadow-expected.png:
            * platform/mac/svg/filters/filter-placement-issue-expected.png: Added.
            * platform/mac/svg/filters/filter-placement-issue-expected.txt: Added.
            * platform/mac/svg/filters/filterRes-expected.png:
            * platform/mac/svg/filters/filterRes2-expected.png:
            * platform/mac/svg/text/selection-background-color-expected.png:
            * platform/mac/svg/transforms/text-with-mask-with-svg-transform-expected.png:
            * platform/mac/svg/zoom/page/zoom-mask-with-percentages-expected.png:
            * svg/clip-path/clip-in-clip.svg: Added.
            * svg/clip-path/clipper-placement-issue.svg: Added.
            * svg/filters/filter-placement-issue.svg: Added.
    
    2012-01-27  Branimir Lambov  <blambov@google.com>
    
            SVG filters incorrectly move elements
            https://bugs.webkit.org/show_bug.cgi?id=73643
    
            Reviewed by Nikolas Zimmermann.
    
            Fixes SVG image buffer creation to use the enclosing integer rect
            instead of unstable rounded coordinates with scaling which was causing
            animated images to jump around under filters. The image buffer was not
            aligned on a pixel boundary, and thus the positions and sizes of anything
            drawn under that filter changed by 1-2 pixels compared to the same
            elements drawn without an intermediate buffer, or drawn with a buffer
            with a different target rectangle.
    
            The change improves the positioning of clip paths, masks and filters.
    
            Tests: svg/clip-path/clip-in-clip.svg
                   svg/clip-path/clipper-placement-issue.svg
                   svg/filters/filter-placement-issue.svg
    
            * platform/graphics/filters/FETile.cpp:
            (WebCore::FETile::platformApplySoftware):
            * rendering/svg/RenderSVGResourceClipper.cpp:
            (WebCore::RenderSVGResourceClipper::applyClippingToContext):
            * rendering/svg/RenderSVGResourceFilter.cpp:
            (WebCore::RenderSVGResourceFilter::applyResource):
            * rendering/svg/RenderSVGResourceGradient.cpp:
            (WebCore::createMaskAndSwapContextForTextGradient):
            (WebCore::clipToTextMask):
            * rendering/svg/RenderSVGResourceMasker.cpp:
            (WebCore::RenderSVGResourceMasker::applyResource):
            (WebCore::RenderSVGResourceMasker::drawContentIntoMaskImage):
            * rendering/svg/RenderSVGResourcePattern.cpp:
            (WebCore::RenderSVGResourcePattern::createTileImage):
            * rendering/svg/SVGImageBufferTools.cpp:
            (WebCore::SVGImageBufferTools::createImageBuffer):
            (WebCore::SVGImageBufferTools::createImageBufferForPattern):
            (WebCore::SVGImageBufferTools::clipToImageBuffer):
            (WebCore::SVGImageBufferTools::clampedAbsoluteTargetRect):
            (WebCore::SVGImageBufferTools::clampedAbsoluteSize):
            * rendering/svg/SVGImageBufferTools.h:
            (WebCore::SVGImageBufferTools::calcImageBufferRect):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@106108 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    902caa70