Title: [119035] branches/safari-536-branch/Source/WebKit2

Diff

Modified: branches/safari-536-branch/Source/WebKit2/ChangeLog (119034 => 119035)


--- branches/safari-536-branch/Source/WebKit2/ChangeLog	2012-05-31 03:16:42 UTC (rev 119034)
+++ branches/safari-536-branch/Source/WebKit2/ChangeLog	2012-05-31 03:18:29 UTC (rev 119035)
@@ -1,3 +1,35 @@
+2012-05-30  Lucas Forschler  <lforsch...@apple.com>
+
+    Merge 118439
+
+    2012-05-24  Anders Carlsson  <ander...@apple.com>
+
+            Make sure that the layer hosting mode is up-to-date when reconnecting to a new web process
+            https://bugs.webkit.org/show_bug.cgi?id=87421
+            <rdar://problem/11510337>
+
+            Reviewed by Beth Dakin.
+
+            Send over the layer hosting mode as part of the web page creation parameters and create the right
+            layer hosting context based on the mode.
+
+            * Shared/WebPageCreationParameters.cpp:
+            (WebKit::WebPageCreationParameters::encode):
+            (WebKit::WebPageCreationParameters::decode):
+            * Shared/WebPageCreationParameters.h:
+            (WebPageCreationParameters):
+            * UIProcess/WebPageProxy.cpp:
+            (WebKit::WebPageProxy::creationParameters):
+            * WebProcess/WebPage/WebPage.cpp:
+            (WebKit::WebPage::WebPage):
+            * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
+            (TiledCoreAnimationDrawingArea):
+            * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
+            (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
+            (WebKit::TiledCoreAnimationDrawingArea::setLayerHostingMode):
+            (WebKit):
+            (WebKit::TiledCoreAnimationDrawingArea::updateLayerHostingContext):
+
 2012-05-28  Lucas Forschler  <lforsch...@apple.com>
 
     Merge 118397

Modified: branches/safari-536-branch/Source/WebKit2/Shared/WebPageCreationParameters.cpp (119034 => 119035)


--- branches/safari-536-branch/Source/WebKit2/Shared/WebPageCreationParameters.cpp	2012-05-31 03:16:42 UTC (rev 119034)
+++ branches/safari-536-branch/Source/WebKit2/Shared/WebPageCreationParameters.cpp	2012-05-31 03:18:29 UTC (rev 119035)
@@ -60,6 +60,7 @@
 
 #if PLATFORM(MAC)
     encoder->encode(isSmartInsertDeleteEnabled);
+    encoder->encodeEnum(layerHostingMode);
 #endif
 
 #if PLATFORM(WIN)
@@ -121,6 +122,8 @@
 #if PLATFORM(MAC)
     if (!decoder->decode(parameters.isSmartInsertDeleteEnabled))
         return false;
+    if (!decoder->decodeEnum(parameters.layerHostingMode))
+        return false;
 #endif
 
 #if PLATFORM(WIN)

Modified: branches/safari-536-branch/Source/WebKit2/Shared/WebPageCreationParameters.h (119034 => 119035)


--- branches/safari-536-branch/Source/WebKit2/Shared/WebPageCreationParameters.h	2012-05-31 03:16:42 UTC (rev 119034)
+++ branches/safari-536-branch/Source/WebKit2/Shared/WebPageCreationParameters.h	2012-05-31 03:18:29 UTC (rev 119035)
@@ -82,6 +82,7 @@
 
 #if PLATFORM(MAC)
     bool isSmartInsertDeleteEnabled;
+    LayerHostingMode layerHostingMode;
 #endif
 
 #if PLATFORM(WIN)

Modified: branches/safari-536-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp (119034 => 119035)


--- branches/safari-536-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp	2012-05-31 03:16:42 UTC (rev 119034)
+++ branches/safari-536-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp	2012-05-31 03:18:29 UTC (rev 119035)
@@ -3459,6 +3459,7 @@
 
 #if PLATFORM(MAC)
     parameters.isSmartInsertDeleteEnabled = m_isSmartInsertDeleteEnabled;
+    parameters.layerHostingMode = m_layerHostingMode;
 #endif
 
 #if PLATFORM(WIN)

Modified: branches/safari-536-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (119034 => 119035)


--- branches/safari-536-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2012-05-31 03:16:42 UTC (rev 119034)
+++ branches/safari-536-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2012-05-31 03:18:29 UTC (rev 119035)
@@ -192,7 +192,7 @@
 #if PLATFORM(MAC)
     , m_windowIsVisible(false)
     , m_isSmartInsertDeleteEnabled(parameters.isSmartInsertDeleteEnabled)
-    , m_layerHostingMode(LayerHostingModeDefault)
+    , m_layerHostingMode(parameters.layerHostingMode)
     , m_keyboardEventBeingInterpreted(0)
 #elif PLATFORM(WIN)
     , m_nativeWindow(parameters.nativeWindow)

Modified: branches/safari-536-branch/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h (119034 => 119035)


--- branches/safari-536-branch/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h	2012-05-31 03:16:42 UTC (rev 119034)
+++ branches/safari-536-branch/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h	2012-05-31 03:18:29 UTC (rev 119035)
@@ -86,6 +86,8 @@
     virtual void setDeviceScaleFactor(float) OVERRIDE;
     virtual void setLayerHostingMode(uint32_t) OVERRIDE;
 
+    void updateLayerHostingContext();
+
     void setRootCompositingLayer(CALayer *);
 
     void createPageOverlayLayer();
@@ -95,7 +97,6 @@
     WebCore::LayerFlushScheduler m_layerFlushScheduler;
 
     OwnPtr<LayerHostingContext> m_layerHostingContext;
-    LayerHostingMode m_layerHostingMode;
     
     RetainPtr<CALayer> m_rootLayer;
     RetainPtr<CALayer> m_pendingRootCompositingLayer;

Modified: branches/safari-536-branch/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm (119034 => 119035)


--- branches/safari-536-branch/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm	2012-05-31 03:16:42 UTC (rev 119034)
+++ branches/safari-536-branch/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm	2012-05-31 03:18:29 UTC (rev 119035)
@@ -83,8 +83,7 @@
     m_rootLayer.get().opaque = YES;
     m_rootLayer.get().geometryFlipped = YES;
 
-    m_layerHostingContext = LayerHostingContext::createForPort(WebProcess::shared().compositingRenderServerPort());
-    m_layerHostingContext->setRootLayer(m_rootLayer.get());
+    updateLayerHostingContext();
     
     LayerTreeContext layerTreeContext;
     layerTreeContext.contextID = m_layerHostingContext->contextID();
@@ -352,34 +351,40 @@
 void TiledCoreAnimationDrawingArea::setLayerHostingMode(uint32_t opaqueLayerHostingMode)
 {
     LayerHostingMode layerHostingMode = static_cast<LayerHostingMode>(opaqueLayerHostingMode);
-    if (layerHostingMode != m_layerHostingContext->layerHostingMode()) {
-        // The mode has changed.
-        
-        // First, invalidate the old hosting context.
+    if (layerHostingMode == m_webPage->layerHostingMode())
+        return;
+
+    m_webPage->setLayerHostingMode(layerHostingMode);
+
+    updateLayerHostingContext();
+
+    // Finally, inform the UIProcess that the context has changed.
+    LayerTreeContext layerTreeContext;
+    layerTreeContext.contextID = m_layerHostingContext->contextID();
+    m_webPage->send(Messages::DrawingAreaProxy::UpdateAcceleratedCompositingMode(0, layerTreeContext));
+}
+
+void TiledCoreAnimationDrawingArea::updateLayerHostingContext()
+{
+    // Invalidate the old context.
+    if (m_layerHostingContext) {
         m_layerHostingContext->invalidate();
         m_layerHostingContext = nullptr;
+    }
 
-        // Create a new context and set it up.
-        switch (layerHostingMode) {
-        case LayerHostingModeDefault:
-            m_layerHostingContext = LayerHostingContext::createForPort(WebProcess::shared().compositingRenderServerPort());
-            break;
+    // Create a new context and set it up.
+    switch (m_webPage->layerHostingMode()) {
+    case LayerHostingModeDefault:
+        m_layerHostingContext = LayerHostingContext::createForPort(WebProcess::shared().compositingRenderServerPort());
+        break;
 #if HAVE(LAYER_HOSTING_IN_WINDOW_SERVER)
-        case LayerHostingModeInWindowServer:
-            m_layerHostingContext = LayerHostingContext::createForWindowServer();        
-            break;
+    case LayerHostingModeInWindowServer:
+        m_layerHostingContext = LayerHostingContext::createForWindowServer();
+        break;
 #endif
-        }
+    }
 
-        m_layerHostingContext->setRootLayer(m_rootLayer.get());
-
-        m_webPage->setLayerHostingMode(layerHostingMode);
-
-        // Finally, inform the UIProcess that the context has changed.
-        LayerTreeContext layerTreeContext;
-        layerTreeContext.contextID = m_layerHostingContext->contextID();
-        m_webPage->send(Messages::DrawingAreaProxy::UpdateAcceleratedCompositingMode(0, layerTreeContext));
-    }
+    m_layerHostingContext->setRootLayer(m_rootLayer.get());
 }
 
 void TiledCoreAnimationDrawingArea::setRootCompositingLayer(CALayer *layer)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to