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

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

Issue 212993004: GC::saveLayer() may taint the current clip. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated per comments. Created 6 years, 9 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 | « LayoutTests/TestExpectations ('k') | no next file » | 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 5f8fc1109c2669579e506d99d1ce31415100ce46..f4691ddf85cd5bb21342d48c83abaa746c5151dc 100644
--- a/Source/platform/graphics/GraphicsContext.cpp
+++ b/Source/platform/graphics/GraphicsContext.cpp
@@ -186,6 +186,10 @@ void GraphicsContext::saveLayer(const SkRect* bounds, const SkPaint* paint, SkCa
realizeCanvasSave(SkCanvas::kMatrixClip_SaveFlag);
+ // We should always save the matrix and clip to match upcoming Skia behavior.
+ ASSERT(saveFlags & SkCanvas::kMatrix_SaveFlag);
+ ASSERT(saveFlags & SkCanvas::kClip_SaveFlag);
+
m_canvas->saveLayer(bounds, paint, saveFlags);
if (bounds)
m_canvas->clipRect(*bounds);
@@ -455,7 +459,8 @@ void GraphicsContext::beginLayer(float opacity, CompositeOperator op, const Floa
// (the surface of the page) but layers on top may have transparent parts.
// Without explicitly setting the alpha flag, the layer will inherit the
// opaque setting of the base and some things won't work properly.
- SkCanvas::SaveFlags saveFlags = static_cast<SkCanvas::SaveFlags>(SkCanvas::kHasAlphaLayer_SaveFlag | SkCanvas::kFullColorLayer_SaveFlag);
+ SkCanvas::SaveFlags saveFlags = static_cast<SkCanvas::SaveFlags>(
+ SkCanvas::kMatrixClip_SaveFlag | SkCanvas::kHasAlphaLayer_SaveFlag | SkCanvas::kFullColorLayer_SaveFlag);
SkPaint layerPaint;
layerPaint.setAlpha(static_cast<unsigned char>(opacity * 255));
« no previous file with comments | « LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698