Changeset 107267 in webkit
- Timestamp:
- Feb 9, 2012 11:35:18 AM (12 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r107250 r107267 1 2012-02-09 Matthew Delaney <mdelaney@apple.com> 2 3 HiDPI: WebKit2's link-dragging images are blurry 4 https://bugs.webkit.org/show_bug.cgi?id=67779 5 6 Reviewed by Beth Dakin. 7 8 Teach startDrag about the deviceScaleFactor so that it creates 9 an appropriately scaled bitmap image to ship over. 10 * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: 11 (WebKit::WebDragClient::startDrag): 12 (WebKit::convertImageToBitmap): 13 14 Have setDragImage assume that it's receiving a bitmap image scaled 15 up by the deviceScaleFactor that it sees. 16 * UIProcess/API/mac/WKView.mm: 17 (-[WKView _setDragImage:at:linkDrag:]): 18 1 19 2012-02-09 Carlos Garcia Campos <cgarcia@igalia.com> 2 20 -
trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm
r107017 r107267 2562 2562 2563 2563 _data->_dragHasStarted = YES; 2564 IntSize size([image size]); 2565 size.scale(1.0 / [self _intrinsicDeviceScaleFactor]); 2566 [image setSize:size]; 2564 2567 2565 2568 // The call to super could release this WKView. -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm
r97808 r107267 40 40 #import <WebCore/GraphicsContext.h> 41 41 #import <WebCore/LegacyWebArchive.h> 42 #import <WebCore/Page.h> 42 43 #import <WebCore/RenderImage.h> 43 44 #import <WebCore/ResourceHandle.h> … … 78 79 namespace WebKit { 79 80 80 static PassRefPtr<ShareableBitmap> convertImageToBitmap(NSImage *image )81 { 82 RefPtr<ShareableBitmap> bitmap = ShareableBitmap::createShareable( IntSize([image size]), ShareableBitmap::SupportsAlpha);81 static PassRefPtr<ShareableBitmap> convertImageToBitmap(NSImage *image, const IntSize& size) 82 { 83 RefPtr<ShareableBitmap> bitmap = ShareableBitmap::createShareable(size, ShareableBitmap::SupportsAlpha); 83 84 OwnPtr<GraphicsContext> graphicsContext = bitmap->createGraphicsContext(); 84 85 … … 95 96 void WebDragClient::startDrag(RetainPtr<NSImage> image, const IntPoint& point, const IntPoint&, Clipboard*, Frame* frame, bool linkDrag) 96 97 { 97 RefPtr<ShareableBitmap> bitmap = convertImageToBitmap(image.get()); 98 IntSize bitmapSize([image.get() size]); 99 bitmapSize.scale(frame->page()->deviceScaleFactor()); 100 RefPtr<ShareableBitmap> bitmap = convertImageToBitmap(image.get(), bitmapSize); 98 101 ShareableBitmap::Handle handle; 99 102 if (!bitmap->createHandle(handle))
Note: See TracChangeset
for help on using the changeset viewer.