Title: [110756] branches/safari-534.55-branch/Source/WebKit2
Diff
Modified: branches/safari-534.55-branch/Source/WebKit2/ChangeLog (110755 => 110756)
--- branches/safari-534.55-branch/Source/WebKit2/ChangeLog 2012-03-14 21:35:10 UTC (rev 110755)
+++ branches/safari-534.55-branch/Source/WebKit2/ChangeLog 2012-03-14 21:40:47 UTC (rev 110756)
@@ -1,3 +1,25 @@
+2012-03-14 Lucas Forschler <[email protected]>
+
+ Merge 107267
+
+ 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-15 Anders Carlsson <[email protected]>
<rdar://problem/10574154> Mouse input events in plug-ins have a vertical offset when the page is zoomed
Modified: branches/safari-534.55-branch/Source/WebKit2/UIProcess/API/mac/WKView.mm (110755 => 110756)
--- branches/safari-534.55-branch/Source/WebKit2/UIProcess/API/mac/WKView.mm 2012-03-14 21:35:10 UTC (rev 110755)
+++ branches/safari-534.55-branch/Source/WebKit2/UIProcess/API/mac/WKView.mm 2012-03-14 21:40:47 UTC (rev 110756)
@@ -2401,6 +2401,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: branches/safari-534.55-branch/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm (110755 => 110756)
--- branches/safari-534.55-branch/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm 2012-03-14 21:35:10 UTC (rev 110755)
+++ branches/safari-534.55-branch/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm 2012-03-14 21:40:47 UTC (rev 110756)
@@ -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