REGRESSION (r160152): Selection drag snapshot doesn't appear or has the wrong content...
authorbburg@apple.com <bburg@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 Jan 2014 21:21:53 +0000 (21:21 +0000)
committerbburg@apple.com <bburg@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 Jan 2014 21:21:53 +0000 (21:21 +0000)
commit97b6eee0963d0c70a10dffbe822e8ecb13871c81
tree09013e220a029e8246266694109d4228bf1c75b3
parentdfb90cae827c8691baa3c1f5abef594b5bcefd2e
REGRESSION (r160152): Selection drag snapshot doesn't appear or has the wrong content on Retina
https://bugs.webkit.org/show_bug.cgi?id=125375

Reviewed by Darin Adler.

Source/WebCore:

Move scaling of drag images by the device scale factor out of DragClient
and into WebCore. This removes several redundant copies and scaling operations.

Fix scaling bugs that were cancelled out by over-allocating the backing store.

* page/DragController.cpp:
(WebCore::DragController::startDrag): Scale the drag image for a link
according to the device scale factor before giving it to the OS.

(WebCore::DragController::doImageDrag): Scale the drag image for an image
according to the device scale factor before giving it to the OS.

* page/FrameSnapshotting.cpp:
(WebCore::snapshotFrameRect): Don't pre-scale or clip the snapshot. The
ImageBuffer does this already.

* platform/DragImage.cpp:
(WebCore::createDragImageFromSnapshot): Don't scale the backing store
when copying an ImageBuffer into an Image.

* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::ImageBuffer::copyImage): Draw the image in user-space coordinates,
not in backing-store coordinates. Remove unnecessary assertions. Crop the
buffer before drawing the image into it.

Source/WebKit2:

Remove scaling from WebDragClient because it is now selectively
performed by WebCore according to the drag image source.

* WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
(WebKit::WebDragClient::startDrag): Don't scale the provided drag image.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@161577 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/page/DragController.cpp
Source/WebCore/page/FrameSnapshotting.cpp
Source/WebCore/platform/DragImage.cpp
Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm