Title: [134300] trunk/Source/WebKit2
Revision
134300
Author
[email protected]
Date
2012-11-12 13:59:39 -0800 (Mon, 12 Nov 2012)

Log Message

Store name changes in the layer transaction
https://bugs.webkit.org/show_bug.cgi?id=101981

Reviewed by Andreas Kling.

* Shared/mac/RemoteLayerTreeTransaction.h:
(LayerProperties):
Add new LayerProperties class.

(RemoteLayerTreeTransaction):
* Shared/mac/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::layerPropertiesChanged):
Find the changed layer properties for the given layer and apply the changed properties.

* WebProcess/WebPage/mac/RemoteGraphicsLayer.h:
(WebKit::RemoteGraphicsLayer::layerID):
Add new getter.

* WebProcess/WebPage/mac/RemoteGraphicsLayer.mm:
(WebKit::generateLayerID):
(WebKit::RemoteGraphicsLayer::RemoteGraphicsLayer):
Give each remote graphics layer a unique ID.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (134299 => 134300)


--- trunk/Source/WebKit2/ChangeLog	2012-11-12 21:56:33 UTC (rev 134299)
+++ trunk/Source/WebKit2/ChangeLog	2012-11-12 21:59:39 UTC (rev 134300)
@@ -1,3 +1,28 @@
+2012-11-12  Anders Carlsson  <[email protected]>
+
+        Store name changes in the layer transaction
+        https://bugs.webkit.org/show_bug.cgi?id=101981
+
+        Reviewed by Andreas Kling.
+
+        * Shared/mac/RemoteLayerTreeTransaction.h:
+        (LayerProperties):
+        Add new LayerProperties class.
+
+        (RemoteLayerTreeTransaction):
+        * Shared/mac/RemoteLayerTreeTransaction.mm:
+        (WebKit::RemoteLayerTreeTransaction::layerPropertiesChanged):
+        Find the changed layer properties for the given layer and apply the changed properties.
+
+        * WebProcess/WebPage/mac/RemoteGraphicsLayer.h:
+        (WebKit::RemoteGraphicsLayer::layerID):
+        Add new getter.
+
+        * WebProcess/WebPage/mac/RemoteGraphicsLayer.mm:
+        (WebKit::generateLayerID):
+        (WebKit::RemoteGraphicsLayer::RemoteGraphicsLayer):
+        Give each remote graphics layer a unique ID.
+
 2012-11-12  Brady Eidson  <[email protected]>
 
         NetworkProcess: Use an accurate shouldContentSniff value when creating ResourceHandles

Modified: trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h (134299 => 134300)


--- trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h	2012-11-12 21:56:33 UTC (rev 134299)
+++ trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h	2012-11-12 21:59:39 UTC (rev 134300)
@@ -26,6 +26,9 @@
 #ifndef RemoteLayerTreeTransaction_h
 #define RemoteLayerTreeTransaction_h
 
+#include <wtf/HashMap.h>
+#include <wtf/text/WTFString.h>
+
 namespace WebKit {
 
 class RemoteGraphicsLayer;
@@ -37,10 +40,21 @@
         NameChanged = 1 << 1,
     };
 
+    struct LayerProperties {
+        LayerProperties();
+
+        unsigned changedProperties;
+
+        String name;
+    };
+
     RemoteLayerTreeTransaction();
     ~RemoteLayerTreeTransaction();
 
-    void layerPropertiesChanged(const RemoteGraphicsLayer*, unsigned layerChanges);
+    void layerPropertiesChanged(const RemoteGraphicsLayer*, unsigned changedProperties);
+
+private:
+    HashMap<uint64_t, LayerProperties> m_changedLayerProperties;
 };
 
 } // namespace WebKit

Modified: trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm (134299 => 134300)


--- trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm	2012-11-12 21:56:33 UTC (rev 134299)
+++ trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm	2012-11-12 21:59:39 UTC (rev 134300)
@@ -26,8 +26,15 @@
 #include "config.h"
 #include "RemoteLayerTreeTransaction.h"
 
+#include "RemoteGraphicsLayer.h"
+
 namespace WebKit {
 
+RemoteLayerTreeTransaction::LayerProperties::LayerProperties()
+    : changedProperties(NoChange)
+{
+}
+
 RemoteLayerTreeTransaction::RemoteLayerTreeTransaction()
 {
 }
@@ -36,9 +43,14 @@
 {
 }
 
-void RemoteLayerTreeTransaction::layerPropertiesChanged(const RemoteGraphicsLayer*, unsigned layerChanges)
+void RemoteLayerTreeTransaction::layerPropertiesChanged(const RemoteGraphicsLayer* graphicsLayer, unsigned changedProperties)
 {
-    // FIXME: Implement this.
+    LayerProperties& layerProperties = m_changedLayerProperties.add(graphicsLayer->layerID(), LayerProperties()).iterator->value;
+
+    layerProperties.changedProperties |= changedProperties;
+
+    if (changedProperties & NameChanged)
+        layerProperties.name = graphicsLayer->name();
 }
 
 } // namespace WebKit

Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteGraphicsLayer.h (134299 => 134300)


--- trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteGraphicsLayer.h	2012-11-12 21:56:33 UTC (rev 134299)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteGraphicsLayer.h	2012-11-12 21:59:39 UTC (rev 134300)
@@ -37,6 +37,8 @@
     static PassOwnPtr<WebCore::GraphicsLayer> create(WebCore::GraphicsLayerClient*, RemoteLayerTreeController*);
     virtual ~RemoteGraphicsLayer();
 
+    uint64_t layerID() const { return m_layerID; }
+
 private:
     RemoteGraphicsLayer(WebCore::GraphicsLayerClient*, RemoteLayerTreeController*);
 
@@ -50,8 +52,8 @@
     void noteLayerPropertiesChanged(unsigned layerChanges);
     void recursiveCommitChanges();
 
+    uint64_t m_layerID;
     RemoteLayerTreeController* m_controller;
-
     unsigned m_uncommittedLayerChanges;
 };
 

Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteGraphicsLayer.mm (134299 => 134300)


--- trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteGraphicsLayer.mm	2012-11-12 21:56:33 UTC (rev 134299)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteGraphicsLayer.mm	2012-11-12 21:59:39 UTC (rev 134300)
@@ -35,6 +35,12 @@
 
 namespace WebKit {
 
+static uint64_t generateLayerID()
+{
+    static uint64_t layerID;
+    return ++layerID;
+}
+
 PassOwnPtr<GraphicsLayer> RemoteGraphicsLayer::create(GraphicsLayerClient* client, RemoteLayerTreeController* controller)
 {
     return adoptPtr(new RemoteGraphicsLayer(client, controller));
@@ -42,6 +48,7 @@
 
 RemoteGraphicsLayer::RemoteGraphicsLayer(GraphicsLayerClient* client, RemoteLayerTreeController* controller)
     : GraphicsLayer(client)
+    , m_layerID(generateLayerID())
     , m_controller(controller)
     , m_uncommittedLayerChanges(RemoteLayerTreeTransaction::NoChange)
 {
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to