Title: [109466] trunk/Source
Revision
109466
Author
[email protected]
Date
2012-03-01 16:47:56 -0800 (Thu, 01 Mar 2012)

Log Message

[chromium] Rename LayerChromium::name to debugName to be more consistent with other debug properties, make threadsafe
https://bugs.webkit.org/show_bug.cgi?id=79723

Reviewed by Adrienne Walker.

Source/WebCore:

* platform/graphics/chromium/GraphicsLayerChromium.cpp:
(WebCore::GraphicsLayerChromium::updateNames):
* platform/graphics/chromium/LayerChromium.cpp:
(WebCore::LayerChromium::pushPropertiesTo):
(WebCore::LayerChromium::setDebugName):
(WebCore):
* platform/graphics/chromium/LayerChromium.h:
(LayerChromium):
* platform/graphics/chromium/cc/CCLayerImpl.cpp:
(WebCore::CCLayerImpl::dumpLayer):
* platform/graphics/chromium/cc/CCLayerImpl.h:
(CCLayerImpl):
(WebCore::CCLayerImpl::setDebugName):
(WebCore::CCLayerImpl::debugName):
* platform/graphics/chromium/cc/CCRenderSurface.cpp:
(WebCore::CCRenderSurface::name):

Source/WebKit/chromium:

* tests/LayerChromiumTest.cpp:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (109465 => 109466)


--- trunk/Source/WebCore/ChangeLog	2012-03-02 00:42:47 UTC (rev 109465)
+++ trunk/Source/WebCore/ChangeLog	2012-03-02 00:47:56 UTC (rev 109466)
@@ -1,3 +1,27 @@
+2012-03-01  James Robinson  <[email protected]>
+
+        [chromium] Rename LayerChromium::name to debugName to be more consistent with other debug properties, make threadsafe
+        https://bugs.webkit.org/show_bug.cgi?id=79723
+
+        Reviewed by Adrienne Walker.
+
+        * platform/graphics/chromium/GraphicsLayerChromium.cpp:
+        (WebCore::GraphicsLayerChromium::updateNames):
+        * platform/graphics/chromium/LayerChromium.cpp:
+        (WebCore::LayerChromium::pushPropertiesTo):
+        (WebCore::LayerChromium::setDebugName):
+        (WebCore):
+        * platform/graphics/chromium/LayerChromium.h:
+        (LayerChromium):
+        * platform/graphics/chromium/cc/CCLayerImpl.cpp:
+        (WebCore::CCLayerImpl::dumpLayer):
+        * platform/graphics/chromium/cc/CCLayerImpl.h:
+        (CCLayerImpl):
+        (WebCore::CCLayerImpl::setDebugName):
+        (WebCore::CCLayerImpl::debugName):
+        * platform/graphics/chromium/cc/CCRenderSurface.cpp:
+        (WebCore::CCRenderSurface::name):
+
 2012-03-01  Adam Barth  <[email protected]>
 
         Remove last ENABLED(INDEXED_DATABASE) ifdef from WebCore proper

Modified: trunk/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp (109465 => 109466)


--- trunk/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp	2012-03-02 00:42:47 UTC (rev 109465)
+++ trunk/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp	2012-03-02 00:47:56 UTC (rev 109466)
@@ -117,11 +117,11 @@
 void GraphicsLayerChromium::updateNames()
 {
     if (m_layer)
-        m_layer->setName("Layer for " + m_nameBase);
+        m_layer->setDebugName("Layer for " + m_nameBase);
     if (m_transformLayer)
-        m_transformLayer->setName("TransformLayer for " + m_nameBase);
+        m_transformLayer->setDebugName("TransformLayer for " + m_nameBase);
     if (m_contentsLayer)
-        m_contentsLayer->setName("ContentsLayer for " + m_nameBase);
+        m_contentsLayer->setDebugName("ContentsLayer for " + m_nameBase);
 }
 
 bool GraphicsLayerChromium::setChildren(const Vector<GraphicsLayer*>& children)

Modified: trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp (109465 => 109466)


--- trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp	2012-03-02 00:42:47 UTC (rev 109465)
+++ trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp	2012-03-02 00:47:56 UTC (rev 109466)
@@ -485,11 +485,6 @@
     return m_parent;
 }
 
-void LayerChromium::setName(const String& name)
-{
-    m_name = name;
-}
-
 void LayerChromium::setNeedsDisplayRect(const FloatRect& dirtyRect)
 {
     // Simply mark the contents as dirty. For non-root layers, the call to
@@ -511,6 +506,7 @@
     layer->setContentBounds(contentBounds());
     layer->setDebugBorderColor(m_debugBorderColor);
     layer->setDebugBorderWidth(m_debugBorderWidth);
+    layer->setDebugName(m_debugName.isolatedCopy()); // We have to use isolatedCopy() here to safely pass ownership to another thread.
     layer->setDoubleSided(m_doubleSided);
     layer->setDrawsContent(drawsContent());
     layer->setFilters(filters());
@@ -525,7 +521,6 @@
         layer->setNonFastScrollableRegion(m_nonFastScrollableRegion);
         m_nonFastScrollableRegionChanged = false;
     }
-    layer->setName(m_name);
     layer->setOpaque(m_opaque);
     layer->setOpacity(m_opacity);
     layer->setPosition(m_position);
@@ -566,6 +561,13 @@
     setNeedsCommit();
 }
 
