Title: [95406] trunk/Source/WebCore
Revision
95406
Author
[email protected]
Date
2011-09-19 02:19:33 -0700 (Mon, 19 Sep 2011)

Log Message

Re-name LayerChromium border functions to reflect that
they are only for debug use.
https://bugs.webkit.org/show_bug.cgi?id=68212

Patch by Shawn Singh <[email protected]> on 2011-09-19
Reviewed by James Robinson.

Code cleanup towards unit testing.

* platform/graphics/chromium/GraphicsLayerChromium.cpp:
(WebCore::GraphicsLayerChromium::clearBackgroundColor):
(WebCore::GraphicsLayerChromium::setDebugBackgroundColor):
(WebCore::GraphicsLayerChromium::setDebugBorder):
(WebCore::GraphicsLayerChromium::updateLayerBackgroundColor):
(WebCore::GraphicsLayerChromium::setupContentsLayer):
* platform/graphics/chromium/LayerChromium.cpp:
(WebCore::LayerChromium::setDebugBorderColor):
(WebCore::LayerChromium::setDebugBorderWidth):
* platform/graphics/chromium/LayerChromium.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (95405 => 95406)


--- trunk/Source/WebCore/ChangeLog	2011-09-19 08:17:43 UTC (rev 95405)
+++ trunk/Source/WebCore/ChangeLog	2011-09-19 09:19:33 UTC (rev 95406)
@@ -1,3 +1,24 @@
+2011-09-19  Shawn Singh  <[email protected]>
+
+        Re-name LayerChromium border functions to reflect that
+        they are only for debug use.
+        https://bugs.webkit.org/show_bug.cgi?id=68212
+
+        Reviewed by James Robinson.
+
+        Code cleanup towards unit testing.
+
+        * platform/graphics/chromium/GraphicsLayerChromium.cpp:
+        (WebCore::GraphicsLayerChromium::clearBackgroundColor):
+        (WebCore::GraphicsLayerChromium::setDebugBackgroundColor):
+        (WebCore::GraphicsLayerChromium::setDebugBorder):
+        (WebCore::GraphicsLayerChromium::updateLayerBackgroundColor):
+        (WebCore::GraphicsLayerChromium::setupContentsLayer):
+        * platform/graphics/chromium/LayerChromium.cpp:
+        (WebCore::LayerChromium::setDebugBorderColor):
+        (WebCore::LayerChromium::setDebugBorderWidth):
+        * platform/graphics/chromium/LayerChromium.h:
+
 2011-09-18  Ilya Tikhonovsky  <[email protected]>
 
         Web Inspector: requestAnimationFrame callbacks don't show up in the timeline panel.

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


--- trunk/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp	2011-09-19 08:17:43 UTC (rev 95405)
+++ trunk/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp	2011-09-19 09:19:33 UTC (rev 95406)
@@ -63,26 +63,6 @@
 
 namespace WebCore {
 
-static void setLayerBorderColor(LayerChromium& layer, const Color& color)
-{
-    layer.setBorderColor(color);
-}
-
-static void clearBorderColor(LayerChromium& layer)
-{
-    layer.setBorderColor(static_cast<RGBA32>(0));
-}
-
-static void setLayerBackgroundColor(LayerChromium& layer, const Color& color)
-{
-    layer.setBackgroundColor(color);
-}
-
-static void clearLayerBackgroundColor(LayerChromium& layer)
-{
-    layer.setBackgroundColor(static_cast<RGBA32>(0));
-}
-
 PassOwnPtr<GraphicsLayer> GraphicsLayer::create(GraphicsLayerClient* client)
 {
     return adoptPtr(new GraphicsLayerChromium(client));
@@ -271,7 +251,7 @@
         return;
 
     GraphicsLayer::clearBackgroundColor();
-    clearLayerBackgroundColor(*m_contentsLayer);
+    m_contentsLayer->setBackgroundColor(static_cast<RGBA32>(0));
 }
 
 void GraphicsLayerChromium::setContentsOpaque(bool opaque)
@@ -449,19 +429,19 @@
 void GraphicsLayerChromium::setDebugBackgroundColor(const Color& color)
 {
     if (color.isValid())
-        setLayerBackgroundColor(*m_layer, color);
+        m_layer->setBackgroundColor(color);
     else
-        clearLayerBackgroundColor(*m_layer);
+        m_layer->setBackgroundColor(static_cast<RGBA32>(0));
 }
 
 void GraphicsLayerChromium::setDebugBorder(const Color& color, float borderWidth)
 {
     if (color.isValid()) {
-        setLayerBorderColor(*m_layer, color);
-        m_layer->setBorderWidth(borderWidth);
+        m_layer->setDebugBorderColor(color);
+        m_layer->setDebugBorderWidth(borderWidth);
     } else {
-        clearBorderColor(*m_layer);
-        m_layer->setBorderWidth(0);
+        m_layer->setDebugBorderColor(static_cast<RGBA32>(0));
+        m_layer->setDebugBorderWidth(0);
     }
 }
 
@@ -631,9 +611,9 @@
 
     // We never create the contents layer just for background color yet.
     if (m_backgroundColorSet)
-        setLayerBackgroundColor(*m_contentsLayer, m_backgroundColor);
+        m_contentsLayer->setBackgroundColor(m_backgroundColor);
     else
-        clearLayerBackgroundColor(*m_contentsLayer);
+        m_contentsLayer->setBackgroundColor(static_cast<RGBA32>(0));
 }
 
 void GraphicsLayerChromium::updateContentsVideo()
@@ -672,8 +652,8 @@
         updateContentsRect();
 
         if (showDebugBorders()) {
-            setLayerBorderColor(*m_contentsLayer, Color(0, 0, 128, 180));
-            m_contentsLayer->setBorderWidth(1);
+            m_contentsLayer->setDebugBorderColor(Color(0, 0, 128, 180));
+            m_contentsLayer->setDebugBorderWidth(1);
         }
     }
     updateDebugIndicators();

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


--- trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp	2011-09-19 08:17:43 UTC (rev 95405)
+++ trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp	2011-09-19 09:19:33 UTC (rev 95406)
@@ -321,13 +321,13 @@
     return CCLayerImpl::create(m_layerId);
 }
 
-void LayerChromium::setBorderColor(const Color& color)
+void LayerChromium::setDebugBorderColor(const Color& color)
 {
     m_debugBorderColor = color;
     setNeedsCommit();
 }
 
-void LayerChromium::setBorderWidth(float width)
+void LayerChromium::setDebugBorderWidth(float width)
 {
     m_debugBorderWidth = width;
     setNeedsCommit();

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


--- trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.h	2011-09-19 08:17:43 UTC (rev 95405)
+++ trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.h	2011-09-19 09:19:33 UTC (rev 95406)
@@ -176,13 +176,11 @@
     virtual void bindContentsTexture() { }
     virtual void protectVisibleTileTextures() { }
 
-    // These exists just for debugging (via drawDebugBorder()).
-    void setBorderColor(const Color&);
-
+    // These exist just for debugging (via drawDebugBorder()).
+    void setDebugBorderColor(const Color&);
+    void setDebugBorderWidth(float);
     void drawDebugBorder();
 
-    void setBorderWidth(float);
-
     virtual void pushPropertiesTo(CCLayerImpl*);
 
     typedef ProgramBinding<VertexShaderPos, FragmentShaderColor> BorderProgram;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to