Commit 33826473 authored by enrica@apple.com's avatar enrica@apple.com

Stop using deprecated API to flip the dragImage.

<rdar://problem/8930897>
https://bugs.webkit.org/show_bug.cgi?id=54477
        
Reviewed by Darin Adler.

NSImage setFlipped is a deprecated API. We replace it with
drawInRect:fromRect:operation:fraction:respectFlipped:hints.
        
* UIProcess/API/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::setDragImage): Removed call to setFlipped.
* WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
(WebKit::WebDragClient::startDrag): The image is now drawn with
drawInRect:fromRect:operation:fraction:respectFlipped:hints.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@78589 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 9aa45d9e
2011-02-15 Enrica Casucci <enrica@apple.com>
Reviewed by Darin Adler.
Stop using deprecated API to flip the dragImage.
<rdar://problem/8930897>
https://bugs.webkit.org/show_bug.cgi?id=54477
NSImage setFlipped is a deprecated API. We replace it with
drawInRect:fromRect:operation:fraction:respectFlipped:hints.
* UIProcess/API/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::setDragImage): Removed call to setFlipped.
* WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
(WebKit::WebDragClient::startDrag): The image is now drawn with
drawInRect:fromRect:operation:fraction:respectFlipped:hints.
2011-02-15 Brady Eidson <beidson@apple.com>
Reviewed by Darin Adler.
......@@ -295,7 +295,6 @@ void PageClientImpl::setDragImage(const IntPoint& clientPosition, const IntSize&
{
OwnPtr<GraphicsContext> graphicsContext = dragImage->createGraphicsContext();
RetainPtr<NSImage> dragNSImage(AdoptNS, [[NSImage alloc] initWithCGImage:CGBitmapContextCreateImage(graphicsContext->platformContext()) size:imageSize]);
[dragNSImage.get() setFlipped:YES];
[m_wkView _setDragImage:dragNSImage.get() at:clientPosition linkDrag:isLinkDrag];
}
......
......@@ -63,7 +63,7 @@ void WebDragClient::startDrag(DragImageRef dragImage, const IntPoint& at, const
NSGraphicsContext* bitmapContext = [NSGraphicsContext graphicsContextWithGraphicsPort:graphicsContext->platformContext() flipped:YES];
[NSGraphicsContext setCurrentContext: bitmapContext];
[dragNSImage drawInRect:NSMakeRect(0, 0, [dragNSImage size].width , [dragNSImage size].height) fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1];
[dragNSImage drawInRect:NSMakeRect(0, 0, [dragNSImage size].width , [dragNSImage size].height) fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1 respectFlipped:YES hints:nil];
[NSGraphicsContext restoreGraphicsState];
SharedMemory::Handle handle;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment