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

Side by Side 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 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/platform/fonts/Font.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (C) 2013 Google Inc. All rights reserved. 1 // Copyright (C) 2013 Google Inc. All rights reserved.
2 // 2 //
3 // Redistribution and use in source and binary forms, with or without 3 // Redistribution and use in source and binary forms, with or without
4 // modification, are permitted provided that the following conditions are 4 // modification, are permitted provided that the following conditions are
5 // met: 5 // met:
6 // 6 //
7 // * Redistributions of source code must retain the above copyright 7 // * Redistributions of source code must retain the above copyright
8 // notice, this list of conditions and the following disclaimer. 8 // notice, this list of conditions and the following disclaimer.
9 // * Redistributions in binary form must reproduce the above 9 // * Redistributions in binary form must reproduce the above
10 // copyright notice, this list of conditions and the following disclaimer 10 // copyright notice, this list of conditions and the following disclaimer
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 } 73 }
74 74
75 GraphicsContext* context() const { return &m_context; } 75 GraphicsContext* context() const { return &m_context; }
76 bool saved() const { return m_saveAndRestore; } 76 bool saved() const { return m_saveAndRestore; }
77 77
78 private: 78 private:
79 GraphicsContext& m_context; 79 GraphicsContext& m_context;
80 bool m_saveAndRestore; 80 bool m_saveAndRestore;
81 }; 81 };
82 82
83 class GraphicsContextCTMSaver {
84 public:
85 GraphicsContextCTMSaver(GraphicsContext& context)
86 : m_canvas(context.contextDisabled() ? nullptr : context.canvas())
87 {
88 if (m_canvas)
89 m_savedMatrix = m_canvas->getTotalMatrix();
90 }
91
92 ~GraphicsContextCTMSaver()
93 {
94 if (m_canvas)
95 m_canvas->setMatrix(m_savedMatrix);
96 }
97
98 private:
99 SkMatrix m_savedMatrix;
100 SkCanvas* m_canvas;
101 };
102
83 } // namespace blink 103 } // namespace blink
84 104
85 #endif // GraphicsContextStateSaver_h 105 #endif // GraphicsContextStateSaver_h
OLDNEW
« 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