Index: Source/core/rendering/RenderLayerCompositor.cpp |
diff --git a/Source/core/rendering/RenderLayerCompositor.cpp b/Source/core/rendering/RenderLayerCompositor.cpp |
index ecbfcb4f52ca5614b3cad2546be4a624b75e58bb..e9a9c75365c3686646d82722007fe01f6dbfaa28 100644 |
--- a/Source/core/rendering/RenderLayerCompositor.cpp |
+++ b/Source/core/rendering/RenderLayerCompositor.cpp |
@@ -2221,9 +2221,6 @@ GraphicsLayer* RenderLayerCompositor::updateLayerForTopOverhangArea(bool wantsLa |
if (!m_layerForTopOverhangArea) { |
m_layerForTopOverhangArea = GraphicsLayer::create(graphicsLayerFactory(), this); |
-#ifndef NDEBUG |
- m_layerForTopOverhangArea->setName("top overhang area"); |
-#endif |
m_scrollLayer->addChildBelow(m_layerForTopOverhangArea.get(), m_rootContentLayer.get()); |
} |
@@ -2245,9 +2242,6 @@ GraphicsLayer* RenderLayerCompositor::updateLayerForBottomOverhangArea(bool want |
if (!m_layerForBottomOverhangArea) { |
m_layerForBottomOverhangArea = GraphicsLayer::create(graphicsLayerFactory(), this); |
-#ifndef NDEBUG |
- m_layerForBottomOverhangArea->setName("bottom overhang area"); |
-#endif |
m_scrollLayer->addChildBelow(m_layerForBottomOverhangArea.get(), m_rootContentLayer.get()); |
} |
@@ -2282,9 +2276,6 @@ void RenderLayerCompositor::updateOverflowControlsLayers() |
if (requiresOverhangAreasLayer()) { |
if (!m_layerForOverhangAreas) { |
m_layerForOverhangAreas = GraphicsLayer::create(graphicsLayerFactory(), this); |
-#ifndef NDEBUG |
- m_layerForOverhangAreas->setName("overhang areas"); |
-#endif |
m_layerForOverhangAreas->setDrawsContent(false); |
m_layerForOverhangAreas->setSize(m_renderView->frameView()->frameRect().size()); |
@@ -2300,9 +2291,6 @@ void RenderLayerCompositor::updateOverflowControlsLayers() |
if (requiresContentShadowLayer()) { |
if (!m_contentShadowLayer) { |
m_contentShadowLayer = GraphicsLayer::create(graphicsLayerFactory(), this); |
-#ifndef NDEBUG |
- m_contentShadowLayer->setName("content shadow"); |
-#endif |
m_contentShadowLayer->setSize(m_rootContentLayer->size()); |
m_contentShadowLayer->setPosition(m_rootContentLayer->position()); |
ScrollbarTheme::theme()->setUpContentShadowLayer(m_contentShadowLayer.get()); |
@@ -2319,9 +2307,6 @@ void RenderLayerCompositor::updateOverflowControlsLayers() |
if (!m_layerForHorizontalScrollbar) { |
m_layerForHorizontalScrollbar = GraphicsLayer::create(graphicsLayerFactory(), this); |
m_layerForHorizontalScrollbar->setShowDebugBorder(m_showDebugBorders); |
-#ifndef NDEBUG |
- m_layerForHorizontalScrollbar->setName("horizontal scrollbar"); |
-#endif |
m_overflowControlsHostLayer->addChild(m_layerForHorizontalScrollbar.get()); |
if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) |
@@ -2339,9 +2324,6 @@ void RenderLayerCompositor::updateOverflowControlsLayers() |
if (!m_layerForVerticalScrollbar) { |
m_layerForVerticalScrollbar = GraphicsLayer::create(graphicsLayerFactory(), this); |
m_layerForVerticalScrollbar->setShowDebugBorder(m_showDebugBorders); |
-#ifndef NDEBUG |
- m_layerForVerticalScrollbar->setName("vertical scrollbar"); |
-#endif |
m_overflowControlsHostLayer->addChild(m_layerForVerticalScrollbar.get()); |
if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) |
@@ -2359,9 +2341,6 @@ void RenderLayerCompositor::updateOverflowControlsLayers() |
if (!m_layerForScrollCorner) { |
m_layerForScrollCorner = GraphicsLayer::create(graphicsLayerFactory(), this); |
m_layerForScrollCorner->setShowDebugBorder(m_showDebugBorders); |
-#ifndef NDEBUG |
- m_layerForScrollCorner->setName("scroll corner"); |
-#endif |
m_overflowControlsHostLayer->addChild(m_layerForScrollCorner.get()); |
} |
} else if (m_layerForScrollCorner) { |
@@ -2380,9 +2359,6 @@ void RenderLayerCompositor::ensureRootLayer() |
if (!m_rootContentLayer) { |
m_rootContentLayer = GraphicsLayer::create(graphicsLayerFactory(), this); |
-#ifndef NDEBUG |
- m_rootContentLayer->setName("content root"); |
-#endif |
IntRect overflowRect = m_renderView->pixelSnappedLayoutOverflowRect(); |
m_rootContentLayer->setSize(FloatSize(overflowRect.maxX(), overflowRect.maxY())); |
m_rootContentLayer->setPosition(FloatPoint()); |
@@ -2397,21 +2373,12 @@ void RenderLayerCompositor::ensureRootLayer() |
// Create a layer to host the clipping layer and the overflow controls layers. |
m_overflowControlsHostLayer = GraphicsLayer::create(graphicsLayerFactory(), this); |
-#ifndef NDEBUG |
- m_overflowControlsHostLayer->setName("overflow controls host"); |
-#endif |
// Create a clipping layer if this is an iframe |
m_clipLayer = GraphicsLayer::create(graphicsLayerFactory(), this); |
-#ifndef NDEBUG |
- m_clipLayer->setName("frame clipping"); |
-#endif |
m_clipLayer->setMasksToBounds(true); |
m_scrollLayer = GraphicsLayer::create(graphicsLayerFactory(), this); |
-#ifndef NDEBUG |
- m_scrollLayer->setName("frame scrolling"); |
-#endif |
if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) |
scrollingCoordinator->setLayerIsContainerForFixedPositionLayers(m_scrollLayer.get(), true); |
@@ -2757,4 +2724,36 @@ void RenderLayerCompositor::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo |
#endif |
} |
+String RenderLayerCompositor::debugName(const GraphicsLayer* graphicsLayer) |
+{ |
+ String name; |
+ if (graphicsLayer == m_rootContentLayer.get()) { |
+ name = "Content Root Layer"; |
+#if ENABLE(RUBBER_BANDING) |
+ } else if (graphicsLayer == m_layerForTopOverhangArea.get()) { |
+ name = "Top Overhang Area Layer"; |
+ } else if (graphicsLayer == m_layerForBottomOverhangArea.get()) { |
+ name = "Bottom Overhang Area Layer"; |
+ } else if (graphicsLayer == m_layerForOverhangAreas.get()) { |
+ name = "Overhang Areas Layer"; |
+ } else if (graphicsLayer == m_contentShadowLayer.get()) { |
+ name = "Content Shadow Layer"; |
+#endif |
+ } else if (graphicsLayer == m_overflowControlsHostLayer.get()) { |
+ name = "Overflow Controls Host Layer"; |
+ } else if (graphicsLayer == m_layerForHorizontalScrollbar.get()) { |
+ name = "Horizontal Scrollbar Layer"; |
+ } else if (graphicsLayer == m_layerForVerticalScrollbar.get()) { |
+ name = "Vertical Scrollbar Layer"; |
+ } else if (graphicsLayer == m_layerForScrollCorner.get()) { |
+ name = "Scroll Corner Layer"; |
+ } else if (graphicsLayer == m_clipLayer.get()) { |
+ name = "Frame Clipping Layer"; |
+ } else if (graphicsLayer == m_scrollLayer.get()) { |
+ name = "Frame Scrolling Layer"; |
+ } |
enne (OOO)
2013/07/30 17:31:05
Can you add an else ASSERT_NOT_REACHED here and in
qiankun
2013/07/31 11:16:28
Done.
|
+ |
+ return name; |
+} |
+ |
} // namespace WebCore |