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

Unified Diff: ash/drag_drop/drag_image_view.cc

Issue 24175004: Remove dependency on ui::ScaleFactor from ui/gfx (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
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: ash/drag_drop/drag_image_view.cc
diff --git a/ash/drag_drop/drag_image_view.cc b/ash/drag_drop/drag_image_view.cc
index 5d0f2be5e612439d8fc1937319af4ff225c071f0..22d112c1705c76abb5884aee0aca579ff69df2c1 100644
--- a/ash/drag_drop/drag_image_view.cc
+++ b/ash/drag_drop/drag_image_view.cc
@@ -6,6 +6,7 @@
#include "skia/ext/image_operations.h"
#include "ui/aura/window.h"
+#include "ui/base/layout.h"
#include "ui/compositor/dip_util.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/size_conversions.h"
@@ -90,21 +91,17 @@ void DragImageView::OnPaint(gfx::Canvas* canvas) {
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_factor);
+ gfx::ImageSkiaRep image_rep = GetImage().GetRepresentation(device_scale);
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_factor));
+ gfx::ImageSkia image_skia(gfx::ImageSkiaRep(scaled, device_scale));
canvas->DrawImageInt(image_skia, 0, 0);
}
}

Powered by Google App Engine
This is Rietveld 408576698