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

Unified Diff: chrome/browser/ui/views/location_bar/location_bar_view.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
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view.cc ('k') | ui/gfx/canvas.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/location_bar/location_bar_view.cc
diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.cc b/chrome/browser/ui/views/location_bar/location_bar_view.cc
index f177fed7c86a912ebb1687e77af1460469ea1dd9..2167e217edffe8e0bd374c635bd74ae968b58935 100644
--- a/chrome/browser/ui/views/location_bar/location_bar_view.cc
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc
@@ -1289,7 +1289,8 @@ void LocationBarView::PaintChildren(const ui::PaintContext& context) {
if (ui::MaterialDesignController::IsModeMaterial()) {
gfx::Canvas* canvas = recorder.canvas();
- const float scale = canvas->SaveAndUnscale();
+ gfx::ScopedCanvas scoped_canvas(canvas);
+ const float scale = canvas->UndoDeviceScaleFactor();
SkPaint paint;
paint.setStyle(SkPaint::Style::kStroke_Style);
@@ -1306,7 +1307,6 @@ void LocationBarView::PaintChildren(const ui::PaintContext& context) {
const SkScalar kCornerRadius = SkDoubleToScalar(2.5f * scale);
canvas->sk_canvas()->drawRoundRect(gfx::RectFToSkRect(border_rect_f),
kCornerRadius, kCornerRadius, paint);
- recorder.canvas()->Restore();
} else {
views::Painter::PaintPainterAt(recorder.canvas(), border_painter_.get(),
border_rect);
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view.cc ('k') | ui/gfx/canvas.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698