Changeset 179639 in webkit


Ignore:
Timestamp:
Feb 4, 2015 2:53:13 PM (9 years ago)
Author:
Simon Fraser
Message:

WKTR should not use -mainScreen to pick a color profile
https://bugs.webkit.org/show_bug.cgi?id=141265

Reviewed by Tim Horton.

-[NSScreen mainScreen] depends on the active window, so use the first screen
(which is the one we put the window on anyway).

Do some cleanup in DRT that makes the code look similar.

  • DumpRenderTree/mac/DumpRenderTree.mm:

(createWebViewAndOffscreenWindow):

  • WebKitTestRunner/mac/PlatformWebViewMac.mm:

(WTR::PlatformWebView::PlatformWebView):

Location:
trunk/Tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r179637 r179639  
     12015-02-04  Simon Fraser  <simon.fraser@apple.com>
     2
     3        WKTR should not use -mainScreen to pick a color profile
     4        https://bugs.webkit.org/show_bug.cgi?id=141265
     5
     6        Reviewed by Tim Horton.
     7       
     8        -[NSScreen mainScreen] depends on the active window, so use the first screen
     9        (which is the one we put the window on anyway).
     10       
     11        Do some cleanup in DRT that makes the code look similar.
     12
     13        * DumpRenderTree/mac/DumpRenderTree.mm:
     14        (createWebViewAndOffscreenWindow):
     15        * WebKitTestRunner/mac/PlatformWebViewMac.mm:
     16        (WTR::PlatformWebView::PlatformWebView):
     17
    1182015-02-04  Simon Fraser  <simon.fraser@apple.com>
    219
  • trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm

    r179450 r179639  
    705705    // To make things like certain NSViews, dragging, and plug-ins work, put the WebView a window, but put it off-screen so you don't see it.
    706706    // Put it at -10000, -10000 in "flipped coordinates", since WebCore and the DOM use flipped coordinates.
    707     NSRect windowRect = NSOffsetRect(rect, -10000, [(NSScreen *)[[NSScreen screens] objectAtIndex:0] frame].size.height - rect.size.height + 10000);
     707    NSScreen *firstScreen = [[NSScreen screens] firstObject];
     708    NSRect windowRect = NSOffsetRect(rect, -10000, [firstScreen frame].size.height - rect.size.height + 10000);
    708709    DumpRenderTreeWindow *window = [[DumpRenderTreeWindow alloc] initWithContentRect:windowRect styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES];
    709710
    710     [window setColorSpace:[[[NSScreen screens] objectAtIndex:0] colorSpace]];
     711    [window setColorSpace:[firstScreen colorSpace]];
    711712    [window setCollectionBehavior:NSWindowCollectionBehaviorStationary];
    712713    [[window contentView] addSubview:webView];
  • trunk/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm

    r178146 r179639  
    142142    [m_view setWindowOcclusionDetectionEnabled:NO];
    143143
    144     NSRect windowRect = NSOffsetRect(rect, -10000, [(NSScreen *)[[NSScreen screens] objectAtIndex:0] frame].size.height - rect.size.height + 10000);
     144    NSScreen *firstScreen = [[NSScreen screens] objectAtIndex:0];
     145    NSRect windowRect = NSOffsetRect(rect, -10000, [firstScreen frame].size.height - rect.size.height + 10000);
    145146    m_window = [[WebKitTestRunnerWindow alloc] initWithContentRect:windowRect styleMask:NSBorderlessWindowMask backing:(NSBackingStoreType)_NSBackingStoreUnbuffered defer:YES];
    146147    m_window.platformWebView = this;
    147     [m_window setColorSpace:[[NSScreen mainScreen] colorSpace]];
     148    [m_window setColorSpace:[firstScreen colorSpace]];
    148149    [m_window setCollectionBehavior:NSWindowCollectionBehaviorStationary];
    149150    [[m_window contentView] addSubview:m_view];
Note: See TracChangeset for help on using the changeset viewer.