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

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

Issue 212643013: Use default SkCanvas::save() flags. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 | « 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 e87a86483b657123c43cfe11b55fa82dc7fc606d..add6d3c26e59a1e6324dce9fc15eb4094038e3fd 100644
--- a/Source/platform/graphics/GraphicsContext.h
+++ b/Source/platform/graphics/GraphicsContext.h
@@ -79,7 +79,7 @@ public:
SkCanvas* canvas()
{
// Flush any pending saves.
- realizeCanvasSave(SkCanvas::kMatrixClip_SaveFlag);
+ realizeCanvasSave();
return m_canvas;
}
@@ -446,12 +446,13 @@ private:
}
// Apply deferred canvas state saves
- void realizeCanvasSave(SkCanvas::SaveFlags flags)
+ void realizeCanvasSave()
{
- if (m_canvasSaveFlags & flags) {
- m_canvas->save((SkCanvas::SaveFlags)m_canvasSaveFlags);
- m_canvasSaveFlags = 0;
- }
+ if (!m_pendingCanvasSave)
+ return;
+
+ m_canvas->save();
+ m_pendingCanvasSave = false;
}
void didDrawTextInRect(const SkRect& textRect);
@@ -475,12 +476,9 @@ private:
// 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.
- // FIXME: While defined as a bitmask of SkCanvas::SaveFlags, this is mostly used as a bool.
- // It will come in handy when adding granular save() support (clip vs. matrix vs. paint).
- // crbug.com/233713
struct CanvasSaveState;
- unsigned m_canvasSaveFlags;
Vector<CanvasSaveState> m_canvasStateStack;
+ bool m_pendingCanvasSave;
Stephen Chennney 2014/03/27 14:15:41 Maybe in a follow up, move this and the other bool
AnnotationModeFlags m_annotationMode;
« 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