Title: [134455] trunk/Source/WebKit2
Revision
134455
Author
[email protected]
Date
2012-11-13 11:33:01 -0800 (Tue, 13 Nov 2012)

Log Message

The layer tree transaction should include the root layer
https://bugs.webkit.org/show_bug.cgi?id=102109

Reviewed by Andreas Kling.

Keep the root layer ID in the layer tree transaction and encode/decode and dump it.

* Shared/mac/RemoteLayerTreeTransaction.h:
(RemoteLayerTreeTransaction):
* Shared/mac/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::encode):
(WebKit::RemoteLayerTreeTransaction::decode):
(WebKit::RemoteLayerTreeTransaction::setRootLayerID):
(WebKit):
(WebKit::RemoteLayerTreeTransaction::dump):
* WebProcess/WebPage/mac/RemoteLayerTreeContext.h:
(RemoteLayerTreeContext):
* WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
(WebKit::RemoteLayerTreeContext::RemoteLayerTreeContext):
(WebKit::RemoteLayerTreeContext::setRootLayer):
(WebKit::RemoteLayerTreeContext::flushLayers):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (134454 => 134455)


--- trunk/Source/WebKit2/ChangeLog	2012-11-13 19:31:19 UTC (rev 134454)
+++ trunk/Source/WebKit2/ChangeLog	2012-11-13 19:33:01 UTC (rev 134455)
@@ -1,3 +1,27 @@
+2012-11-13  Anders Carlsson  <[email protected]>
+
+        The layer tree transaction should include the root layer
+        https://bugs.webkit.org/show_bug.cgi?id=102109
+
+        Reviewed by Andreas Kling.
+
+        Keep the root layer ID in the layer tree transaction and encode/decode and dump it.
+
+        * Shared/mac/RemoteLayerTreeTransaction.h:
+        (RemoteLayerTreeTransaction):
+        * Shared/mac/RemoteLayerTreeTransaction.mm:
+        (WebKit::RemoteLayerTreeTransaction::encode):
+        (WebKit::RemoteLayerTreeTransaction::decode):
+        (WebKit::RemoteLayerTreeTransaction::setRootLayerID):
+        (WebKit):
+        (WebKit::RemoteLayerTreeTransaction::dump):
+        * WebProcess/WebPage/mac/RemoteLayerTreeContext.h:
+        (RemoteLayerTreeContext):
+        * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
+        (WebKit::RemoteLayerTreeContext::RemoteLayerTreeContext):
+        (WebKit::RemoteLayerTreeContext::setRootLayer):
+        (WebKit::RemoteLayerTreeContext::flushLayers):
+
 2012-11-13  Mikhail Pozdnyakov  <[email protected]>
 
         [WK2] TiledBackingStore: WebChromeClient::pageRect() should consider viewport size

Modified: trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h (134454 => 134455)


--- trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h	2012-11-13 19:31:19 UTC (rev 134454)
+++ trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h	2012-11-13 19:33:01 UTC (rev 134455)
@@ -58,19 +58,21 @@
         Vector<uint64_t> children;
     };
 
-    RemoteLayerTreeTransaction();
+    explicit RemoteLayerTreeTransaction();
     ~RemoteLayerTreeTransaction();
 
     void encode(CoreIPC::ArgumentEncoder&) const;
     static bool decode(CoreIPC::ArgumentDecoder*, RemoteLayerTreeTransaction&);
 
     void layerPropertiesChanged(const RemoteGraphicsLayer*, unsigned changedProperties);
+    void setRootLayerID(uint64_t rootLayerID);
 
 #ifndef NDEBUG
     void dump() const;
 #endif
 
 private:
+    uint64_t m_rootLayerID;
     HashMap<uint64_t, LayerProperties> m_changedLayerProperties;
 };
 

Modified: trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm (134454 => 134455)


--- trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm	2012-11-13 19:31:19 UTC (rev 134454)
+++ trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm	2012-11-13 19:33:01 UTC (rev 134455)
@@ -86,17 +86,30 @@
 
 void RemoteLayerTreeTransaction::encode(CoreIPC::ArgumentEncoder& encoder) const
 {
+    encoder << m_rootLayerID;
     encoder << m_changedLayerProperties;
 }
 
 bool RemoteLayerTreeTransaction::decode(CoreIPC::ArgumentDecoder* decoder, RemoteLayerTreeTransaction& result)
 {
+    if (!decoder->decode(result.m_rootLayerID))
+        return false;
+    if (!result.m_rootLayerID)
+        return false;
+
     if (!decoder->decode(result.m_changedLayerProperties))
         return false;
 
     return true;
 }
 
+void RemoteLayerTreeTransaction::setRootLayerID(uint64_t rootLayerID)
+{
+    ASSERT_ARG(rootLayerID, rootLayerID);
+
+    m_rootLayerID = rootLayerID;
+}
+
 void RemoteLayerTreeTransaction::layerPropertiesChanged(const RemoteGraphicsLayer* graphicsLayer, unsigned changedProperties)
 {
     LayerProperties& layerProperties = m_changedLayerProperties.add(graphicsLayer->layerID(), LayerProperties()).iterator->value;
@@ -176,7 +189,14 @@
     StringBuilder builder;
 
     builder.append("(\n");
+
+    writeIndent(builder, 1);
+    builder.append("(root-layer ");
+    builder.appendNumber(m_rootLayerID);
+    builder.append(")\n");
+
     dumpChangedLayers(builder, m_changedLayerProperties);
+
     builder.append(")\n");
 
     fprintf(stderr, "%s", builder.toString().utf8().data());

Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeContext.h (134454 => 134455)


--- trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeContext.h	2012-11-13 19:31:19 UTC (rev 134454)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeContext.h	2012-11-13 19:33:01 UTC (rev 134455)
@@ -55,6 +55,8 @@
 
     WebPage* m_webPage;
     WebCore::Timer<RemoteLayerTreeContext> m_layerFlushTimer;
+
+    uint64_t m_rootLayerID;
     RemoteLayerTreeTransaction* m_currentTransaction;
 };
 

Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeContext.mm (134454 => 134455)


--- trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeContext.mm	2012-11-13 19:31:19 UTC (rev 134454)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeContext.mm	2012-11-13 19:33:01 UTC (rev 134455)
@@ -48,7 +48,8 @@
 RemoteLayerTreeContext::RemoteLayerTreeContext(WebPage* webPage)
     : m_webPage(webPage)
     , m_layerFlushTimer(this, &RemoteLayerTreeContext::layerFlushTimerFired)
-    , m_currentTransaction(0)
+    , m_rootLayerID(0)
+    , m_currentTransaction(nullptr)
 {
 }
 
@@ -58,6 +59,9 @@
 
 void RemoteLayerTreeContext::setRootLayer(GraphicsLayer* rootLayer)
 {
+    ASSERT(rootLayer);
+
+    m_rootLayerID = static_cast<RemoteGraphicsLayer*>(rootLayer)->layerID();
 }
 
 void RemoteLayerTreeContext::scheduleLayerFlush()
@@ -90,6 +94,8 @@
     ASSERT(!m_currentTransaction);
 
     RemoteLayerTreeTransaction transaction;
+    transaction.setRootLayerID(m_rootLayerID);
+
     TemporaryChange<RemoteLayerTreeTransaction*> transactionChange(m_currentTransaction, &transaction);
 
     m_webPage->layoutIfNeeded();
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to