aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/dftext.cpp
diff options
context:
space:
mode:
authorGravatar jvanverth <jvanverth@google.com>2014-10-07 07:59:45 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-10-07 07:59:46 -0700
commitf9669f43bff92419aba11c4a33c76f3e2daf2a44 (patch)
treecacc7d8e07715f18ad78f8781be24f51209d5479 /gm/dftext.cpp
parentd14e1a27643125bfef37fa0ed314b64c1fae22b7 (diff)
Fix perspective version of dftext GM
Diffstat (limited to 'gm/dftext.cpp')
-rwxr-xr-xgm/dftext.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/gm/dftext.cpp b/gm/dftext.cpp
index acaffb2e1c..e36d58e845 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();