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

Unified Diff: third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp

Issue 2748443002: Do not commit: Object paint property statistics (Closed)
Patch Set: Fix bug in contentsProperties 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
« no previous file with comments | « third_party/WebKit/Source/core/paint/PrePaintTreeWalk.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp
diff --git a/third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp b/third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp
index 10c5d49a581a791a51a0b03be3be41a935da1268..a8b314f21148ff83d1ad4f5a3cf642062e146e8d 100644
--- a/third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp
+++ b/third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp
@@ -37,6 +37,115 @@ struct PrePaintTreeWalkContext {
PaintLayer* ancestorTransformedOrRootPaintLayer;
};
+struct TreeStats {
+ int frames;
+ int layoutObjects;
+ int objectPaintProps;
+
+ // Specific property counts
+ int paintOffsetTranslation;
+ int transform;
+ int effect;
+ int filter;
+ int mask;
+ int maskClip;
+ int cssClip;
+ int cssClipFixedPosition;
+ int innerBorderRadiusClip;
+ int overflowClip;
+ int perspective;
+ int svgLocalToBorderBoxTransform;
+ int scrollTranslation;
+ int scrollbarPaintOffset;
+ int localBorderBoxProperties;
+ int contentsProperties;
+};
+
+void PrePaintTreeWalk::printStats(const FrameView& rootFrame)
+{
+ TreeStats stats = {};
+ countStats(stats, rootFrame);
+ LOG(ERROR) << "stats--------";
+ LOG(ERROR) << "stats.frames: " << stats.frames;
+ LOG(ERROR) << "stats.layoutObjects: " << stats.layoutObjects;
+ LOG(ERROR) << "stats.objectPaintProps: " << stats.objectPaintProps;
+ LOG(ERROR) << " paintOffsetTranslation: " << stats.paintOffsetTranslation;
+ LOG(ERROR) << " transform: " << stats.transform;
+ LOG(ERROR) << " effect: " << stats.effect;
+ LOG(ERROR) << " filter: " << stats.filter;
+ LOG(ERROR) << " mask: " << stats.mask;
+ LOG(ERROR) << " maskClip: " << stats.maskClip;
+ LOG(ERROR) << " cssClip: " << stats.cssClip;
+ LOG(ERROR) << " cssClipFixedPosition: " << stats.cssClipFixedPosition;
+ LOG(ERROR) << " innerBorderRadiusClip: " << stats.innerBorderRadiusClip;
+ LOG(ERROR) << " overflowClip: " << stats.overflowClip;
+ LOG(ERROR) << " perspective: " << stats.perspective;
+ LOG(ERROR) << " svgLocalToBorderBoxTransform: " << stats.svgLocalToBorderBoxTransform;
+ LOG(ERROR) << " scrollTranslation: " << stats.scrollTranslation;
+ LOG(ERROR) << " scrollbarPaintOffset: " << stats.scrollbarPaintOffset;
+ LOG(ERROR) << " localBorderBoxProperties: " << stats.localBorderBoxProperties;
+ LOG(ERROR) << " contentsProperties: " << stats.contentsProperties;
+}
+
+void PrePaintTreeWalk::countStats(TreeStats& stats, const FrameView& frame)
+{
+ stats.frames++;
+ if (LayoutView* view = frame.layoutView())
+ countStats(stats, *view);
+}
+
+void PrePaintTreeWalk::countStats(TreeStats& stats, const LayoutObject& object)
+{
+ stats.layoutObjects++;
+
+ if (const auto* props = object.paintProperties()) {
+ stats.objectPaintProps++;
+
+ if (props->paintOffsetTranslation())
+ stats.paintOffsetTranslation++;
+ if (props->transform())
+ stats.transform++;
+ if (props->effect())
+ stats.effect++;
+ if (props->filter())
+ stats.filter++;
+ if (props->mask())
+ stats.mask++;
+ if (props->maskClip())
+ stats.maskClip++;
+ if (props->cssClip())
+ stats.cssClip++;
+ if (props->cssClipFixedPosition())
+ stats.cssClipFixedPosition++;
+ if (props->innerBorderRadiusClip())
+ stats.innerBorderRadiusClip++;
+ if (props->overflowClip())
+ stats.overflowClip++;
+ if (props->perspective())
+ stats.perspective++;
+ if (props->svgLocalToBorderBoxTransform())
+ stats.svgLocalToBorderBoxTransform++;
+ if (props->scrollTranslation())
+ stats.scrollTranslation++;
+ if (props->scrollbarPaintOffset())
+ stats.scrollbarPaintOffset++;
+ if (props->localBorderBoxProperties())
+ stats.localBorderBoxProperties++;
+ if (props->hasContentsProperties())
+ stats.contentsProperties++;
+ }
+
+ for (const LayoutObject* child = object.slowFirstChild(); child; child = child->nextSibling()) {
+ countStats(stats, *child);
+ }
+ if (object.isLayoutPart()) {
+ const LayoutPart& layoutPart = toLayoutPart(object);
+ FrameViewBase* frameViewBase = layoutPart.frameViewBase();
+ if (frameViewBase && frameViewBase->isFrameView())
+ countStats(stats, *toFrameView(frameViewBase));
+ }
+}
+
void PrePaintTreeWalk::walk(FrameView& rootFrame) {
DCHECK(rootFrame.frame().document()->lifecycle().state() ==
DocumentLifecycle::InPrePaint);
@@ -55,6 +164,8 @@ void PrePaintTreeWalk::walk(FrameView& rootFrame) {
walk(rootFrame, initialContext);
m_paintInvalidator.processPendingDelayedPaintInvalidations();
+
+ printStats(rootFrame);
}
void PrePaintTreeWalk::walk(FrameView& frameView,
« no previous file with comments | « third_party/WebKit/Source/core/paint/PrePaintTreeWalk.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698