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

Unified Diff: ui/gfx/nine_image_painter.cc

Issue 1425163002: gfx: Rename canvas SaveAndUnscale to UnscaleTheDeviceScaleFactor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ninepatchscale
Patch Set: scopedunscale: . Created 5 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
Index: ui/gfx/nine_image_painter.cc
diff --git a/ui/gfx/nine_image_painter.cc b/ui/gfx/nine_image_painter.cc
index 040678d1a2fab7d5e09f6956f79ed9b2668bd618..68a2460b7cee9df71bf582155e8fa0d93c1d4ae1 100644
--- a/ui/gfx/nine_image_painter.cc
+++ b/ui/gfx/nine_image_painter.cc
@@ -88,8 +88,10 @@ void NineImagePainter::Paint(Canvas* canvas,
if (IsEmpty())
return;
+ ScopedCanvas scoped(canvas);
+
// Painting at physical device pixels (undo device scale factor).
- float scale = canvas->SaveAndUnscale();
+ const float scale = canvas->UnscaleTheDeviceScaleFactor();
// Since the drawing from the following Fill() calls assumes the mapped origin
// is at (0,0), we need to translate the canvas to the mapped origin.
@@ -163,8 +165,6 @@ void NineImagePainter::Paint(Canvas* canvas,
Fill(canvas, image_reps[8], width_in_pixels - i8w, height_in_pixels - i8h,
i8w, i8h, paint);
}
-
- canvas->Restore();
}
// static
« ui/gfx/canvas.h ('K') | « ui/gfx/canvas.cc ('k') | ui/gfx/scoped_canvas.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698