Title: [116478] trunk/Source/WebKit2
Revision
116478
Author
[email protected]
Date
2012-05-08 19:03:34 -0700 (Tue, 08 May 2012)

Log Message

DrawingAreaProxyImpl doesn't work with window server hosting
https://bugs.webkit.org/show_bug.cgi?id=85947
<rdar://problem/11213718>

Reviewed by Andreas Kling.

* UIProcess/DrawingAreaProxyImpl.cpp:
(WebKit::DrawingAreaProxyImpl::updateAcceleratedCompositingMode):
Update the layer tree context and call WebPage::updateAcceleratedCompositingMode.

* WebProcess/WebPage/DrawingAreaImpl.cpp:
(WebKit::DrawingAreaImpl::setLayerHostingMode):
If setting the layer hosting mode changed the layer tree context, send back an UpdateAcceleratedCompositingMode message
with the new context.

* WebProcess/WebPage/ca/LayerTreeHostCA.cpp:
(WebKit::LayerTreeHostCA::initialize):
platformInitialize no longer takes a context.

* WebProcess/WebPage/ca/LayerTreeHostCA.h:
(LayerTreeHostCA):
Make m_layerTreeContext protected instead.

* WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.h:
* WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.mm:
(WebKit::LayerTreeHostCAMac::platformInitialize):
Assign to m_layerTreeContext directly.

(WebKit::LayerTreeHostCAMac::setLayerHostingMode):
Set m_layerTreeContext.contextID.

* WebProcess/WebPage/ca/win/LayerTreeHostCAWin.cpp:
(WebKit::LayerTreeHostCAWin::platformInitialize):
Assign to m_layerTreeContext directly.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (116477 => 116478)


--- trunk/Source/WebKit2/ChangeLog	2012-05-09 01:47:24 UTC (rev 116477)
+++ trunk/Source/WebKit2/ChangeLog	2012-05-09 02:03:34 UTC (rev 116478)
@@ -1,3 +1,40 @@
+2012-05-08  Anders Carlsson  <[email protected]>
+
+        DrawingAreaProxyImpl doesn't work with window server hosting
+        https://bugs.webkit.org/show_bug.cgi?id=85947
+        <rdar://problem/11213718>
+
+        Reviewed by Andreas Kling.
+
+        * UIProcess/DrawingAreaProxyImpl.cpp:
+        (WebKit::DrawingAreaProxyImpl::updateAcceleratedCompositingMode):
+        Update the layer tree context and call WebPage::updateAcceleratedCompositingMode.
+
+        * WebProcess/WebPage/DrawingAreaImpl.cpp:
+        (WebKit::DrawingAreaImpl::setLayerHostingMode):
+        If setting the layer hosting mode changed the layer tree context, send back an UpdateAcceleratedCompositingMode message
+        with the new context.
+
+        * WebProcess/WebPage/ca/LayerTreeHostCA.cpp:
+        (WebKit::LayerTreeHostCA::initialize):
+        platformInitialize no longer takes a context.
+
+        * WebProcess/WebPage/ca/LayerTreeHostCA.h:
+        (LayerTreeHostCA):
+        Make m_layerTreeContext protected instead.
+
+        * WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.h:
+        * WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.mm:
+        (WebKit::LayerTreeHostCAMac::platformInitialize):
+        Assign to m_layerTreeContext directly.
+
+        (WebKit::LayerTreeHostCAMac::setLayerHostingMode):
+        Set m_layerTreeContext.contextID.
+
+        * WebProcess/WebPage/ca/win/LayerTreeHostCAWin.cpp:
+        (WebKit::LayerTreeHostCAWin::platformInitialize):
+        Assign to m_layerTreeContext directly.
+
 2012-05-08  Jon Lee  <[email protected]>
 
         Safari warns that it needs to resend the form in an iFrame when going back

Modified: trunk/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp (116477 => 116478)


--- trunk/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp	2012-05-09 01:47:24 UTC (rev 116477)
+++ trunk/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp	2012-05-09 02:03:34 UTC (rev 116478)
@@ -245,6 +245,17 @@
     incorporateUpdate(updateInfo);
 }
 
