Title: [167691] trunk/Tools
Revision
167691
Author
timothy_hor...@apple.com
Date
2014-04-22 16:54:49 -0700 (Tue, 22 Apr 2014)

Log Message

DumpRenderTree generates black snapshots on some platforms
https://bugs.webkit.org/show_bug.cgi?id=132029
<rdar://problem/16679363>

Reviewed by Simon Fraser.

* DumpRenderTree/mac/PixelDumpSupportMac.mm:
(createBitmapContextFromWebView):
DRT checks with the WebView to determine whether it can use the window's
backing store directly or (because of compositing) needs to take a WindowServer
snapshot. However, on some platforms and in some situations, the window can
be layer backed without the WebView necessarily currently being composited.
We should check with the window in addition to the WebView before going
ahead and using its backing store.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (167690 => 167691)


--- trunk/Tools/ChangeLog	2014-04-22 23:51:51 UTC (rev 167690)
+++ trunk/Tools/ChangeLog	2014-04-22 23:54:49 UTC (rev 167691)
@@ -1,5 +1,22 @@
 2014-04-22  Tim Horton  <timothy_hor...@apple.com>
 
+        DumpRenderTree generates black snapshots on some platforms
+        https://bugs.webkit.org/show_bug.cgi?id=132029
+        <rdar://problem/16679363>
+
+        Reviewed by Simon Fraser.
+
+        * DumpRenderTree/mac/PixelDumpSupportMac.mm:
+        (createBitmapContextFromWebView):
+        DRT checks with the WebView to determine whether it can use the window's
+        backing store directly or (because of compositing) needs to take a WindowServer
+        snapshot. However, on some platforms and in some situations, the window can
+        be layer backed without the WebView necessarily currently being composited.
+        We should check with the window in addition to the WebView before going
+        ahead and using its backing store.
+
+2014-04-22  Tim Horton  <timothy_hor...@apple.com>
+
         DumpRenderTree generates white snapshots on some platforms
         https://bugs.webkit.org/show_bug.cgi?id=132026
         <rdar://problem/16679363>

Modified: trunk/Tools/DumpRenderTree/mac/PixelDumpSupportMac.mm (167690 => 167691)


--- trunk/Tools/DumpRenderTree/mac/PixelDumpSupportMac.mm	2014-04-22 23:51:51 UTC (rev 167690)
+++ trunk/Tools/DumpRenderTree/mac/PixelDumpSupportMac.mm	2014-04-22 23:54:49 UTC (rev 167691)
@@ -106,6 +106,10 @@
     if ([view _isUsingAcceleratedCompositing])
         _onscreen_ = YES;
 
+    // If the window is layer-backed, its backing store will be empty, so we have to use a window server snapshot.
+    if ([view.window.contentView layer])
+        _onscreen_ = YES;
+
     float deviceScaleFactor = [view _backingScaleFactor];
     NSSize webViewSize = [view frame].size;
     size_t pixelsWide = static_cast<size_t>(webViewSize.width * deviceScaleFactor);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to