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

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

Issue 766693002: Get rid of getCTM/setCTM pair in Font::paintGlyphsVertical (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 1 month 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/fonts/Font.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/GraphicsContextStateSaver.h
diff --git a/Source/platform/graphics/GraphicsContextStateSaver.h b/Source/platform/graphics/GraphicsContextStateSaver.h
index 7134a98d938e44a9e0041b120a4cebc24238a54d..53e1105d01d5491af1d7ebb1845690581acae01f 100644
--- a/Source/platform/graphics/GraphicsContextStateSaver.h
+++ b/Source/platform/graphics/GraphicsContextStateSaver.h
@@ -80,6 +80,26 @@ private:
bool m_saveAndRestore;
};
+class GraphicsContextCTMSaver {
+public:
+ GraphicsContextCTMSaver(GraphicsContext& context)
+ : m_canvas(context.contextDisabled() ? nullptr : context.canvas())
+ {
+ if (m_canvas)
+ m_savedMatrix = m_canvas->getTotalMatrix();
+ }
+
+ ~GraphicsContextCTMSaver()
+ {
+ if (m_canvas)
+ m_canvas->setMatrix(m_savedMatrix);
+ }
+
+private:
+ SkMatrix m_savedMatrix;
+ SkCanvas* m_canvas;
+};
+
} // namespace blink
#endif // GraphicsContextStateSaver_h
« no previous file with comments | « Source/platform/fonts/Font.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698