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

Unified Diff: ash/frame/default_header_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
« no previous file with comments | « no previous file | chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/frame/default_header_painter.cc
diff --git a/ash/frame/default_header_painter.cc b/ash/frame/default_header_painter.cc
index ab9dd1806f17940a428f9d920d350e5048d10085..62a8465748b729fdcc2a512936fdaf31200aa6c4 100644
--- a/ash/frame/default_header_painter.cc
+++ b/ash/frame/default_header_painter.cc
@@ -18,6 +18,7 @@
#include "ui/gfx/font_list.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/image/image.h"
+#include "ui/gfx/scoped_canvas.h"
#include "ui/gfx/skia_util.h"
#include "ui/views/view.h"
#include "ui/views/widget/native_widget_aura.h"
@@ -262,13 +263,13 @@ void DefaultHeaderPainter::PaintTitleBar(gfx::Canvas* canvas) {
}
void DefaultHeaderPainter::PaintHeaderContentSeparator(gfx::Canvas* canvas) {
- const float scale = canvas->SaveAndUnscale();
+ gfx::ScopedCanvas scoped_canvas(canvas);
+ const float scale = canvas->UndoDeviceScaleFactor();
gfx::RectF rect(0, painted_height_ * scale - 1, view_->width() * scale, 1);
SkPaint paint;
paint.setColor((mode_ == MODE_ACTIVE) ?
kHeaderContentSeparatorColor : kHeaderContentSeparatorInactiveColor);
canvas->sk_canvas()->drawRect(gfx::RectFToSkRect(rect), paint);
- canvas->Restore();
}
void DefaultHeaderPainter::LayoutLeftHeaderView() {
« no previous file with comments | « no previous file | chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698