Index: Source/core/svg/graphics/SVGImage.cpp |
diff --git a/Source/core/svg/graphics/SVGImage.cpp b/Source/core/svg/graphics/SVGImage.cpp |
index efa8c7411982a6fedb9f5f5edb0bee63576aa03e..2514abf62f7ab967d0b4986bee537b4941902271 100644 |
--- a/Source/core/svg/graphics/SVGImage.cpp |
+++ b/Source/core/svg/graphics/SVGImage.cpp |
@@ -247,9 +247,11 @@ void SVGImage::draw(GraphicsContext* context, const FloatRect& dstRect, const Fl |
context->clip(enclosingIntRect(dstRect)); |
bool compositingRequiresTransparencyLayer = compositeOp != CompositeSourceOver || blendMode != blink::WebBlendModeNormal; |
- if (compositingRequiresTransparencyLayer) { |
- context->beginTransparencyLayer(1); |
- context->setCompositeOperation(CompositeSourceOver, blink::WebBlendModeNormal); |
+ bool requiresTransparencyLayer = compositingRequiresTransparencyLayer || context->alpha() < 1; |
+ if (requiresTransparencyLayer) { |
+ context->beginTransparencyLayer(context->alpha()); |
+ if (compositingRequiresTransparencyLayer) |
+ context->setCompositeOperation(CompositeSourceOver, blink::WebBlendModeNormal); |
} |
FloatSize scale(dstRect.width() / srcRect.width(), dstRect.height() / srcRect.height()); |
@@ -270,7 +272,7 @@ void SVGImage::draw(GraphicsContext* context, const FloatRect& dstRect, const Fl |
view->paint(context, enclosingIntRect(srcRect)); |
- if (compositingRequiresTransparencyLayer) |
+ if (requiresTransparencyLayer) |
context->endLayer(); |
stateSaver.restore(); |