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()
}
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);
TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(TRACE_DISABLED_BY_DEFAULT("blink.debug.layout"), "LayoutTree",
this, TracedLayoutObject::create(*layoutView()));
ASSERT(m_layoutSubtreeRootList.isEmpty());
} // Reset m_layoutSchedulingEnabled to its previous value.
......@@ -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
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();
m_layoutCount++;
......
......@@ -13,9 +13,9 @@
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
......@@ -26,7 +26,7 @@ String TracedLayoutObject::asTraceFormat() const
return builder.toString();
}
TracedLayoutObject::TracedLayoutObject(const LayoutObject& object)
TracedLayoutObject::TracedLayoutObject(const LayoutObject& object, bool traceGeometry)
: m_address((unsigned long) &object)
, m_isAnonymous(object.isAnonymous())
, m_isPositioned(object.isOutOfFlowPositioned())
......@@ -39,7 +39,7 @@ TracedLayoutObject::TracedLayoutObject(const LayoutObject& object)
, m_posChildNeeds(object.posChildNeedsLayout())
, m_isTableCell(object.isTableCell())
, m_name(String(object.name()).isolatedCopy())
, m_absRect(object.absoluteBoundingBoxRect())
, m_absRect(traceGeometry ? object.absoluteBoundingBoxRect() : IntRect())
{
if (Node* node = object.node()) {
m_tag = String(node->nodeName()).isolatedCopy();
......@@ -58,12 +58,14 @@ TracedLayoutObject::TracedLayoutObject(const LayoutObject& object)
// FIXME: When the fixmes in LayoutTreeAsText::writeLayoutObject() are
// fixed, deduplicate it with this.
if (object.isText()) {
m_rect = LayoutRect(toLayoutText(object).linesBoundingBox());
} else if (object.isLayoutInline()) {
m_rect = LayoutRect(toLayoutInline(object).linesBoundingBox());
} else if (object.isBox()) {
m_rect = toLayoutBox(&object)->frameRect();
if (traceGeometry) {
if (object.isText()) {
m_rect = LayoutRect(toLayoutText(object).linesBoundingBox());
} else if (object.isLayoutInline()) {
m_rect = LayoutRect(toLayoutInline(object).linesBoundingBox());
} else if (object.isBox()) {
m_rect = toLayoutBox(&object)->frameRect();
}
}
if (m_isTableCell) {
......@@ -78,7 +80,7 @@ TracedLayoutObject::TracedLayoutObject(const LayoutObject& object)
}
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;
class TracedLayoutObject : public TraceEvent::ConvertableToTraceFormat {
WTF_MAKE_NONCOPYABLE(TracedLayoutObject);
public:
static PassRefPtr<TraceEvent::ConvertableToTraceFormat> create(const LayoutView&);
static PassRefPtr<TraceEvent::ConvertableToTraceFormat> create(const LayoutView&, bool traceGeometry = true);
String asTraceFormat() const override;
private:
explicit TracedLayoutObject(const LayoutObject&);
explicit TracedLayoutObject(const LayoutObject&, bool traceGeometry);
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