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

Unified Diff: gm/dftext.cpp

Issue 634923002: Fix perspective version of dftext GM (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/dftext.cpp
diff --git a/gm/dftext.cpp b/gm/dftext.cpp
index acaffb2e1c3e44556f18c0cd38b270985a546478..e36d58e845cf8ec1fc0560aa85af3999cd298f07 100755
--- a/gm/dftext.cpp
+++ b/gm/dftext.cpp
@@ -56,10 +56,11 @@ protected:
SkSurfaceProps::kLegacyFontHost_InitType);
SkAutoTUnref<SkSurface> surface(SkSurface::NewRenderTarget(ctx, info, 0, &props));
SkCanvas* canvas = surface.get() ? surface->getCanvas() : inputCanvas;
+ // init our new canvas with the old canvas's matrix
+ canvas->setMatrix(inputCanvas->getTotalMatrix());
#else
SkCanvas* canvas = inputCanvas;
#endif
-
// apply global scale to test glyph positioning
canvas->scale(1.05f, 1.05f);
canvas->clear(0xffffffff);
@@ -187,6 +188,9 @@ protected:
#if SK_SUPPORT_GPU
// render offscreen buffer
if (surface) {
+ SkAutoCanvasRestore acr(inputCanvas, true);
+ // since we prepended this matrix already, we blit using identity
+ inputCanvas->resetMatrix();
SkImage* image = surface->newImageSnapshot();
inputCanvas->drawImage(image, 0, 0, NULL);
image->unref();
« 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