|
Lines 230-236
void PlatformWebView::makeWebViewFirstRe
Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm_sec1
|
| 230 |
WKRetainPtr<WKImageRef> PlatformWebView::windowSnapshotImage() |
230 |
WKRetainPtr<WKImageRef> PlatformWebView::windowSnapshotImage() |
| 231 |
{ |
231 |
{ |
| 232 |
[m_view display]; |
232 |
[m_view display]; |
| 233 |
RetainPtr<CGImageRef> windowSnapshotImage = adoptCF(CGWindowListCreateImage(CGRectNull, kCGWindowListOptionIncludingWindow, [m_window windowNumber], kCGWindowImageBoundsIgnoreFraming | kCGWindowImageShouldBeOpaque)); |
233 |
CGWindowImageOption options = kCGWindowImageBoundsIgnoreFraming | kCGWindowImageShouldBeOpaque; |
|
|
234 |
|
| 235 |
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000 |
| 236 |
if ([m_window backingScaleFactor] == 1) |
| 237 |
options |= kCGWindowImageNominalResolution; |
| 238 |
#endif |
| 239 |
|
| 240 |
RetainPtr<CGImageRef> windowSnapshotImage = adoptCF(CGWindowListCreateImage(CGRectNull, kCGWindowListOptionIncludingWindow, [m_window windowNumber], options)); |
| 234 |
|
241 |
|
| 235 |
// windowSnapshotImage will be in GenericRGB, as we've set the main display's color space to GenericRGB. |
242 |
// windowSnapshotImage will be in GenericRGB, as we've set the main display's color space to GenericRGB. |
| 236 |
return adoptWK(WKImageCreateFromCGImage(windowSnapshotImage.get(), 0)); |
243 |
return adoptWK(WKImageCreateFromCGImage(windowSnapshotImage.get(), 0)); |