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

Unified Diff: chrome/browser/ui/views/bookmarks/bookmark_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 | « ash/frame/default_header_painter.cc ('k') | chrome/browser/ui/views/frame/browser_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
index 4cc26fc1ae395aa8048be8027f57425df37f8304..d700b3e7aac878061d75ebc9151d18371624f991 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
@@ -83,6 +83,7 @@
#include "ui/gfx/canvas.h"
#include "ui/gfx/favicon_size.h"
#include "ui/gfx/paint_vector_icon.h"
+#include "ui/gfx/scoped_canvas.h"
#include "ui/gfx/text_constants.h"
#include "ui/gfx/text_elider.h"
#include "ui/gfx/vector_icons_public.h"
@@ -477,10 +478,11 @@ class BookmarkBarView::ButtonSeparatorView : public views::View {
void OnPaint(gfx::Canvas* canvas) override {
if (ui::MaterialDesignController::IsModeMaterial()) {
+ gfx::ScopedCanvas scoped_canvas(canvas);
// 1px wide at all scale factors. If there is an uneven amount of padding
// left over, place the extra pixel on the outside, i.e. away from the
// "Other bookmarks" folder.
- const float scale = canvas->SaveAndUnscale();
+ const float scale = canvas->UndoDeviceScaleFactor();
const gfx::RectF scaled_bounds =
gfx::ScaleRect(gfx::RectF(bounds()), scale);
@@ -496,7 +498,6 @@ class BookmarkBarView::ButtonSeparatorView : public views::View {
SkColorSetA(GetThemeProvider()->GetColor(
ThemeProperties::COLOR_TOOLBAR_BUTTON_ICON),
0x4D));
- canvas->Restore();
} else {
PaintVerticalDivider(
canvas, kSeparatorStartX, height(), 1, kEdgeDividerColor,
« no previous file with comments | « ash/frame/default_header_painter.cc ('k') | chrome/browser/ui/views/frame/browser_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698