Title: [170216] trunk/Source/WebKit2
Revision
170216
Author
[email protected]
Date
2014-06-20 15:38:21 -0700 (Fri, 20 Jun 2014)

Log Message

WKThumbnailView should only use live layer trees before the snapshot arrives for parented WKViews
https://bugs.webkit.org/show_bug.cgi?id=134129
<rdar://problem/17401591>

Reviewed by Anders Carlsson.

* UIProcess/API/Cocoa/_WKThumbnailView.mm:
(-[_WKThumbnailView initWithFrame:fromWKView:]):
Add a white background to WKThumbnailView, so that if we have no snapshot and no layer tree,
the view isn't transparent.

* UIProcess/API/mac/WKView.mm:
(-[WKView _updateThumbnailViewLayer]):
We currently pull the live layer tree into the WKThumbnailView even in snapshot mode,
before the snapshot arrives, to avoid flashing when transitioning a live WKView to a thumbnail view.
This is, however, not useful for unparented WKViews, because their layer tree will be detached
and we'll flash anyway. So, only do that when the WKView is parented.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (170215 => 170216)


--- trunk/Source/WebKit2/ChangeLog	2014-06-20 22:27:36 UTC (rev 170215)
+++ trunk/Source/WebKit2/ChangeLog	2014-06-20 22:38:21 UTC (rev 170216)
@@ -1,3 +1,23 @@
+2014-06-20  Timothy Horton  <[email protected]>
+
+        WKThumbnailView should only use live layer trees before the snapshot arrives for parented WKViews
+        https://bugs.webkit.org/show_bug.cgi?id=134129
+        <rdar://problem/17401591>
+
+        Reviewed by Anders Carlsson.
+
+        * UIProcess/API/Cocoa/_WKThumbnailView.mm:
+        (-[_WKThumbnailView initWithFrame:fromWKView:]):
+        Add a white background to WKThumbnailView, so that if we have no snapshot and no layer tree,
+        the view isn't transparent.
+
+        * UIProcess/API/mac/WKView.mm:
+        (-[WKView _updateThumbnailViewLayer]):
+        We currently pull the live layer tree into the WKThumbnailView even in snapshot mode,
+        before the snapshot arrives, to avoid flashing when transitioning a live WKView to a thumbnail view.
+        This is, however, not useful for unparented WKViews, because their layer tree will be detached
+        and we'll flash anyway. So, only do that when the WKView is parented.
+
 2014-06-20  Geoffrey Garen  <[email protected]>
 
         WebKit delegate methods should document their default behaviors

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKThumbnailView.mm (170215 => 170216)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKThumbnailView.mm	2014-06-20 22:27:36 UTC (rev 170215)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKThumbnailView.mm	2014-06-20 22:38:21 UTC (rev 170216)
@@ -66,6 +66,7 @@
         return nil;
 
     self.wantsLayer = YES;
+    self.layer.backgroundColor = [NSColor whiteColor].CGColor;
 
     _wkView = wkView;
     _webPageProxy = toImpl([_wkView pageRef]);

Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm (170215 => 170216)


--- trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm	2014-06-20 22:27:36 UTC (rev 170215)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm	2014-06-20 22:38:21 UTC (rev 170216)
@@ -3528,7 +3528,7 @@
     _WKThumbnailView *thumbnailView = _data->_thumbnailView;
     ASSERT(thumbnailView);
 
-    if (!thumbnailView.usesSnapshot || thumbnailView._waitingForSnapshot)
+    if (!thumbnailView.usesSnapshot || (thumbnailView._waitingForSnapshot && self.window))
         [self _reparentLayerTreeInThumbnailView];
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to