+void LayerChromium::setDebugName(const String& debugName)
+{
+    m_debugName = debugName;
+    setNeedsCommit();
+}
+
+
 void LayerChromium::setContentsScale(float contentsScale)
 {
     if (!needsContentsScale() || m_contentsScale == contentsScale)

Modified: trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.h (109465 => 109466)


--- trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.h	2012-03-02 00:42:47 UTC (rev 109465)
+++ trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.h	2012-03-02 00:47:56 UTC (rev 109466)
@@ -99,9 +99,6 @@
     void setMasksToBounds(bool);
     bool masksToBounds() const { return m_masksToBounds; }
 
-    void setName(const String&);
-    const String& name() const { return m_name; }
-
     void setMaskLayer(LayerChromium*);
     LayerChromium* maskLayer() const { return m_maskLayer.get(); }
 
@@ -174,6 +171,7 @@
 
     void setDebugBorderColor(const Color&);
     void setDebugBorderWidth(float);
+    void setDebugName(const String&);
 
     virtual void pushPropertiesTo(CCLayerImpl*);
 
@@ -295,6 +293,7 @@
     bool m_backgroundCoversViewport;
     Color m_debugBorderColor;
     float m_debugBorderWidth;
+    String m_debugName;
     float m_opacity;
     FilterOperations m_filters;
     float m_anchorPointZ;
@@ -323,7 +322,7 @@
     IntRect m_drawableContentRect;
     float m_contentsScale;
 
-    String m_name;
+    bool m_pageScaleDirty;
 
     CCLayerAnimationDelegate* m_layerAnimationDelegate;
 };

Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp (109465 => 109466)


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp	2012-03-02 00:42:47 UTC (rev 109465)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp	2012-03-02 00:47:56 UTC (rev 109466)
@@ -266,7 +266,7 @@
 void CCLayerImpl::dumpLayer(TextStream& ts, int indent) const
 {
     writeIndent(ts, indent);
-    ts << layerTypeAsString() << "(" << m_name << ")\n";
+    ts << layerTypeAsString() << "(" << m_debugName << ")\n";
     dumpLayerProperties(ts, indent+2);
     if (m_replicaLayer) {
         writeIndent(ts, indent+2);

Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.h (109465 => 109466)


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.h	2012-03-02 00:42:47 UTC (rev 109465)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.h	2012-03-02 00:47:56 UTC (rev 109466)
@@ -135,9 +135,6 @@
     void setSublayerTransform(const TransformationMatrix&);
     const TransformationMatrix& sublayerTransform() const { return m_sublayerTransform; }
 
-    void setName(const String& name) { m_name = name; }
-    const String& name() const { return m_name; }
-
     // Debug layer border - visual effect only, do not change geometry/clipping/etc.
     void setDebugBorderColor(Color);
     Color debugBorderColor() const { return m_debugBorderColor; }
@@ -145,6 +142,10 @@
     float debugBorderWidth() const { return m_debugBorderWidth; }
     bool hasDebugBorders() const;
 
+    // Debug layer name.
+    void setDebugName(const String& debugName) { m_debugName = debugName; }
+    String debugName() const { return m_debugName; }
+
     CCRenderSurface* renderSurface() const { return m_renderSurface.get(); }
     void createRenderSurface();
     void clearRenderSurface() { m_renderSurface.clear(); }
@@ -294,8 +295,6 @@
     int m_debugID;
 #endif
 
-    String m_name;
-
     // Render surface this layer draws into. This is a surface that can belong
     // either to this layer (if m_targetRenderSurface == m_renderSurface) or
     // to an ancestor of this layer. The target render surface determines the
@@ -311,6 +310,9 @@
     Color m_debugBorderColor;
     float m_debugBorderWidth;
 
+    // Debug layer name.
+    String m_debugName;
+
     FilterOperations m_filters;
 
     TransformationMatrix m_drawTransform;

Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCRenderSurface.cpp (109465 => 109466)


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCRenderSurface.cpp	2012-03-02 00:42:47 UTC (rev 109465)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCRenderSurface.cpp	2012-03-02 00:47:56 UTC (rev 109466)
@@ -239,7 +239,7 @@
 
 String CCRenderSurface::name() const
 {
-    return String::format("RenderSurface(id=%i,owner=%s)", m_owningLayer->id(), m_owningLayer->name().utf8().data());
+    return String::format("RenderSurface(id=%i,owner=%s)", m_owningLayer->id(), m_owningLayer->debugName().utf8().data());
 }
 
 static void writeIndent(TextStream& ts, int indent)

Modified: trunk/Source/WebKit/chromium/ChangeLog (109465 => 109466)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-03-02 00:42:47 UTC (rev 109465)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-03-02 00:47:56 UTC (rev 109466)
@@ -1,3 +1,12 @@
+2012-03-01  James Robinson  <[email protected]>
+
+        [chromium] Rename LayerChromium::name to debugName to be more consistent with other debug properties, make threadsafe
+        https://bugs.webkit.org/show_bug.cgi?id=79723
+
+        Reviewed by Adrienne Walker.
+
+        * tests/LayerChromiumTest.cpp:
+
 2012-03-01  Dale Curtis  <[email protected]>
 
         Remove deprecated FFmpeg build directories.

Modified: trunk/Source/WebKit/chromium/tests/LayerChromiumTest.cpp (109465 => 109466)


--- trunk/Source/WebKit/chromium/tests/LayerChromiumTest.cpp	2012-03-02 00:42:47 UTC (rev 109465)
+++ trunk/Source/WebKit/chromium/tests/LayerChromiumTest.cpp	2012-03-02 00:47:56 UTC (rev 109466)
@@ -489,7 +489,6 @@
     EXPECT_FALSE(testLayer->needsDisplay());
 
     // Test properties that should not call needsDisplay and needsCommit when changed.
-    EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setName("Test Layer"));
     EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setVisibleLayerRect(IntRect(0, 0, 40, 50)));
     EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setUsesLayerClipping(true));
     EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(0, testLayer->setIsNonCompositedContent(true));
@@ -521,6 +520,7 @@
     EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(1, testLayer->setScrollPosition(IntPoint(10, 10)));
     EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(1, testLayer->setTransform(TransformationMatrix(0, 0, 0, 0, 0, 0)));
     EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(1, testLayer->setDoubleSided(false));
+    EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(1, testLayer->setDebugName("Test Layer"));
 
     // The above tests should not have caused a change to the needsDisplay flag.
     EXPECT_FALSE(testLayer->needsDisplay());
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to