Changeset 178146 in webkit


Ignore:
Timestamp:
Jan 8, 2015 4:54:39 PM (9 years ago)
Author:
ap@apple.com
Message:

[Mac WK2] Test snapshots are 1600x1200 on Retina devices
https://bugs.webkit.org/show_bug.cgi?id=139884

Reviewed by Tim Horton.

  • WebKitTestRunner/mac/PlatformWebViewMac.mm: (WTR::PlatformWebView::windowSnapshotImage):

Tell CGWindowListCreateImage to use the correct resolution. I don't really understand
what the "nominal resolution" is, but this appears to work in practice.

Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r178139 r178146  
     12015-01-08  Alexey Proskuryakov  <ap@apple.com>
     2
     3        [Mac WK2] Test snapshots are 1600x1200 on Retina devices
     4        https://bugs.webkit.org/show_bug.cgi?id=139884
     5
     6        Reviewed by Tim Horton.
     7
     8        * WebKitTestRunner/mac/PlatformWebViewMac.mm: (WTR::PlatformWebView::windowSnapshotImage):
     9        Tell CGWindowListCreateImage to use the correct resolution. I don't really understand
     10        what the "nominal resolution" is, but this appears to work in practice.
     11
    1122015-01-08  Brent Fulgham  <bfulgham@apple.com>
    213
  • trunk/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm

    r169505 r178146  
    231231{
    232232    [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));
    234241
    235242    // windowSnapshotImage will be in GenericRGB, as we've set the main display's color space to GenericRGB.
Note: See TracChangeset for help on using the changeset viewer.