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

Unified Diff: third_party/WebKit/Source/core/page/DragController.cpp

Issue 1978763004: Drag image should always use the real device scale factor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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: third_party/WebKit/Source/core/page/DragController.cpp
diff --git a/third_party/WebKit/Source/core/page/DragController.cpp b/third_party/WebKit/Source/core/page/DragController.cpp
index 756212816c5b57f89b06d0f720193857c271ec90..f7a574398bea7b5524400582f66fde49cbc10fea 100644
--- a/third_party/WebKit/Source/core/page/DragController.cpp
+++ b/third_party/WebKit/Source/core/page/DragController.cpp
@@ -901,7 +901,8 @@ bool DragController::startDrag(LocalFrame* src, const DragState& state, const Pl
// once all platforms are migrated to use zoom for dsf.
imageSizeInPixels.scale(src->host()->deviceScaleFactor());
- float screenDeviceScaleFactor = src->page()->chromeClient().screenInfo().deviceScaleFactor;
+ float screenDeviceScaleFactor = src->page()->chromeClient().nonEmulatedDeviceScaleFactor();
+
// Pass the selected image size in DIP becasue dragImageForImage clips the image in DIP.
// The coordinates of the locations are in Viewport coordinates, and they're converted in the Blink client.
// TODO(oshima): Currently, the dragged image on high DPI is scaled and can be blurry because of this.
@@ -922,7 +923,8 @@ bool DragController::startDrag(LocalFrame* src, const DragState& state, const Pl
if (!dragImage) {
ASSERT(src->page());
- float screenDeviceScaleFactor = src->page()->chromeClient().screenInfo().deviceScaleFactor;
+ float screenDeviceScaleFactor = src->page()->chromeClient().nonEmulatedDeviceScaleFactor();
+
dragImage = dragImageForLink(linkURL, hitTestResult.textContent(), screenDeviceScaleFactor, mouseDraggedPoint, dragLocation);
}
doSystemDrag(dragImage.get(), dragLocation, mouseDraggedPoint, dataTransfer, src, true);
@@ -957,7 +959,7 @@ void DragController::doSystemDrag(DragImage* image, const IntPoint& dragLocation
if (image) {
float resolutionScale = image->resolutionScale();
- float deviceScaleFactor = m_page->chromeClient().screenInfo().deviceScaleFactor;
+ float deviceScaleFactor = m_page->chromeClient().nonEmulatedDeviceScaleFactor();
if (deviceScaleFactor != resolutionScale) {
DCHECK_GT(resolutionScale, 0);
float scale = deviceScaleFactor / resolutionScale;
« no previous file with comments | « third_party/WebKit/Source/core/page/ChromeClient.h ('k') | third_party/WebKit/Source/web/ChromeClientImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698