Changeset 162341 in webkit


Ignore:
Timestamp:
Jan 20, 2014 8:15:45 AM (10 years ago)
Author:
commit-queue@webkit.org
Message:

Source/WebCore: Background-blend-mode doesn't work for an element with an
SVG image as background and border-style or padding set.
The problem consisted in the drawing path using the default
blending parameter at all times.
https://bugs.webkit.org/show_bug.cgi?id=118894

Patch by Mihai Tica <mitica@adobe.com> on 2014-01-20
Reviewed by Dirk Schulze.

Test: css3/compositing/background-blend-mode-data-uri-svg-image.html

  • svg/graphics/SVGImage.cpp:

(WebCore::SVGImage::drawPatternForContainer): Pass blendMode to Image::drawPattern.

  • svg/graphics/SVGImage.h: Add a blendMode parameter to drawPatternForContainer.
  • svg/graphics/SVGImageForContainer.cpp:

(WebCore::SVGImageForContainer::drawPattern): Pass blendMode to drawPatternForContainer call.

LayoutTests: Background-blend-mode doesn't work for an element with an
SVG image as background and border-style or padding set.
Tests now use rectangles instead of circles for SVGs.
https://bugs.webkit.org/show_bug.cgi?id=118894

Patch by Mihai Tica <mitica@adobe.com> on 2014-01-20
Reviewed by Dirk Schulze.

  • css3/compositing/background-blend-mode-data-uri-svg-image-expected.html:
  • css3/compositing/background-blend-mode-data-uri-svg-image.html:
  • platform/efl/TestExpectations: pass tests for efl, blendMode is not implemented.
  • platform/mac/TestExpectations: marking test as ImageOnlyFailure due to slight pixel inconsistencies between the result and the formula.
Location:
trunk
Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r162340 r162341  
     12014-01-20  Mihai Tica  <mitica@adobe.com>
     2
     3        Background-blend-mode doesn't work for an element with an
     4        SVG image as background and border-style or padding set.
     5        Tests now use rectangles instead of circles for SVGs.
     6        https://bugs.webkit.org/show_bug.cgi?id=118894
     7
     8        Reviewed by Dirk Schulze.
     9
     10        * css3/compositing/background-blend-mode-data-uri-svg-image-expected.html:
     11        * css3/compositing/background-blend-mode-data-uri-svg-image.html:
     12        * platform/efl/TestExpectations: pass tests for efl, blendMode is not implemented.
     13        * platform/mac/TestExpectations: marking test as ImageOnlyFailure due to slight pixel inconsistencies between the result and the formula.
     14
    1152014-01-20  Zalan Bujtas  <zalan@apple.com>
    216
  • trunk/LayoutTests/platform/efl/TestExpectations

    r162338 r162341  
    498498webkit.org/b/99200 css3/compositing/blend-mode-simple.html [ Skip ]
    499499webkit.org/b/99200 css3/compositing/blend-mode-should-not-have-compositing-layer.html [ Skip ]
     500webkit.org/b/118894 css3/compositing/background-blend-mode-data-uri-svg-image-expected.html [ Skip ]
    500501
    501502# No concept of secure text input
  • trunk/LayoutTests/platform/mac/TestExpectations

    r162340 r162341  
    616616compositing/overflow/scrolling-without-painting.html
    617617
     618# Blend mode result is slightly different than the applied formula.
     619css3/compositing/background-blend-mode-data-uri-svg-image-expected.html [ ImageOnlyFailure Pass ]
     620
    618621# https://bugs.webkit.org/show_bug.cgi?id=110871
    619622compositing/overlap-blending/reflection-opacity-huge.html
  • trunk/Source/WebCore/ChangeLog

    r162340 r162341  
     12014-01-20  Mihai Tica  <mitica@adobe.com>
     2
     3        Background-blend-mode doesn't work for an element with an
     4        SVG image as background and border-style or padding set.
     5        The problem consisted in the drawing path using the default
     6        blending parameter at all times.
     7        https://bugs.webkit.org/show_bug.cgi?id=118894
     8
     9        Reviewed by Dirk Schulze.
     10
     11        Test: css3/compositing/background-blend-mode-data-uri-svg-image.html
     12
     13        * svg/graphics/SVGImage.cpp:
     14        (WebCore::SVGImage::drawPatternForContainer): Pass blendMode to Image::drawPattern.
     15        * svg/graphics/SVGImage.h: Add a blendMode parameter to drawPatternForContainer.
     16        * svg/graphics/SVGImageForContainer.cpp:
     17        (WebCore::SVGImageForContainer::drawPattern): Pass blendMode to drawPatternForContainer call.
     18
    1192014-01-20  Zalan Bujtas  <zalan@apple.com>
    220
  • trunk/Source/WebCore/svg/graphics/SVGImage.cpp

    r162080 r162341  
    183183
    184184void SVGImage::drawPatternForContainer(GraphicsContext* context, const FloatSize containerSize, float zoom, const FloatRect& srcRect,
    185     const AffineTransform& patternTransform, const FloatPoint& phase, ColorSpace colorSpace, CompositeOperator compositeOp, const FloatRect& dstRect)
     185    const AffineTransform& patternTransform, const FloatPoint& phase, ColorSpace colorSpace, CompositeOperator compositeOp, const FloatRect& dstRect, BlendMode blendMode)
    186186{
    187187    FloatRect zoomedContainerRect = FloatRect(FloatPoint(), containerSize);
     
    214214
    215215    context->setDrawLuminanceMask(false);
    216     image->drawPattern(context, scaledSrcRect, unscaledPatternTransform, phase, colorSpace, compositeOp, dstRect);
     216    image->drawPattern(context, scaledSrcRect, unscaledPatternTransform, phase, colorSpace, compositeOp, dstRect, blendMode);
    217217}
    218218
  • trunk/Source/WebCore/svg/graphics/SVGImage.h

    r162158 r162341  
    9393    void drawForContainer(GraphicsContext*, const FloatSize, float, const FloatRect&, const FloatRect&, ColorSpace, CompositeOperator, BlendMode);
    9494    void drawPatternForContainer(GraphicsContext*, const FloatSize, float, const FloatRect&, const AffineTransform&, const FloatPoint&, ColorSpace,
    95         CompositeOperator, const FloatRect&);
     95        CompositeOperator, const FloatRect&, BlendMode);
    9696
    9797    std::unique_ptr<SVGImageChromeClient> m_chromeClient;
  • trunk/Source/WebCore/svg/graphics/SVGImageForContainer.cpp

    r162080 r162341  
    4444
    4545void SVGImageForContainer::drawPattern(GraphicsContext* context, const FloatRect& srcRect, const AffineTransform& patternTransform,
    46     const FloatPoint& phase, ColorSpace colorSpace, CompositeOperator compositeOp, const FloatRect& dstRect, BlendMode)
     46    const FloatPoint& phase, ColorSpace colorSpace, CompositeOperator compositeOp, const FloatRect& dstRect, BlendMode blendMode)
    4747{
    4848    m_image->setSpaceSize(spaceSize());
    49     m_image->drawPatternForContainer(context, m_containerSize, m_zoom, srcRect, patternTransform, phase, colorSpace, compositeOp, dstRect);
     49    m_image->drawPatternForContainer(context, m_containerSize, m_zoom, srcRect, patternTransform, phase, colorSpace, compositeOp, dstRect, blendMode);
    5050}
    5151
Note: See TracChangeset for help on using the changeset viewer.