Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1021)

Unified Diff: Source/core/svg/graphics/SVGImage.cpp

Issue 182853002: Replace use of GC::alpha() in SVGImage::draw() with GC::getNormalizedAlpha() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/platform/graphics/GraphicsContext.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/graphics/SVGImage.cpp
diff --git a/Source/core/svg/graphics/SVGImage.cpp b/Source/core/svg/graphics/SVGImage.cpp
index 2514abf62f7ab967d0b4986bee537b4941902271..0ecab5358c51c97dea5c3bfec64b959f6703eb2a 100644
--- a/Source/core/svg/graphics/SVGImage.cpp
+++ b/Source/core/svg/graphics/SVGImage.cpp
@@ -247,9 +247,10 @@ void SVGImage::draw(GraphicsContext* context, const FloatRect& dstRect, const Fl
context->clip(enclosingIntRect(dstRect));
bool compositingRequiresTransparencyLayer = compositeOp != CompositeSourceOver || blendMode != blink::WebBlendModeNormal;
- bool requiresTransparencyLayer = compositingRequiresTransparencyLayer || context->alpha() < 1;
+ float opacity = context->getNormalizedAlpha() / 255.f;
f(malita) 2014/02/27 13:23:37 nit: just "255" (per coding style).
fs 2014/02/27 14:31:56 Dropped the '.' (or this will be too binary.)
+ bool requiresTransparencyLayer = compositingRequiresTransparencyLayer || opacity < 1;
if (requiresTransparencyLayer) {
- context->beginTransparencyLayer(context->alpha());
+ context->beginTransparencyLayer(opacity);
if (compositingRequiresTransparencyLayer)
context->setCompositeOperation(CompositeSourceOver, blink::WebBlendModeNormal);
}
« no previous file with comments | « no previous file | Source/platform/graphics/GraphicsContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698