Changeset 162517 in webkit


Ignore:
Timestamp:
Jan 22, 2014 6:53:15 AM (10 years ago)
Author:
commit-queue@webkit.org
Message:

[CSS Background Blending] -webkit-background-blend-mode fails for certain SVG files
https://bugs.webkit.org/show_bug.cgi?id=127350

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

Source/WebCore:

The graphics context of the SVG inherits the blend mode set
on the background layer. Fix consists in drawing the SVG
in a transparency layer.

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

  • svg/graphics/SVGImage.cpp:

(WebCore::SVGImage::draw): Begin a transparency layer if a blend mode is set.

LayoutTests:

  • css3/compositing/background-blend-mode-svg-expected.html: Added.
  • css3/compositing/background-blend-mode-svg.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r162515 r162517  
     12014-01-22  Mihai Tica  <mitica@adobe.com>
     2
     3        [CSS Background Blending] -webkit-background-blend-mode fails for certain SVG files
     4        https://bugs.webkit.org/show_bug.cgi?id=127350
     5
     6        Reviewed by Dirk Schulze.
     7
     8        * css3/compositing/background-blend-mode-svg-expected.html: Added.
     9        * css3/compositing/background-blend-mode-svg.html: Added.
     10
    1112014-01-22  Antti Koivisto  <antti@apple.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r162515 r162517  
     12014-01-22  Mihai Tica  <mitica@adobe.com>
     2
     3        [CSS Background Blending] -webkit-background-blend-mode fails for certain SVG files
     4        https://bugs.webkit.org/show_bug.cgi?id=127350
     5
     6        Reviewed by Dirk Schulze.
     7
     8        The graphics context of the SVG inherits the blend mode set
     9        on the background layer. Fix consists in drawing the SVG
     10        in a transparency layer.
     11
     12        Test: css3/compositing/background-blend-mode-svg.html
     13
     14        * svg/graphics/SVGImage.cpp:
     15        (WebCore::SVGImage::draw): Begin a transparency layer if a blend mode is set.
     16
    1172014-01-22  Antti Koivisto  <antti@apple.com>
    218
  • trunk/Source/WebCore/svg/graphics/SVGImage.cpp

    r162341 r162517  
    227227    context->setCompositeOperation(compositeOp, blendMode);
    228228    context->clip(enclosingIntRect(dstRect));
    229     if (compositeOp != CompositeSourceOver)
     229    bool compositingRequiresTransparencyLayer = compositeOp != CompositeSourceOver || blendMode != BlendModeNormal;
     230    if (compositingRequiresTransparencyLayer) {
    230231        context->beginTransparencyLayer(1);
     232        context->setCompositeOperation(CompositeSourceOver, BlendModeNormal);
     233    }
    231234
    232235    FloatSize scale(dstRect.width() / srcRect.width(), dstRect.height() / srcRect.height());
     
    247250    view->paint(context, enclosingIntRect(srcRect));
    248251
    249     if (compositeOp != CompositeSourceOver)
     252    if (compositingRequiresTransparencyLayer)
    250253        context->endTransparencyLayer();
    251254
Note: See TracChangeset for help on using the changeset viewer.