Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(685)

Unified Diff: third_party/WebKit/Source/core/paint/ObjectPaintProperties.h

Issue 2766943002: Do-not-commit: Count layout tree memory usage
Patch Set: Rebase, add object paint property counter Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/paint/ObjectPaintProperties.h
diff --git a/third_party/WebKit/Source/core/paint/ObjectPaintProperties.h b/third_party/WebKit/Source/core/paint/ObjectPaintProperties.h
index 67163e99b885b7abb34044b78beb83984e648527..8f2773e1aaca27902640378f6180de37d7052e2d 100644
--- a/third_party/WebKit/Source/core/paint/ObjectPaintProperties.h
+++ b/third_party/WebKit/Source/core/paint/ObjectPaintProperties.h
@@ -51,6 +51,47 @@ class CORE_EXPORT ObjectPaintProperties {
return WTF::wrapUnique(new ObjectPaintProperties());
}
+ char heapMemoryUsage() const {
+ char memory = 0;
+ if (m_paintOffsetTranslation)
+ memory += sizeof(TransformPaintPropertyNode);
+ if (m_transform)
+ memory += sizeof(TransformPaintPropertyNode);
+ if (m_effect)
+ memory += sizeof(EffectPaintPropertyNode);
+ if (m_filter)
+ memory += sizeof(EffectPaintPropertyNode);
+ if (m_mask)
+ memory += sizeof(EffectPaintPropertyNode);
+ if (m_maskClip)
+ memory += sizeof(ClipPaintPropertyNode);
+ if (m_cssClip)
+ memory += sizeof(ClipPaintPropertyNode);
+ if (m_cssClipFixedPosition)
+ memory += sizeof(ClipPaintPropertyNode);
+ if (m_innerBorderRadiusClip)
+ memory += sizeof(ClipPaintPropertyNode);
+ if (m_overflowClip)
+ memory += sizeof(ClipPaintPropertyNode);
+ if (m_perspective)
+ memory += sizeof(TransformPaintPropertyNode);
+ if (m_svgLocalToBorderBoxTransform)
+ memory += sizeof(TransformPaintPropertyNode);
+ if (m_scrollTranslation) {
+ memory += sizeof(TransformPaintPropertyNode);
+ memory += sizeof(ScrollPaintPropertyNode);
+ }
+ if (m_scrollbarPaintOffset)
+ memory += sizeof(TransformPaintPropertyNode);
+ if (m_localBorderBoxProperties)
+ memory += sizeof(PropertyTreeState);
+ if (m_contentsProperties)
+ memory += sizeof(PropertyTreeState);
+ return memory;
+ }
+
+ bool hasContentsProperties() const { return !!m_contentsProperties; }
+
// The hierarchy of the transform subtree created by a LayoutObject is as
// follows:
// [ paintOffsetTranslation ] Normally paint offset is accumulated

Powered by Google App Engine
This is Rietveld 408576698