Title: [134509] trunk/Source/WebKit2
Revision
134509
Author
ander...@apple.com
Date
2012-11-13 17:06:41 -0800 (Tue, 13 Nov 2012)

Log Message

Factor the code to enter accelerated compositing given a layer out into a separate method
https://bugs.webkit.org/show_bug.cgi?id=102155

Reviewed by Andreas Kling.

* UIProcess/API/mac/WKView.mm:
(-[WKView _enterAcceleratedCompositingMode:]):
(-[WKView _enterAcceleratedCompositingModeWithRootLayer:]):
* UIProcess/API/mac/WKViewInternal.h:

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (134508 => 134509)


--- trunk/Source/WebKit2/ChangeLog	2012-11-14 00:59:44 UTC (rev 134508)
+++ trunk/Source/WebKit2/ChangeLog	2012-11-14 01:06:41 UTC (rev 134509)
@@ -1,5 +1,17 @@
 2012-11-13  Anders Carlsson  <ander...@apple.com>
 
+        Factor the code to enter accelerated compositing given a layer out into a separate method
+        https://bugs.webkit.org/show_bug.cgi?id=102155
+
+        Reviewed by Andreas Kling.
+
+        * UIProcess/API/mac/WKView.mm:
+        (-[WKView _enterAcceleratedCompositingMode:]):
+        (-[WKView _enterAcceleratedCompositingModeWithRootLayer:]):
+        * UIProcess/API/mac/WKViewInternal.h:
+
+2012-11-13  Anders Carlsson  <ander...@apple.com>
+
         RemoteGraphicsLayer destructor should call GraphicsLayer::willBeDestroyed
         https://bugs.webkit.org/show_bug.cgi?id=102135
 

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


--- trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm	2012-11-14 00:59:44 UTC (rev 134508)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm	2012-11-14 01:06:41 UTC (rev 134509)
@@ -2564,9 +2564,16 @@
 
 - (void)_enterAcceleratedCompositingMode:(const LayerTreeContext&)layerTreeContext
 {
-    ASSERT(!_data->_layerHostingView);
     ASSERT(!layerTreeContext.isEmpty());
 
+    CALayer *renderLayer = WKMakeRenderLayer(layerTreeContext.contextID);
+    [self _enterAcceleratedCompositingModeWithRootLayer:renderLayer];
+}
+
+- (void)_enterAcceleratedCompositingModeWithRootLayer:(CALayer *)layer
+{
+    ASSERT(!_data->_layerHostingView);
+
     // Create an NSView that will host our layer tree.
     _data->_layerHostingView.adoptNS([[WKFlippedView alloc] initWithFrame:[self bounds]]);
     [_data->_layerHostingView.get() setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
@@ -2582,8 +2589,7 @@
     [rootLayer.get() setName:@"Hosting root layer"];
 #endif
 
-    CALayer *renderLayer = WKMakeRenderLayer(layerTreeContext.contextID);
-    [rootLayer.get() addSublayer:renderLayer];
+    [rootLayer.get() addSublayer:layer];
 
     [_data->_layerHostingView.get() setLayer:rootLayer.get()];
     [_data->_layerHostingView.get() setWantsLayer:YES];

Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKViewInternal.h (134508 => 134509)


--- trunk/Source/WebKit2/UIProcess/API/mac/WKViewInternal.h	2012-11-14 00:59:44 UTC (rev 134508)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKViewInternal.h	2012-11-14 01:06:41 UTC (rev 134509)
@@ -66,6 +66,7 @@
 - (void)_setFindIndicator:(PassRefPtr<WebKit::FindIndicator>)findIndicator fadeOut:(BOOL)fadeOut animate:(BOOL)animate;
 
 - (void)_enterAcceleratedCompositingMode:(const WebKit::LayerTreeContext&)layerTreeContext;
+- (void)_enterAcceleratedCompositingModeWithRootLayer:(CALayer *)rootLayer;
 - (void)_exitAcceleratedCompositingMode;
 - (void)_updateAcceleratedCompositingMode:(const WebKit::LayerTreeContext&)layerTreeContext;
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to