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

Unified Diff: cc/input/main_thread_scrolling_reason.h

Issue 2816973002: Revert of Move logic of recording main thread scrolling reasons from cc to blink::ScrollManager (Closed)
Patch Set: Created 3 years, 8 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 | « 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 a8c586eee95ab06c830406147aae2ebab941929d..9746d9425740d96ff63e52707b498f08b4878d80 100644
--- a/cc/input/main_thread_scrolling_reason.h
+++ b/cc/input/main_thread_scrolling_reason.h
@@ -37,14 +37,12 @@
// These *AndLCDText reasons are due to subpixel text rendering which can
// only be applied by blending glyphs with the background at a specific
// screen position; transparency and transforms break this.
- kNonCompositedReasonsFirst = 16,
kHasOpacityAndLCDText = 1 << 16,
kHasTransformAndLCDText = 1 << 17,
kBackgroundNotOpaqueInRectAndLCDText = 1 << 18,
kHasBorderRadius = 1 << 19,
kHasClipRelatedProperty = 1 << 20,
kHasBoxShadowFromNonRootLayer = 1 << 21,
- kNonCompositedReasonsLast = 21,
// Transient scrolling reasons. These are computed for each scroll begin.
kNonFastScrollableRegion = 1 << 5,
@@ -62,11 +60,6 @@
kMainThreadScrollingReasonCount = 22,
};
- static const uint32_t kNonCompositedReasons =
- kHasOpacityAndLCDText | kHasTransformAndLCDText |
- kBackgroundNotOpaqueInRectAndLCDText | kHasBorderRadius |
- kHasClipRelatedProperty | kHasBoxShadowFromNonRootLayer;
-
// Returns true if the given MainThreadScrollingReason can be set by the main
// thread.
static bool MainThreadCanSetScrollReasons(uint32_t reasons) {
@@ -74,7 +67,10 @@
kNotScrollingOnMain | kHasBackgroundAttachmentFixedObjects |
kHasNonLayerViewportConstrainedObjects | kThreadedScrollingDisabled |
kScrollbarScrolling | kPageOverlay | kHandlingScrollFromMainThread |
- kCustomScrollbarScrolling;
+ kCustomScrollbarScrolling | kHasOpacityAndLCDText |
+ kHasTransformAndLCDText | kBackgroundNotOpaqueInRectAndLCDText |
+ kHasBorderRadius | kHasClipRelatedProperty |
+ kHasBoxShadowFromNonRootLayer;
return (reasons & reasons_set_by_main_thread) == reasons;
}
@@ -86,12 +82,6 @@
kNotScrollable | kContinuingMainThreadScroll | kNonInvertibleTransform |
kPageBasedScrolling;
return (reasons & reasons_set_by_compositor) == reasons;
- }
-
- // Returns true if there are any reasons that prevented the scroller
- // from being composited.
- static bool HasNonCompositedScrollReasons(uint32_t reasons) {
- return (reasons & kNonCompositedReasons) != 0;
}
static std::string mainThreadScrollingReasonsAsText(uint32_t reasons) {
@@ -158,6 +148,20 @@
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 = -1;
+ 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