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

Unified Diff: trunk/src/ash/drag_drop/drag_image_view.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/ash/drag_drop/drag_image_view.cc
===================================================================
--- trunk/src/ash/drag_drop/drag_image_view.cc (revision 224497)
+++ trunk/src/ash/drag_drop/drag_image_view.cc (working copy)
@@ -90,17 +90,21 @@
device_scale = ui::GetDeviceScaleFactor(
widget_->GetNativeView()->layer());
}
+ ui::ScaleFactor device_scale_factor =
+ ui::GetScaleFactorFromScale(device_scale);
+
// The drag image already has device scale factor applied. But
// |widget_size_| is in DIP units.
gfx::Size scaled_widget_size = gfx::ToRoundedSize(
gfx::ScaleSize(widget_size_, device_scale));
- gfx::ImageSkiaRep image_rep = GetImage().GetRepresentation(device_scale);
+ gfx::ImageSkiaRep image_rep = GetImage().GetRepresentation(
+ device_scale_factor);
if (image_rep.is_null())
return;
SkBitmap scaled = skia::ImageOperations::Resize(
image_rep.sk_bitmap(), skia::ImageOperations::RESIZE_LANCZOS3,
scaled_widget_size.width(), scaled_widget_size.height());
- gfx::ImageSkia image_skia(gfx::ImageSkiaRep(scaled, device_scale));
+ gfx::ImageSkia image_skia(gfx::ImageSkiaRep(scaled, device_scale_factor));
canvas->DrawImageInt(image_skia, 0, 0);
}
}
« no previous file with comments | « trunk/src/ash/drag_drop/drag_drop_controller_unittest.cc ('k') | trunk/src/ash/launcher/launcher_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698