+void DrawingAreaProxyImpl::updateAcceleratedCompositingMode(uint64_t backingStoreStateID, const LayerTreeContext& layerTreeContext)
+{
+    ASSERT_ARG(backingStoreStateID, backingStoreStateID <= m_currentBackingStoreStateID);
+    if (backingStoreStateID < m_currentBackingStoreStateID)
+        return;
+
+#if USE(ACCELERATED_COMPOSITING)
+    updateAcceleratedCompositingMode(layerTreeContext);
+#endif
+}
+
 void DrawingAreaProxyImpl::incorporateUpdate(const UpdateInfo& updateInfo)
 {
     ASSERT(!isInAcceleratedCompositingMode());
@@ -368,6 +379,14 @@
     m_layerTreeContext = LayerTreeContext();    
     m_webPageProxy->exitAcceleratedCompositingMode();
 }
+
+void DrawingAreaProxyImpl::updateAcceleratedCompositingMode(const LayerTreeContext& layerTreeContext)
+{
+    ASSERT(isInAcceleratedCompositingMode());
+
+    m_layerTreeContext = layerTreeContext;
+    m_webPageProxy->updateAcceleratedCompositingMode(layerTreeContext);
+}
 #endif
 
 void DrawingAreaProxyImpl::pageCustomRepresentationChanged()

Modified: trunk/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.h (116477 => 116478)


--- trunk/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.h	2012-05-09 01:47:24 UTC (rev 116477)
+++ trunk/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.h	2012-05-09 02:03:34 UTC (rev 116478)
@@ -65,6 +65,7 @@
     virtual void didUpdateBackingStoreState(uint64_t backingStoreStateID, const UpdateInfo&, const LayerTreeContext&);
     virtual void enterAcceleratedCompositingMode(uint64_t backingStoreStateID, const LayerTreeContext&);
     virtual void exitAcceleratedCompositingMode(uint64_t backingStoreStateID, const UpdateInfo&);
+    virtual void updateAcceleratedCompositingMode(uint64_t backingStoreStateID, const LayerTreeContext&);
 
     void incorporateUpdate(const UpdateInfo&);
 
@@ -76,6 +77,7 @@
 #if USE(ACCELERATED_COMPOSITING)
     void enterAcceleratedCompositingMode(const LayerTreeContext&);
     void exitAcceleratedCompositingMode();
+    void updateAcceleratedCompositingMode(const LayerTreeContext&);
 
     bool isInAcceleratedCompositingMode() const { return !m_layerTreeContext.isEmpty(); }
 

Modified: trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp (116477 => 116478)


--- trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp	2012-05-09 01:47:24 UTC (rev 116477)
+++ trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp	2012-05-09 02:03:34 UTC (rev 116478)
@@ -705,7 +705,11 @@
     if (!m_layerTreeHost)
         return;
 
+    LayerTreeContext oldLayerTreeContext = m_layerTreeHost->layerTreeContext();
     m_layerTreeHost->setLayerHostingMode(layerHostingMode);
+
+    if (m_layerTreeHost->layerTreeContext() != oldLayerTreeContext)
+        m_webPage->send(Messages::DrawingAreaProxy::UpdateAcceleratedCompositingMode(m_backingStoreStateID, m_layerTreeHost->layerTreeContext()));
 }
 #endif
 

Modified: trunk/Source/WebKit2/WebProcess/WebPage/ca/LayerTreeHostCA.cpp (116477 => 116478)


--- trunk/Source/WebKit2/WebProcess/WebPage/ca/LayerTreeHostCA.cpp	2012-05-09 01:47:24 UTC (rev 116477)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ca/LayerTreeHostCA.cpp	2012-05-09 02:03:34 UTC (rev 116478)
@@ -75,7 +75,7 @@
     if (m_webPage->hasPageOverlay())
         createPageOverlayLayer();
 
-    platformInitialize(m_layerTreeContext);
+    platformInitialize();
 
     setLayerFlushSchedulingEnabled(!m_webPage->drawingArea() || !m_webPage->drawingArea()->layerTreeStateIsFrozen());
     scheduleLayerFlush();

Modified: trunk/Source/WebKit2/WebProcess/WebPage/ca/LayerTreeHostCA.h (116477 => 116478)


