void GraphicsLayer::dumpProperties(TextStream& ts, int indent, LayerTreeAsTextBehavior behavior) const { if (m_position != FloatPoint()) { writeIndent(ts, indent + 1); ts << "(position " << m_position.x() << " " << m_position.y() << ")\n"; } if (m_boundsOrigin != FloatPoint()) { writeIndent(ts, indent + 1); ts << "(bounds origin " << m_boundsOrigin.x() << " " << m_boundsOrigin.y() << ")\n"; } if (m_anchorPoint != FloatPoint3D(0.5f, 0.5f, 0)) { writeIndent(ts, indent + 1); ts << "(anchor " << m_anchorPoint.x() << " " << m_anchorPoint.y() << ")\n"; } if (m_size != IntSize()) { writeIndent(ts, indent + 1); ts << "(bounds " << m_size.width() << " " << m_size.height() << ")\n"; } if (m_opacity != 1) { writeIndent(ts, indent + 1); ts << "(opacity " << m_opacity << ")\n"; } #if ENABLE(CSS_COMPOSITING) if (m_blendMode != BlendModeNormal) { writeIndent(ts, indent + 1); ts << "(blendMode " << compositeOperatorName(CompositeSourceOver, m_blendMode) << ")\n"; } #endif if (m_usingTiledBacking) { writeIndent(ts, indent + 1); ts << "(usingTiledLayer " << m_usingTiledBacking << ")\n"; } bool needsIOSDumpRenderTreeMainFrameRenderViewLayerIsAlwaysOpaqueHack = m_client.needsIOSDumpRenderTreeMainFrameRenderViewLayerIsAlwaysOpaqueHack(*this); if (m_contentsOpaque || needsIOSDumpRenderTreeMainFrameRenderViewLayerIsAlwaysOpaqueHack) { writeIndent(ts, indent + 1); ts << "(contentsOpaque " << (m_contentsOpaque || needsIOSDumpRenderTreeMainFrameRenderViewLayerIsAlwaysOpaqueHack) << ")\n"; } if (m_preserves3D) { writeIndent(ts, indent + 1); ts << "(preserves3D " << m_preserves3D << ")\n"; } if (m_drawsContent && m_client.shouldDumpPropertyForLayer(this, "drawsContent")) { writeIndent(ts, indent + 1); ts << "(drawsContent " << m_drawsContent << ")\n"; } if (!m_contentsVisible) { writeIndent(ts, indent + 1); ts << "(contentsVisible " << m_contentsVisible << ")\n"; } if (!m_backfaceVisibility) { writeIndent(ts, indent + 1); ts << "(backfaceVisibility " << (m_backfaceVisibility ? "visible" : "hidden") << ")\n"; } if (behavior & LayerTreeAsTextDebug) { writeIndent(ts, indent + 1); ts << "(primary-layer-id " << primaryLayerID() << ")\n"; writeIndent(ts, indent + 1); ts << "(client " << static_cast<void*>(&m_client) << ")\n"; } if (m_backgroundColor.isValid() && m_client.shouldDumpPropertyForLayer(this, "backgroundColor")) { writeIndent(ts, indent + 1); ts << "(backgroundColor " << m_backgroundColor.nameForRenderTreeAsText() << ")\n"; } if (!m_transform.isIdentity()) { writeIndent(ts, indent + 1); ts << "(transform "; ts << "[" << m_transform.m11() << " " << m_transform.m12() << " " << m_transform.m13() << " " << m_transform.m14() << "] "; ts << "[" << m_transform.m21() << " " << m_transform.m22() << " " << m_transform.m23() << " " << m_transform.m24() << "] "; ts << "[" << m_transform.m31() << " " << m_transform.m32() << " " << m_transform.m33() << " " << m_transform.m34() << "] "; ts << "[" << m_transform.m41() << " " << m_transform.m42() << " " << m_transform.m43() << " " << m_transform.m44() << "])\n"; } // Avoid dumping the sublayer transform on the root layer, because it's used for geometry flipping, whose behavior // differs between platforms. if (parent() && !m_childrenTransform.isIdentity()) { writeIndent(ts, indent + 1); ts << "(childrenTransform "; ts << "[" << m_childrenTransform.m11() << " " << m_childrenTransform.m12() << " " << m_childrenTransform.m13() << " " << m_childrenTransform.m14() << "] "; ts << "[" << m_childrenTransform.m21() << " " << m_childrenTransform.m22() << " " << m_childrenTransform.m23() << " " << m_childrenTransform.m24() << "] "; ts << "[" << m_childrenTransform.m31() << " " << m_childrenTransform.m32() << " " << m_childrenTransform.m33() << " " << m_childrenTransform.m34() << "] "; ts << "[" << m_childrenTransform.m41() << " " << m_childrenTransform.m42() << " " << m_childrenTransform.m43() << " " << m_childrenTransform.m44() << "])\n"; } if (m_replicaLayer) { writeIndent(ts, indent + 1); ts << "(replica layer"; if (behavior & LayerTreeAsTextDebug) ts << " " << m_replicaLayer; ts << ")\n"; m_replicaLayer->dumpLayer(ts, indent + 2, behavior); } if (m_replicatedLayer) { writeIndent(ts, indent + 1); ts << "(replicated layer"; if (behavior & LayerTreeAsTextDebug) ts << " " << m_replicatedLayer; ts << ")\n"; } if (behavior & LayerTreeAsTextIncludeRepaintRects && repaintRectMap().contains(this) && !repaintRectMap().get(this).isEmpty() && m_client.shouldDumpPropertyForLayer(this, "repaintRects")) { writeIndent(ts, indent + 1); ts << "(repaint rects\n"; for (size_t i = 0; i < repaintRectMap().get(this).size(); ++i) { if (repaintRectMap().get(this)[i].isEmpty()) continue; writeIndent(ts, indent + 2); ts << "(rect "; ts << repaintRectMap().get(this)[i].x() << " "; ts << repaintRectMap().get(this)[i].y() << " "; ts << repaintRectMap().get(this)[i].width() << " "; ts << repaintRectMap().get(this)[i].height(); ts << ")\n"; } writeIndent(ts, indent + 1); ts << ")\n"; } if (behavior & LayerTreeAsTextIncludePaintingPhases && paintingPhase()) { writeIndent(ts, indent + 1); ts << "(paintingPhases\n"; if (paintingPhase() & GraphicsLayerPaintBackground) { writeIndent(ts, indent + 2); ts << "GraphicsLayerPaintBackground\n"; } if (paintingPhase() & GraphicsLayerPaintForeground) { writeIndent(ts, indent + 2); ts << "GraphicsLayerPaintForeground\n"; } if (paintingPhase() & GraphicsLayerPaintMask) { writeIndent(ts, indent + 2); ts << "GraphicsLayerPaintMask\n"; } if (paintingPhase() & GraphicsLayerPaintChildClippingMask) { writeIndent(ts, indent + 2); ts << "GraphicsLayerPaintChildClippingMask\n"; } if (paintingPhase() & GraphicsLayerPaintOverflowContents) { writeIndent(ts, indent + 2); ts << "GraphicsLayerPaintOverflowContents\n"; } if (paintingPhase() & GraphicsLayerPaintCompositedScroll) { writeIndent(ts, indent + 2); ts << "GraphicsLayerPaintCompositedScroll\n"; } writeIndent(ts, indent + 1); ts << ")\n"; } dumpAdditionalProperties(ts, indent, behavior); if (m_children.size()) { TextStream childrenStream; unsigned totalChildCount = 0; dumpChildren(childrenStream, m_children, totalChildCount, indent, behavior); writeIndent(childrenStream, indent + 1); childrenStream << ")\n"; if (totalChildCount) { writeIndent(ts, indent + 1); ts << "(children " << totalChildCount << "\n"; ts << childrenStream.release(); } } }
void GraphicsLayer::dumpProperties(TextStream& ts, int indent, LayerTreeAsTextBehavior behavior) const { if (m_position != FloatPoint()) { writeIndent(ts, indent + 1); ts << "(position " << m_position.x() << " " << m_position.y() << ")\n"; } if (m_boundsOrigin != FloatPoint()) { writeIndent(ts, indent + 1); ts << "(bounds origin " << m_boundsOrigin.x() << " " << m_boundsOrigin.y() << ")\n"; } if (m_anchorPoint != FloatPoint3D(0.5f, 0.5f, 0)) { writeIndent(ts, indent + 1); ts << "(anchor " << m_anchorPoint.x() << " " << m_anchorPoint.y() << ")\n"; } if (m_size != IntSize()) { writeIndent(ts, indent + 1); ts << "(bounds " << m_size.width() << " " << m_size.height() << ")\n"; } if (m_opacity != 1) { writeIndent(ts, indent + 1); ts << "(opacity " << m_opacity << ")\n"; } if (m_usingTiledLayer) { writeIndent(ts, indent + 1); ts << "(usingTiledLayer " << m_usingTiledLayer << ")\n"; } if (m_preserves3D) { writeIndent(ts, indent + 1); ts << "(preserves3D " << m_preserves3D << ")\n"; } if (m_drawsContent) { writeIndent(ts, indent + 1); ts << "(drawsContent " << m_drawsContent << ")\n"; } if (!m_contentsVisible) { writeIndent(ts, indent + 1); ts << "(contentsVisible " << m_contentsVisible << ")\n"; } if (!m_backfaceVisibility) { writeIndent(ts, indent + 1); ts << "(backfaceVisibility " << (m_backfaceVisibility ? "visible" : "hidden") << ")\n"; } if (behavior & LayerTreeAsTextDebug) { writeIndent(ts, indent + 1); ts << "("; if (m_client) ts << "client " << static_cast<void*>(m_client); else ts << "no client"; ts << ")\n"; } if (m_backgroundColorSet) { writeIndent(ts, indent + 1); ts << "(backgroundColor " << m_backgroundColor.nameForRenderTreeAsText() << ")\n"; } if (!m_transform.isIdentity()) { writeIndent(ts, indent + 1); ts << "(transform "; ts << "[" << m_transform.m11() << " " << m_transform.m12() << " " << m_transform.m13() << " " << m_transform.m14() << "] "; ts << "[" << m_transform.m21() << " " << m_transform.m22() << " " << m_transform.m23() << " " << m_transform.m24() << "] "; ts << "[" << m_transform.m31() << " " << m_transform.m32() << " " << m_transform.m33() << " " << m_transform.m34() << "] "; ts << "[" << m_transform.m41() << " " << m_transform.m42() << " " << m_transform.m43() << " " << m_transform.m44() << "])\n"; } // Avoid dumping the sublayer transform on the root layer, because it's used for geometry flipping, whose behavior // differs between platforms. if (parent() && !m_childrenTransform.isIdentity()) { writeIndent(ts, indent + 1); ts << "(childrenTransform "; ts << "[" << m_childrenTransform.m11() << " " << m_childrenTransform.m12() << " " << m_childrenTransform.m13() << " " << m_childrenTransform.m14() << "] "; ts << "[" << m_childrenTransform.m21() << " " << m_childrenTransform.m22() << " " << m_childrenTransform.m23() << " " << m_childrenTransform.m24() << "] "; ts << "[" << m_childrenTransform.m31() << " " << m_childrenTransform.m32() << " " << m_childrenTransform.m33() << " " << m_childrenTransform.m34() << "] "; ts << "[" << m_childrenTransform.m41() << " " << m_childrenTransform.m42() << " " << m_childrenTransform.m43() << " " << m_childrenTransform.m44() << "])\n"; } if (m_replicaLayer) { writeIndent(ts, indent + 1); ts << "(replica layer"; if (behavior & LayerTreeAsTextDebug) ts << " " << m_replicaLayer; ts << ")\n"; m_replicaLayer->dumpLayer(ts, indent + 2, behavior); } if (m_replicatedLayer) { writeIndent(ts, indent + 1); ts << "(replicated layer"; if (behavior & LayerTreeAsTextDebug) ts << " " << m_replicatedLayer; ts << ")\n"; } if (behavior & LayerTreeAsTextIncludeRepaintRects && repaintRectMap().contains(this) && !repaintRectMap().get(this).isEmpty()) { writeIndent(ts, indent + 1); ts << "(repaint rects\n"; for (size_t i = 0; i < repaintRectMap().get(this).size(); ++i) { if (repaintRectMap().get(this)[i].isEmpty()) continue; writeIndent(ts, indent + 2); ts << "(rect "; ts << repaintRectMap().get(this)[i].x() << " "; ts << repaintRectMap().get(this)[i].y() << " "; ts << repaintRectMap().get(this)[i].width() << " "; ts << repaintRectMap().get(this)[i].height(); ts << ")\n"; } writeIndent(ts, indent + 1); ts << ")\n"; } dumpAdditionalProperties(ts, indent, behavior); if (m_children.size()) { writeIndent(ts, indent + 1); ts << "(children " << m_children.size() << "\n"; unsigned i; for (i = 0; i < m_children.size(); i++) m_children[i]->dumpLayer(ts, indent + 2, behavior); writeIndent(ts, indent + 1); ts << ")\n"; } }
void GraphicsLayer::dumpProperties(TextStream& ts, int indent, LayerTreeAsTextBehavior behavior) const { if (m_position != FloatPoint()) { writeIndent(ts, indent + 1); ts << "(position " << m_position.x() << " " << m_position.y() << ")\n"; } if (m_boundsOrigin != FloatPoint()) { writeIndent(ts, indent + 1); ts << "(bounds origin " << m_boundsOrigin.x() << " " << m_boundsOrigin.y() << ")\n"; } if (m_anchorPoint != FloatPoint3D(0.5f, 0.5f, 0)) { writeIndent(ts, indent + 1); ts << "(anchor " << m_anchorPoint.x() << " " << m_anchorPoint.y() << ")\n"; } if (m_size != IntSize()) { writeIndent(ts, indent + 1); ts << "(bounds " << m_size.width() << " " << m_size.height() << ")\n"; } if (m_opacity != 1) { writeIndent(ts, indent + 1); ts << "(opacity " << m_opacity << ")\n"; } if (m_usingTiledBacking) { writeIndent(ts, indent + 1); ts << "(usingTiledLayer " << m_usingTiledBacking << ")\n"; } if (m_contentsOpaque) { writeIndent(ts, indent + 1); ts << "(contentsOpaque " << m_contentsOpaque << ")\n"; } if (m_preserves3D) { writeIndent(ts, indent + 1); ts << "(preserves3D " << m_preserves3D << ")\n"; } if (m_drawsContent && m_client->shouldDumpPropertyForLayer(this, "drawsContent")) { writeIndent(ts, indent + 1); ts << "(drawsContent " << m_drawsContent << ")\n"; } if (!m_contentsVisible) { writeIndent(ts, indent + 1); ts << "(contentsVisible " << m_contentsVisible << ")\n"; } if (!m_backfaceVisibility) { writeIndent(ts, indent + 1); ts << "(backfaceVisibility " << (m_backfaceVisibility ? "visible" : "hidden") << ")\n"; } if (behavior & LayerTreeAsTextDebug) { writeIndent(ts, indent + 1); ts << "("; if (m_client) ts << "client " << static_cast<void*>(m_client); else ts << "no client"; ts << ")\n"; } if (m_backgroundColor.isValid() && m_client->shouldDumpPropertyForLayer(this, "backgroundColor")) { writeIndent(ts, indent + 1); ts << "(backgroundColor " << m_backgroundColor.nameForRenderTreeAsText() << ")\n"; } if (!m_transform.isIdentity()) { writeIndent(ts, indent + 1); ts << "(transform "; ts << "[" << m_transform.m11() << " " << m_transform.m12() << " " << m_transform.m13() << " " << m_transform.m14() << "] "; ts << "[" << m_transform.m21() << " " << m_transform.m22() << " " << m_transform.m23() << " " << m_transform.m24() << "] "; ts << "[" << m_transform.m31() << " " << m_transform.m32() << " " << m_transform.m33() << " " << m_transform.m34() << "] "; ts << "[" << m_transform.m41() << " " << m_transform.m42() << " " << m_transform.m43() << " " << m_transform.m44() << "])\n"; } // Avoid dumping the sublayer transform on the root layer, because it's used for geometry flipping, whose behavior // differs between platforms. if (parent() && !m_childrenTransform.isIdentity()) { writeIndent(ts, indent + 1); ts << "(childrenTransform "; ts << "[" << m_childrenTransform.m11() << " " << m_childrenTransform.m12() << " " << m_childrenTransform.m13() << " " << m_childrenTransform.m14() << "] "; ts << "[" << m_childrenTransform.m21() << " " << m_childrenTransform.m22() << " " << m_childrenTransform.m23() << " " << m_childrenTransform.m24() << "] "; ts << "[" << m_childrenTransform.m31() << " " << m_childrenTransform.m32() << " " << m_childrenTransform.m33() << " " << m_childrenTransform.m34() << "] "; ts << "[" << m_childrenTransform.m41() << " " << m_childrenTransform.m42() << " " << m_childrenTransform.m43() << " " << m_childrenTransform.m44() << "])\n"; } if (m_replicaLayer) { writeIndent(ts, indent + 1); ts << "(replica layer"; if (behavior & LayerTreeAsTextDebug) ts << " " << m_replicaLayer; ts << ")\n"; m_replicaLayer->dumpLayer(ts, indent + 2, behavior); } if (m_replicatedLayer) { writeIndent(ts, indent + 1); ts << "(replicated layer"; if (behavior & LayerTreeAsTextDebug) ts << " " << m_replicatedLayer; ts << ")\n"; } if (behavior & LayerTreeAsTextIncludeRepaintRects && repaintRectMap().contains(this) && !repaintRectMap().get(this).isEmpty() && m_client->shouldDumpPropertyForLayer(this, "repaintRects")) { writeIndent(ts, indent + 1); ts << "(repaint rects\n"; for (size_t i = 0; i < repaintRectMap().get(this).size(); ++i) { if (repaintRectMap().get(this)[i].isEmpty()) continue; writeIndent(ts, indent + 2); ts << "(rect "; ts << repaintRectMap().get(this)[i].x() << " "; ts << repaintRectMap().get(this)[i].y() << " "; ts << repaintRectMap().get(this)[i].width() << " "; ts << repaintRectMap().get(this)[i].height(); ts << ")\n"; } writeIndent(ts, indent + 1); ts << ")\n"; } if (behavior & LayerTreeAsTextIncludePaintingPhases && paintingPhase()) { writeIndent(ts, indent + 1); ts << "(paintingPhases\n"; if (paintingPhase() & GraphicsLayerPaintBackground) { writeIndent(ts, indent + 2); ts << "GraphicsLayerPaintBackground\n"; } if (paintingPhase() & GraphicsLayerPaintForeground) { writeIndent(ts, indent + 2); ts << "GraphicsLayerPaintForeground\n"; } if (paintingPhase() & GraphicsLayerPaintMask) { writeIndent(ts, indent + 2); ts << "GraphicsLayerPaintMask\n"; } if (paintingPhase() & GraphicsLayerPaintOverflowContents) { writeIndent(ts, indent + 2); ts << "GraphicsLayerPaintOverflowContents\n"; } if (paintingPhase() & GraphicsLayerPaintCompositedScroll) { writeIndent(ts, indent + 2); ts << "GraphicsLayerPaintCompositedScroll\n"; } writeIndent(ts, indent + 1); ts << ")\n"; } dumpAdditionalProperties(ts, indent, behavior); if (m_children.size()) { TextStream childrenStream; unsigned totalChildCount = m_children.size(); for (size_t childIndex = 0; childIndex < m_children.size(); childIndex++) { GraphicsLayer* child = m_children[childIndex]; if (!m_client->shouldSkipLayerInDump(child)) { child->dumpLayer(childrenStream, indent + 2, behavior); continue; } const Vector<GraphicsLayer*>& grandChildren = child->children(); totalChildCount += grandChildren.size() - 1; for (size_t grandChildIndex = 0; grandChildIndex < grandChildren.size(); grandChildIndex++) grandChildren[grandChildIndex]->dumpLayer(childrenStream, indent + 2, behavior); } writeIndent(childrenStream, indent + 1); childrenStream << ")\n"; if (totalChildCount) { writeIndent(ts, indent + 1); ts << "(children " << totalChildCount << "\n"; ts << childrenStream.release(); } } }