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

Unified Diff: Source/platform/graphics/GraphicsContext.cpp

Issue 658603002: 2D canvas: fix shadow rendering with compositing modes that require temp layers (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: comment fix Created 6 years, 2 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 | « Source/platform/graphics/GraphicsContext.h ('k') | Source/platform/graphics/GraphicsTypes.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/GraphicsContext.cpp
diff --git a/Source/platform/graphics/GraphicsContext.cpp b/Source/platform/graphics/GraphicsContext.cpp
index 1fdbb54a9eca53d367f662b2f557efa68680b116..07f090479d9a18b5a6e5731ad119ba19223a00a2 100644
--- a/Source/platform/graphics/GraphicsContext.cpp
+++ b/Source/platform/graphics/GraphicsContext.cpp
@@ -299,19 +299,26 @@ void GraphicsContext::setFillGradient(PassRefPtr<Gradient> gradient)
void GraphicsContext::setShadow(const FloatSize& offset, float blur, const Color& color,
DrawLooperBuilder::ShadowTransformMode shadowTransformMode,
- DrawLooperBuilder::ShadowAlphaMode shadowAlphaMode)
+ DrawLooperBuilder::ShadowAlphaMode shadowAlphaMode, ShadowMode shadowMode)
{
if (contextDisabled())
return;
+ OwnPtr<DrawLooperBuilder> drawLooperBuilder = DrawLooperBuilder::create();
if (!color.alpha() || (!offset.width() && !offset.height() && !blur)) {
+ if (shadowMode == DrawShadowOnly) {
+ // shadow only, but there is no shadow: use an empty draw looper to disable rendering of the source primitive
+ setDrawLooper(drawLooperBuilder.release());
+ return;
+ }
clearShadow();
return;
}
- OwnPtr<DrawLooperBuilder> drawLooperBuilder = DrawLooperBuilder::create();
drawLooperBuilder->addShadow(offset, blur, color, shadowTransformMode, shadowAlphaMode);
- drawLooperBuilder->addUnmodifiedContent();
+ if (shadowMode == DrawShadowAndForeground) {
+ drawLooperBuilder->addUnmodifiedContent();
+ }
setDrawLooper(drawLooperBuilder.release());
}
« no previous file with comments | « Source/platform/graphics/GraphicsContext.h ('k') | Source/platform/graphics/GraphicsTypes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698