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

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

Issue 651243002: Clarify GraphicsContext::beginLayer()/endLayer() have unexpected behaviors. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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
Index: Source/platform/graphics/GraphicsContext.cpp
diff --git a/Source/platform/graphics/GraphicsContext.cpp b/Source/platform/graphics/GraphicsContext.cpp
index 1fdbb54a9eca53d367f662b2f557efa68680b116..3ac323fea6d4efe7cf93383d3f91807f9c3f13ea 100644
--- a/Source/platform/graphics/GraphicsContext.cpp
+++ b/Source/platform/graphics/GraphicsContext.cpp
@@ -191,9 +191,10 @@ void GraphicsContext::saveLayer(const SkRect* bounds, const SkPaint* paint)
ASSERT(m_canvas);
- realizeCanvasSave();
-
+ m_paintState->incrementSaveCount();
+ m_canvasStateStack.append(CanvasSaveState(m_pendingCanvasSave, m_canvas->getSaveCount()));
m_canvas->saveLayer(bounds, paint);
+ m_pendingCanvasSave = false;
if (regionTrackingEnabled())
m_trackedRegion.pushCanvasLayer(paint);
}
@@ -205,7 +206,7 @@ void GraphicsContext::restoreLayer()
ASSERT(m_canvas);
- m_canvas->restore();
+ restore();
if (regionTrackingEnabled())
m_trackedRegion.popCanvasLayer(this);
}

Powered by Google App Engine
This is Rietveld 408576698