Commit 8b603f6c authored by szager@chromium.org's avatar szager@chromium.org

Don't trace LayoutObject geometry prior to running layout.

BUG=527138
R=benjhayden@chromium.org,dsinclair@chromium.org

Review URL: https://codereview.chromium.org/1305043007

git-svn-id: svn://svn.chromium.org/blink/trunk@201825 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent a7868784
...@@ -1023,13 +1023,10 @@ void FrameView::layout() ...@@ -1023,13 +1023,10 @@ void FrameView::layout()
} }
TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(TRACE_DISABLED_BY_DEFAULT("blink.debug.layout"), "LayoutTree", TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(TRACE_DISABLED_BY_DEFAULT("blink.debug.layout"), "LayoutTree",
this, TracedLayoutObject::create(*layoutView())); this, TracedLayoutObject::create(*layoutView(), false));
performLayout(inSubtreeLayout); performLayout(inSubtreeLayout);
TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(TRACE_DISABLED_BY_DEFAULT("blink.debug.layout"), "LayoutTree",
this, TracedLayoutObject::create(*layoutView()));
ASSERT(m_layoutSubtreeRootList.isEmpty()); ASSERT(m_layoutSubtreeRootList.isEmpty());
} // Reset m_layoutSchedulingEnabled to its previous value. } // Reset m_layoutSchedulingEnabled to its previous value.
...@@ -1041,6 +1038,9 @@ void FrameView::layout() ...@@ -1041,6 +1038,9 @@ void FrameView::layout()
// FIXME: Could find the common ancestor layer of all dirty subtrees and mark from there. crbug.com/462719 // FIXME: Could find the common ancestor layer of all dirty subtrees and mark from there. crbug.com/462719
layoutView()->enclosingLayer()->updateLayerPositionsAfterLayout(); layoutView()->enclosingLayer()->updateLayerPositionsAfterLayout();
TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(TRACE_DISABLED_BY_DEFAULT("blink.debug.layout"), "LayoutTree",
this, TracedLayoutObject::create(*layoutView(), true));
layoutView()->compositor()->didLayout(); layoutView()->compositor()->didLayout();
m_layoutCount++; m_layoutCount++;
......
...@@ -13,9 +13,9 @@ ...@@ -13,9 +13,9 @@
namespace blink { namespace blink {
PassRefPtr<TraceEvent::ConvertableToTraceFormat> TracedLayoutObject::create(const LayoutView& view) PassRefPtr<TraceEvent::ConvertableToTraceFormat> TracedLayoutObject::create(const LayoutView& view, bool traceGeometry)
{ {
return adoptRef(new TracedLayoutObject(view)); return adoptRef(new TracedLayoutObject(view, traceGeometry));
} }
String TracedLayoutObject::asTraceFormat() const String TracedLayoutObject::asTraceFormat() const
...@@ -26,7 +26,7 @@ String TracedLayoutObject::asTraceFormat() const ...@@ -26,7 +26,7 @@ String TracedLayoutObject::asTraceFormat() const
return builder.toString(); return builder.toString();
} }
TracedLayoutObject::TracedLayoutObject(const LayoutObject& object) TracedLayoutObject::TracedLayoutObject(const LayoutObject& object, bool traceGeometry)
: m_address((unsigned long) &object) : m_address((unsigned long) &object)
, m_isAnonymous(object.isAnonymous()) , m_isAnonymous(object.isAnonymous())
, m_isPositioned(object.isOutOfFlowPositioned()) , m_isPositioned(object.isOutOfFlowPositioned())
...@@ -39,7 +39,7 @@ TracedLayoutObject::TracedLayoutObject(const LayoutObject& object) ...@@ -39,7 +39,7 @@ TracedLayoutObject::TracedLayoutObject(const LayoutObject& object)
, m_posChildNeeds(object.posChildNeedsLayout()) , m_posChildNeeds(object.posChildNeedsLayout())
, m_isTableCell(object.isTableCell()) , m_isTableCell(object.isTableCell())
, m_name(String(object.name()).isolatedCopy()) , m_name(String(object.name()).isolatedCopy())
, m_absRect(object.absoluteBoundingBoxRect()) , m_absRect(traceGeometry ? object.absoluteBoundingBoxRect() : IntRect())
{ {
if (Node* node = object.node()) { if (Node* node = object.node()) {
m_tag = String(node->nodeName()).isolatedCopy(); m_tag = String(node->nodeName()).isolatedCopy();
...@@ -58,12 +58,14 @@ TracedLayoutObject::TracedLayoutObject(const LayoutObject& object) ...@@ -58,12 +58,14 @@ TracedLayoutObject::TracedLayoutObject(const LayoutObject& object)
// FIXME: When the fixmes in LayoutTreeAsText::writeLayoutObject() are // FIXME: When the fixmes in LayoutTreeAsText::writeLayoutObject() are
// fixed, deduplicate it with this. // fixed, deduplicate it with this.
if (object.isText()) { if (traceGeometry) {
m_rect = LayoutRect(toLayoutText(object).linesBoundingBox()); if (object.isText()) {
} else if (object.isLayoutInline()) { m_rect = LayoutRect(toLayoutText(object).linesBoundingBox());
m_rect = LayoutRect(toLayoutInline(object).linesBoundingBox()); } else if (object.isLayoutInline()) {
} else if (object.isBox()) { m_rect = LayoutRect(toLayoutInline(object).linesBoundingBox());
m_rect = toLayoutBox(&object)->frameRect(); } else if (object.isBox()) {
m_rect = toLayoutBox(&object)->frameRect();
}
} }
if (m_isTableCell) { if (m_isTableCell) {
...@@ -78,7 +80,7 @@ TracedLayoutObject::TracedLayoutObject(const LayoutObject& object) ...@@ -78,7 +80,7 @@ TracedLayoutObject::TracedLayoutObject(const LayoutObject& object)
} }
for (LayoutObject* child = object.slowFirstChild(); child; child = child->nextSibling()) { for (LayoutObject* child = object.slowFirstChild(); child; child = child->nextSibling()) {
m_children.append(adoptRef(new TracedLayoutObject(*child))); m_children.append(adoptRef(new TracedLayoutObject(*child, traceGeometry)));
} }
} }
......
...@@ -18,12 +18,12 @@ class LayoutView; ...@@ -18,12 +18,12 @@ class LayoutView;
class TracedLayoutObject : public TraceEvent::ConvertableToTraceFormat { class TracedLayoutObject : public TraceEvent::ConvertableToTraceFormat {
WTF_MAKE_NONCOPYABLE(TracedLayoutObject); WTF_MAKE_NONCOPYABLE(TracedLayoutObject);
public: public:
static PassRefPtr<TraceEvent::ConvertableToTraceFormat> create(const LayoutView&); static PassRefPtr<TraceEvent::ConvertableToTraceFormat> create(const LayoutView&, bool traceGeometry = true);
String asTraceFormat() const override; String asTraceFormat() const override;
private: private:
explicit TracedLayoutObject(const LayoutObject&); explicit TracedLayoutObject(const LayoutObject&, bool traceGeometry);
PassRefPtr<JSONObject> toJSON() const; PassRefPtr<JSONObject> toJSON() const;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment