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

Unified Diff: Source/platform/fonts/Font.cpp

Issue 748863004: 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/fonts/Font.cpp
diff --git a/Source/platform/fonts/Font.cpp b/Source/platform/fonts/Font.cpp
index 93b12a3ba0bb06cb49f702f066ac1d2e68119010..77e96a0143c4b58e6615d4c61eef1f4441bf2ee4 100644
--- a/Source/platform/fonts/Font.cpp
+++ b/Source/platform/fonts/Font.cpp
@@ -39,6 +39,7 @@
#include "platform/fonts/shaping/SimpleShaper.h"
#include "platform/geometry/FloatRect.h"
#include "platform/graphics/GraphicsContext.h"
+#include "platform/graphics/GraphicsContextStateSaver.h"
#include "platform/text/TextRun.h"
#include "wtf/MainThread.h"
#include "wtf/StdLibExtras.h"
@@ -801,7 +802,7 @@ void Font::paintGlyphsVertical(GraphicsContext* gc, const SimpleFontData* font,
float initialAdvance = glyphBuffer.xOffsetAt(from);
FloatPoint adjustedPoint(point.x() + initialAdvance, point.y());
- AffineTransform savedMatrix = gc->getCTM();
+ GraphicsContextStateSaver stateSaver(*gc);
gc->concatCTM(AffineTransform(0, -1, 1, 0, adjustedPoint.x(), adjustedPoint.y()));
gc->concatCTM(AffineTransform(1, 0, 0, 1, -adjustedPoint.x(), -adjustedPoint.y()));
@@ -829,8 +830,6 @@ void Font::paintGlyphsVertical(GraphicsContext* gc, const SimpleFontData* font,
}
paintGlyphs(gc, font, glyphs, chunkLength, pos, textRect);
}
-
- gc->setCTM(savedMatrix);
}
void Font::drawGlyphs(GraphicsContext* gc, const SimpleFontData* font,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698