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

Unified Diff: cc/input/main_thread_scrolling_reason.h

Issue 2565223002: Add more specific metrics for main thread scrolling reasons (Closed)
Patch Set: Test that there should be no reason set if setPrefercompositingToCDLTextEnabled(true) Created 4 years 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 | « no previous file | third_party/WebKit/Source/core/frame/FrameView.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/input/main_thread_scrolling_reason.h
diff --git a/cc/input/main_thread_scrolling_reason.h b/cc/input/main_thread_scrolling_reason.h
index 8cc83d3eb0110d32030bb2172d2e5155ca91093f..191318b60a336982efaff0e489ffcd56245033ce 100644
--- a/cc/input/main_thread_scrolling_reason.h
+++ b/cc/input/main_thread_scrolling_reason.h
@@ -31,6 +31,7 @@ struct MainThreadScrollingReason {
// animation running on the main thread or on the compositor thread.
kHandlingScrollFromMainThread = 1 << 13,
kCustomScrollbarScrolling = 1 << 15,
+ kHasOpacity = 1 << 16,
pdr. 2017/01/07 22:25:25 Why does opacity (and later patches: transform) pr
bokan 2017/01/09 13:29:08 Right, I think it's because in order to do LCD tex
pdr. 2017/01/09 17:22:12 Thanks for the explanation. Would you be okay with
bokan 2017/01/09 17:54:56 Yeah, that sounds clearer. sgtm
// Transient scrolling reasons. These are computed for each scroll begin.
kNonFastScrollableRegion = 1 << 5,
@@ -42,7 +43,7 @@ struct MainThreadScrollingReason {
kPageBasedScrolling = 1 << 12,
// The number of flags in this struct (excluding itself).
- kMainThreadScrollingReasonCount = 17,
+ kMainThreadScrollingReasonCount = 18,
};
// Returns true if the given MainThreadScrollingReason can be set by the main
@@ -52,7 +53,7 @@ struct MainThreadScrollingReason {
kNotScrollingOnMain | kHasBackgroundAttachmentFixedObjects |
kHasNonLayerViewportConstrainedObjects | kThreadedScrollingDisabled |
kScrollbarScrolling | kPageOverlay | kHandlingScrollFromMainThread |
- kCustomScrollbarScrolling;
+ kCustomScrollbarScrolling | kHasOpacity;
return (reasons & reasons_set_by_main_thread) == reasons;
}
@@ -97,6 +98,8 @@ struct MainThreadScrollingReason {
tracedValue->AppendString("Handling scroll from main thread");
if (reasons & MainThreadScrollingReason::kCustomScrollbarScrolling)
tracedValue->AppendString("Custom scrollbar scrolling");
+ if (reasons & MainThreadScrollingReason::kHasOpacity)
+ tracedValue->AppendString("Has opacity");
// Transient scrolling reasons.
if (reasons & MainThreadScrollingReason::kNonFastScrollableRegion)
@@ -115,6 +118,20 @@ struct MainThreadScrollingReason {
tracedValue->AppendString("Page-based scrolling");
tracedValue->EndArray();
}
+
+ // For a given reason, return its index in enum
+ static int getReasonIndex(uint32_t reason) {
+ // Multiple reasons provided
+ if (reason & (reason - 1))
+ return -1;
+
+ int index = 0;
+ while (reason > 0) {
+ reason = reason >> 1;
+ ++index;
+ }
+ return index;
+ }
};
} // namespace cc
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/FrameView.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698