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

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

Issue 653153004: Remove GraphicsContext's deferred save mechanism. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: minor cleanup 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 | « no previous file | 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 e1ea64f874a750e30615d7840d379160a040e096..42189353bdfe69e13ce2c54ddf4266a8c248cf2f 100644
--- a/Source/platform/graphics/GraphicsContext.h
+++ b/Source/platform/graphics/GraphicsContext.h
@@ -82,20 +82,8 @@ public:
~GraphicsContext();
- // Returns the canvas used for painting. Must not be called if painting is disabled.
- // Accessing the backing canvas this way flushes all queued save ops,
- // so it should be avoided. Use the corresponding draw/matrix/clip methods instead.
- SkCanvas* canvas()
- {
- // Flush any pending saves.
- realizeCanvasSave();
-
- return m_canvas;
- }
- const SkCanvas* canvas() const
- {
- return m_canvas;
- }
+ SkCanvas* canvas() { return m_canvas; }
+ const SkCanvas* canvas() const { return m_canvas; }
void resetCanvas(SkCanvas*);
@@ -104,8 +92,9 @@ public:
// ---------- State management methods -----------------
void save();
void restore();
- unsigned saveCount() { return m_canvasStateStack.size(); }
+
#if ENABLE(ASSERT)
+ unsigned saveCount() const;
void disableDestructionChecks() { m_disableDestructionChecks = true; }
#endif
@@ -478,17 +467,6 @@ private:
}
}
- // Apply deferred canvas state saves
- void realizeCanvasSave()
- {
- if (!m_pendingCanvasSave || contextDisabled())
- return;
-
- ASSERT(m_canvas); // m_pendingCanvasSave should never be true when no canvas.
- m_canvas->save();
- m_pendingCanvasSave = false;
- }
-
void didDrawTextInRect(const SkRect& textRect);
void fillRectWithRoundedHole(const IntRect&, const RoundedRect& roundedHoleRect, const Color&);
@@ -507,13 +485,6 @@ private:
// Raw pointer to the current state.
GraphicsContextState* m_paintState;
- // Currently pending save flags for Skia Canvas state.
- // Canvas state includes the canavs, it's matrix and clips. Think of it as _where_
- // the draw operations will happen.
- struct CanvasSaveState;
- Vector<CanvasSaveState> m_canvasStateStack;
- bool m_pendingCanvasSave;
-
AnnotationModeFlags m_annotationMode;
struct RecordingState;
« no previous file with comments | « no previous file | Source/platform/graphics/GraphicsContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698