| 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
|
|
|