--- trunk/Source/WebKit2/WebProcess/WebPage/ca/LayerTreeHostCA.h	2012-05-09 01:47:24 UTC (rev 116477)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ca/LayerTreeHostCA.h	2012-05-09 02:03:34 UTC (rev 116478)
@@ -58,6 +58,8 @@
 
     bool m_layerFlushSchedulingEnabled;
 
+    LayerTreeContext m_layerTreeContext;
+
 private:
     // LayerTreeHost.
     virtual const LayerTreeContext& layerTreeContext();
@@ -80,14 +82,11 @@
     virtual void didCommitChangesForLayer(const WebCore::GraphicsLayer*) const { }
 
     // LayerTreeHostCA
-    virtual void platformInitialize(LayerTreeContext&) = 0;
+    virtual void platformInitialize() = 0;
 
     void createPageOverlayLayer();
     void destroyPageOverlayLayer();
 
-    // The context for this layer tree.
-    LayerTreeContext m_layerTreeContext;
-
     // Whether the layer tree host is valid or not.
     bool m_isValid;    
 

Modified: trunk/Source/WebKit2/WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.h (116477 => 116478)


--- trunk/Source/WebKit2/WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.h	2012-05-09 01:47:24 UTC (rev 116477)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.h	2012-05-09 02:03:34 UTC (rev 116478)
@@ -54,7 +54,7 @@
     virtual void setLayerHostingMode(LayerHostingMode) OVERRIDE;
 
     // LayerTreeHostCA
-    virtual void platformInitialize(LayerTreeContext&);
+    virtual void platformInitialize();
     virtual void didPerformScheduledLayerFlush();
 
     virtual bool flushPendingLayerChanges();

Modified: trunk/Source/WebKit2/WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.mm (116477 => 116478)


--- trunk/Source/WebKit2/WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.mm	2012-05-09 01:47:24 UTC (rev 116477)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.mm	2012-05-09 02:03:34 UTC (rev 116478)
@@ -58,7 +58,7 @@
     ASSERT(!m_layerHostingContext);
 }
 
-void LayerTreeHostCAMac::platformInitialize(LayerTreeContext& layerTreeContext)
+void LayerTreeHostCAMac::platformInitialize()
 {
     switch (m_webPage->layerHostingMode()) {
     case LayerHostingModeDefault:
@@ -70,9 +70,9 @@
         break;
 #endif
     }
+
     m_layerHostingContext->setRootLayer(rootLayer()->platformLayer());
-
-    layerTreeContext.contextID = m_layerHostingContext->contextID();
+    m_layerTreeContext.contextID = m_layerHostingContext->contextID();
 }
 
 void LayerTreeHostCAMac::scheduleLayerFlush()
@@ -169,6 +169,7 @@
     }
 
     m_layerHostingContext->setRootLayer(rootLayer()->platformLayer());
+    m_layerTreeContext.contextID = m_layerHostingContext->contextID();
 
     scheduleLayerFlush();
 }

Modified: trunk/Source/WebKit2/WebProcess/WebPage/ca/win/LayerTreeHostCAWin.cpp (116477 => 116478)


--- trunk/Source/WebKit2/WebProcess/WebPage/ca/win/LayerTreeHostCAWin.cpp	2012-05-09 01:47:24 UTC (rev 116477)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ca/win/LayerTreeHostCAWin.cpp	2012-05-09 02:03:34 UTC (rev 116478)
@@ -89,7 +89,7 @@
 {
 }
 
-void LayerTreeHostCAWin::platformInitialize(LayerTreeContext& context)
+void LayerTreeHostCAWin::platformInitialize()
 {
     m_view.adoptCF(WKCACFViewCreate(kWKCACFViewDrawingDestinationWindow));
     WKCACFViewSetContextUserData(m_view.get(), static_cast<AbstractCACFLayerTreeHost*>(this));
@@ -106,7 +106,7 @@
     CGRect bounds = m_webPage->bounds();
     WKCACFViewUpdate(m_view.get(), m_window->window(), &bounds);
 
-    context.window = m_window->window();
+    m_layerTreeContext.window = m_window->window();
 }
 
 void LayerTreeHostCAWin::invalidate()
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to