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

Unified Diff: chrome/browser/ui/views/frame/browser_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
Index: chrome/browser/ui/views/frame/browser_view.cc
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc
index f673d12e1ff81dcd84f21764c1bc3485302abd28..a6922dfec81d0b988229fcafe368353ace6a3afd 100644
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -133,6 +133,7 @@
#include "ui/gfx/canvas.h"
#include "ui/gfx/color_utils.h"
#include "ui/gfx/geometry/rect_conversions.h"
+#include "ui/gfx/scoped_canvas.h"
#include "ui/gfx/screen.h"
#include "ui/strings/grit/ui_strings.h"
#include "ui/views/controls/button/menu_button.h"
@@ -550,13 +551,13 @@ BrowserView* BrowserView::GetBrowserViewForBrowser(const Browser* browser) {
void BrowserView::Paint1pxHorizontalLine(gfx::Canvas* canvas,
SkColor color,
const gfx::Rect& bounds) {
- const float scale = canvas->SaveAndUnscale();
+ gfx::ScopedCanvas scoped_canvas(canvas);
+ const float scale = canvas->UndoDeviceScaleFactor();
gfx::RectF rect(gfx::ScaleRect(gfx::RectF(bounds), scale));
rect.Inset(0, rect.height() - 1, 0, 0);
SkPaint paint;
paint.setColor(color);
canvas->sk_canvas()->drawRect(gfx::RectFToSkRect(rect), paint);
- canvas->Restore();
}
void BrowserView::InitStatusBubble() {
« no previous file with comments | « chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc ('k') | chrome/browser/ui/views/location_bar/location_bar_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698