Title: [162936] trunk/Source/WebKit2
- Revision
- 162936
- Author
- timothy_hor...@apple.com
- Date
- 2014-01-28 09:19:05 -0800 (Tue, 28 Jan 2014)
Log Message
WebKit2 View Gestures (Swipe): Use CGSCaptureWindowsContentsToRect for now
https://bugs.webkit.org/show_bug.cgi?id=127768
<rdar://problem/15923662>
Reviewed by Simon Fraser.
* UIProcess/API/mac/WKView.mm:
(-[WKView _takeViewSnapshot]):
Until <rdar://problem/15709646> is resolved, we'll use
CGSCaptureWindowsContentsToRect instead of CGWindowListCreateImage.
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (162935 => 162936)
--- trunk/Source/WebKit2/ChangeLog 2014-01-28 17:13:41 UTC (rev 162935)
+++ trunk/Source/WebKit2/ChangeLog 2014-01-28 17:19:05 UTC (rev 162936)
@@ -1,3 +1,16 @@
+2014-01-28 Tim Horton <timothy_hor...@apple.com>
+
+ WebKit2 View Gestures (Swipe): Use CGSCaptureWindowsContentsToRect for now
+ https://bugs.webkit.org/show_bug.cgi?id=127768
+ <rdar://problem/15923662>
+
+ Reviewed by Simon Fraser.
+
+ * UIProcess/API/mac/WKView.mm:
+ (-[WKView _takeViewSnapshot]):
+ Until <rdar://problem/15709646> is resolved, we'll use
+ CGSCaptureWindowsContentsToRect instead of CGWindowListCreateImage.
+
2014-01-28 Mark Rowe <mr...@apple.com>
<https://webkit.org/b/127767> Disable some deprecation warnings to fix the build.
Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm (162935 => 162936)
--- trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm 2014-01-28 17:13:41 UTC (rev 162935)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm 2014-01-28 17:19:05 UTC (rev 162936)
@@ -117,6 +117,7 @@
#if defined(__has_include) && __has_include(<CoreGraphics/CoreGraphicsPrivate.h>)
#import <CoreGraphics/CoreGraphicsPrivate.h>
+#import <CoreGraphics/CGSCapture.h>
#endif
extern "C" {
@@ -124,6 +125,7 @@
typedef uint32_t CGSWindowID;
CGSConnectionID CGSMainConnectionID(void);
CGError CGSGetScreenRectForWindow(CGSConnectionID cid, CGSWindowID wid, CGRect *rect);
+CGError CGSCaptureWindowsContentsToRect(CGSConnectionID cid, const CGSWindowID windows[], uint32_t windowCount, CGRect rect, CGImageRef *outImage);
};
using namespace WebKit;
@@ -2545,7 +2547,11 @@
if (![window windowNumber])
return nullptr;
- RetainPtr<CGImageRef> windowSnapshotImage = adoptCF(CGWindowListCreateImage(CGRectNull, kCGWindowListOptionIncludingWindow, [window windowNumber], kCGWindowImageBoundsIgnoreFraming | kCGWindowImageShouldBeOpaque));
+ // FIXME: This should use CGWindowListCreateImage once <rdar://problem/15709646> is resolved.
+ CGSWindowID windowID = [window windowNumber];
+ CGImageRef cgWindowImage = nullptr;
+ CGSCaptureWindowsContentsToRect(CGSMainConnectionID(), &windowID, 1, CGRectNull, &cgWindowImage);
+ RetainPtr<CGImageRef> windowSnapshotImage = adoptCF(cgWindowImage);
NSRect windowCaptureRect = [self convertRect:self.bounds toView:nil];
NSRect windowCaptureScreenRect = [window convertRectToScreen:windowCaptureRect];
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes