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

Unified Diff: trunk/src/ui/native_theme/native_theme_base.cc

Issue 24262008: Revert 224473 "Remove dependency on ui::ScaleFactor from ui/gfx" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 3 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: trunk/src/ui/native_theme/native_theme_base.cc
===================================================================
--- trunk/src/ui/native_theme/native_theme_base.cc (revision 224498)
+++ trunk/src/ui/native_theme/native_theme_base.cc (working copy)
@@ -1004,9 +1004,10 @@
// TODO(pkotwicz): Do something better and don't infer device
// scale factor from canvas scale.
SkMatrix m = sk_canvas->getTotalMatrix();
- float device_scale = static_cast<float>(SkScalarAbs(m.getScaleX()));
+ ui::ScaleFactor device_scale_factor = ui::GetScaleFactorFromScale(
+ SkScalarAbs(m.getScaleX()));
scoped_ptr<gfx::Canvas> canvas(gfx::Canvas::CreateCanvasWithoutScaling(
- sk_canvas, device_scale));
+ sk_canvas, device_scale_factor));
canvas->DrawImageInt(image, src_x, src_y, src_w, src_h,
dest_x, dest_y, dest_w, dest_h, true);
}
@@ -1018,9 +1019,10 @@
// TODO(pkotwicz): Do something better and don't infer device
// scale factor from canvas scale.
SkMatrix m = sk_canvas->getTotalMatrix();
- float device_scale = static_cast<float>(SkScalarAbs(m.getScaleX()));
+ ui::ScaleFactor device_scale_factor = ui::GetScaleFactorFromScale(
+ SkScalarAbs(m.getScaleX()));
scoped_ptr<gfx::Canvas> canvas(gfx::Canvas::CreateCanvasWithoutScaling(
- sk_canvas, device_scale));
+ sk_canvas, device_scale_factor));
canvas->TileImageInt(image, src_x, src_y, tile_scale_x,
tile_scale_y, dest_x, dest_y, w, h);
}
« no previous file with comments | « trunk/src/ui/message_center/views/notification_view.cc ('k') | trunk/src/ui/views/controls/button/image_button.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698