Title: [107267] trunk/Source/WebKit2
- Revision
- 107267
- Author
- [email protected]
- Date
- 2012-02-09 11:35:18 -0800 (Thu, 09 Feb 2012)
Log Message
HiDPI: WebKit2's link-dragging images are blurry
https://bugs.webkit.org/show_bug.cgi?id=67779
Reviewed by Beth Dakin.
Teach startDrag about the deviceScaleFactor so that it creates
an appropriately scaled bitmap image to ship over.
* WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
(WebKit::WebDragClient::startDrag):
(WebKit::convertImageToBitmap):
Have setDragImage assume that it's receiving a bitmap image scaled
up by the deviceScaleFactor that it sees.
* UIProcess/API/mac/WKView.mm:
(-[WKView _setDragImage:at:linkDrag:]):
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (107266 => 107267)
--- trunk/Source/WebKit2/ChangeLog 2012-02-09 19:16:03 UTC (rev 107266)
+++ trunk/Source/WebKit2/ChangeLog 2012-02-09 19:35:18 UTC (rev 107267)
@@ -1,3 +1,21 @@
+2012-02-09 Matthew Delaney <[email protected]>
+
+ HiDPI: WebKit2's link-dragging images are blurry
+ https://bugs.webkit.org/show_bug.cgi?id=67779
+
+ Reviewed by Beth Dakin.
+
+ Teach startDrag about the deviceScaleFactor so that it creates
+ an appropriately scaled bitmap image to ship over.
+ * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
+ (WebKit::WebDragClient::startDrag):
+ (WebKit::convertImageToBitmap):
+
+ Have setDragImage assume that it's receiving a bitmap image scaled
+ up by the deviceScaleFactor that it sees.
+ * UIProcess/API/mac/WKView.mm:
+ (-[WKView _setDragImage:at:linkDrag:]):
+
2012-02-09 Carlos Garcia Campos <[email protected]>
[GTK] Add WebKitWebView::mouse-target-changed signal to WebKit2 GTK+ API
Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm (107266 => 107267)
--- trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm 2012-02-09 19:16:03 UTC (rev 107266)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm 2012-02-09 19:35:18 UTC (rev 107267)
@@ -2561,6 +2561,9 @@
return;
_data->_dragHasStarted = YES;
+ IntSize size([image size]);
+ size.scale(1.0 / [self _intrinsicDeviceScaleFactor]);
+ [image setSize:size];
// The call to super could release this WKView.
RetainPtr<WKView> protector(self);
Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm (107266 => 107267)
--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm 2012-02-09 19:16:03 UTC (rev 107266)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm 2012-02-09 19:35:18 UTC (rev 107267)
@@ -39,6 +39,7 @@
#import <WebCore/FrameView.h>
#import <WebCore/GraphicsContext.h>
#import <WebCore/LegacyWebArchive.h>
+#import <WebCore/Page.h>
#import <WebCore/RenderImage.h>
#import <WebCore/ResourceHandle.h>
#import <WebCore/StringTruncator.h>
@@ -77,9 +78,9 @@
namespace WebKit {
-static PassRefPtr<ShareableBitmap> convertImageToBitmap(NSImage *image)
+static PassRefPtr<ShareableBitmap> convertImageToBitmap(NSImage *image, const IntSize& size)
{
- RefPtr<ShareableBitmap> bitmap = ShareableBitmap::createShareable(IntSize([image size]), ShareableBitmap::SupportsAlpha);
+ RefPtr<ShareableBitmap> bitmap = ShareableBitmap::createShareable(size, ShareableBitmap::SupportsAlpha);
OwnPtr<GraphicsContext> graphicsContext = bitmap->createGraphicsContext();
RetainPtr<NSGraphicsContext> savedContext = [NSGraphicsContext currentContext];
@@ -94,7 +95,9 @@
void WebDragClient::startDrag(RetainPtr<NSImage> image, const IntPoint& point, const IntPoint&, Clipboard*, Frame* frame, bool linkDrag)
{
- RefPtr<ShareableBitmap> bitmap = convertImageToBitmap(image.get());
+ IntSize bitmapSize([image.get() size]);
+ bitmapSize.scale(frame->page()->deviceScaleFactor());
+ RefPtr<ShareableBitmap> bitmap = convertImageToBitmap(image.get(), bitmapSize);
ShareableBitmap::Handle handle;
if (!bitmap->createHandle(handle))
return;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes