OSDN Git Service

Merge WebKit at r84325: Initial merge by git.
[android-x86/external-webkit.git] / Source / WebCore / platform / graphics / chromium / GraphicsLayerChromium.cpp
index 5e8d148..2301ca3 100644 (file)
@@ -111,8 +111,20 @@ GraphicsLayerChromium::~GraphicsLayerChromium()
 
 void GraphicsLayerChromium::setName(const String& inName)
 {
+    m_nameBase = inName;
     String name = String::format("GraphicsLayerChromium(%p) GraphicsLayer(%p) ", m_layer.get(), this) + inName;
     GraphicsLayer::setName(name);
+    updateNames();
+}
+
+void GraphicsLayerChromium::updateNames()
+{
+    if (m_layer)
+        m_layer->setName("Layer for " + m_nameBase);
+    if (m_transformLayer)
+        m_transformLayer->setName("TransformLayer for " + m_nameBase);
+    if (m_contentsLayer)
+        m_contentsLayer->setName("ContentsLayer for " + m_nameBase);
 }
 
 bool GraphicsLayerChromium::setChildren(const Vector<GraphicsLayer*>& children)
@@ -263,6 +275,19 @@ void GraphicsLayerChromium::setContentsOpaque(bool opaque)
     updateContentsOpaque();
 }
 
+void GraphicsLayerChromium::setMaskLayer(GraphicsLayer* maskLayer)
+{
+    if (maskLayer == m_maskLayer)
+        return;
+
+    GraphicsLayer::setMaskLayer(maskLayer);
+
+    LayerChromium* maskLayerChromium = m_maskLayer ? m_maskLayer->platformLayer() : 0;
+    if (maskLayerChromium)
+        maskLayerChromium->setIsMask(true);
+    m_layer->setMaskLayer(maskLayerChromium);
+}
+
 void GraphicsLayerChromium::setBackfaceVisibility(bool visible)
 {
     if (m_backfaceVisibility == visible)
@@ -283,6 +308,15 @@ void GraphicsLayerChromium::setOpacity(float opacity)
     primaryLayer()->setOpacity(opacity);
 }
 
+void GraphicsLayerChromium::setReplicatedByLayer(GraphicsLayer* layer)
+{
+    GraphicsLayerChromium* layerChromium = static_cast<GraphicsLayerChromium*>(layer);
+    GraphicsLayer::setReplicatedByLayer(layer);
+    LayerChromium* replicaLayer = layerChromium ? layerChromium->primaryLayer() : 0;
+    primaryLayer()->setReplicaLayer(replicaLayer);
+}
+
+
 void GraphicsLayerChromium::setContentsNeedsDisplay()
 {
     if (m_contentsLayer)
@@ -494,6 +528,7 @@ void GraphicsLayerChromium::updateAnchorPoint()
 {
     primaryLayer()->setAnchorPoint(FloatPoint(m_anchorPoint.x(), m_anchorPoint.y()));
     primaryLayer()->setAnchorPointZ(m_anchorPoint.z());
+
     updateLayerPosition();
 }
 
@@ -569,6 +604,7 @@ void GraphicsLayerChromium::updateLayerPreserves3D()
     }
 
     updateOpacityOnLayer();
+    updateNames();
 }
 
 void GraphicsLayerChromium::updateLayerDrawsContent()
@@ -632,6 +668,7 @@ void GraphicsLayerChromium::setupContentsLayer(LayerChromium* contentsLayer)
         }
     }
     updateDebugIndicators();
+    updateNames();
 }
 
 // This function simply mimics the operation of GraphicsLayerCA