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

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

Issue 541913002: Create a GraphicsContext from a DisplayList. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@display-list-changes
Patch Set: Rebased. Created 6 years, 3 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/DisplayList.h ('k') | Source/platform/graphics/GraphicsContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/GraphicsContext.h
diff --git a/Source/platform/graphics/GraphicsContext.h b/Source/platform/graphics/GraphicsContext.h
index 7a9635fc388cd0ae684989e991a802ad48fabc72..9b5705ac5652ad56b239da2cae82a212085607b7 100644
--- a/Source/platform/graphics/GraphicsContext.h
+++ b/Source/platform/graphics/GraphicsContext.h
@@ -75,7 +75,11 @@ public:
FullyDisabled = 1 // Do absolutely minimal work to remove the cost of the context from performance tests.
};
+ // A 0 canvas is allowed, but in such cases the context must only have canvas
+ // related commands called when within a beginRecording/endRecording block.
+ // Furthermore, save/restore calls must be balanced any time the canvas is 0.
explicit GraphicsContext(SkCanvas*, DisabledMode = NothingDisabled);
+
~GraphicsContext();
// Returns the canvas used for painting. Must not be called if painting is disabled.
@@ -480,6 +484,7 @@ private:
if (!m_pendingCanvasSave || contextDisabled())
return;
+ ASSERT(m_canvas); // m_pendingCanvasSave should never be true when no canvas.
m_canvas->save();
m_pendingCanvasSave = false;
}
« no previous file with comments | « Source/platform/graphics/DisplayList.h ('k') | Source/platform/graphics/GraphicsContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698