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

Unified Diff: ui/native_theme/native_theme_base.cc

Issue 24175004: Remove dependency on ui::ScaleFactor from ui/gfx (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix new usage of scale in FastShowPickler 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
« no previous file with comments | « ui/message_center/views/notification_view.cc ('k') | ui/views/controls/button/image_button.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/native_theme/native_theme_base.cc
diff --git a/ui/native_theme/native_theme_base.cc b/ui/native_theme/native_theme_base.cc
index 2f94f54cd7e4a729b48a864f0502d31602a08234..43bc22208c777d876e5ca3b9c740ced6105d775d 100644
--- a/ui/native_theme/native_theme_base.cc
+++ b/ui/native_theme/native_theme_base.cc
@@ -1004,10 +1004,9 @@ void NativeThemeBase::DrawImageInt(
// TODO(pkotwicz): Do something better and don't infer device
// scale factor from canvas scale.
SkMatrix m = sk_canvas->getTotalMatrix();
- ui::ScaleFactor device_scale_factor = ui::GetScaleFactorFromScale(
- SkScalarAbs(m.getScaleX()));
+ float device_scale = static_cast<float>(SkScalarAbs(m.getScaleX()));
scoped_ptr<gfx::Canvas> canvas(gfx::Canvas::CreateCanvasWithoutScaling(
- sk_canvas, device_scale_factor));
+ sk_canvas, device_scale));
canvas->DrawImageInt(image, src_x, src_y, src_w, src_h,
dest_x, dest_y, dest_w, dest_h, true);
}
@@ -1019,10 +1018,9 @@ void NativeThemeBase::DrawTiledImage(SkCanvas* sk_canvas,
// TODO(pkotwicz): Do something better and don't infer device
// scale factor from canvas scale.
SkMatrix m = sk_canvas->getTotalMatrix();
- ui::ScaleFactor device_scale_factor = ui::GetScaleFactorFromScale(
- SkScalarAbs(m.getScaleX()));
+ float device_scale = static_cast<float>(SkScalarAbs(m.getScaleX()));
scoped_ptr<gfx::Canvas> canvas(gfx::Canvas::CreateCanvasWithoutScaling(
- sk_canvas, device_scale_factor));
+ sk_canvas, device_scale));
canvas->TileImageInt(image, src_x, src_y, tile_scale_x,
tile_scale_y, dest_x, dest_y, w, h);
}
« no previous file with comments | « ui/message_center/views/notification_view.cc ('k') | ui/views/controls/button/image_button.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698