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

Side by Side Diff: cc/input/main_thread_scrolling_reason.h

Issue 2841603003: Record non-stacking-context as main thread scrolling reasons (Closed)
Patch Set: nit Created 3 years, 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CC_INPUT_MAIN_THREAD_SCROLLING_REASON_H_ 5 #ifndef CC_INPUT_MAIN_THREAD_SCROLLING_REASON_H_
6 #define CC_INPUT_MAIN_THREAD_SCROLLING_REASON_H_ 6 #define CC_INPUT_MAIN_THREAD_SCROLLING_REASON_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 26 matching lines...) Expand all
37 // These *AndLCDText reasons are due to subpixel text rendering which can 37 // These *AndLCDText reasons are due to subpixel text rendering which can
38 // only be applied by blending glyphs with the background at a specific 38 // only be applied by blending glyphs with the background at a specific
39 // screen position; transparency and transforms break this. 39 // screen position; transparency and transforms break this.
40 kNonCompositedReasonsFirst = 16, 40 kNonCompositedReasonsFirst = 16,
41 kHasOpacityAndLCDText = 1 << 16, 41 kHasOpacityAndLCDText = 1 << 16,
42 kHasTransformAndLCDText = 1 << 17, 42 kHasTransformAndLCDText = 1 << 17,
43 kBackgroundNotOpaqueInRectAndLCDText = 1 << 18, 43 kBackgroundNotOpaqueInRectAndLCDText = 1 << 18,
44 kHasBorderRadius = 1 << 19, 44 kHasBorderRadius = 1 << 19,
45 kHasClipRelatedProperty = 1 << 20, 45 kHasClipRelatedProperty = 1 << 20,
46 kHasBoxShadowFromNonRootLayer = 1 << 21, 46 kHasBoxShadowFromNonRootLayer = 1 << 21,
47 kNonCompositedReasonsLast = 21, 47 kIsNotStackingContextAndLCDText = 1 << 22,
48 kNonCompositedReasonsLast = 22,
48 49
49 // Transient scrolling reasons. These are computed for each scroll begin. 50 // Transient scrolling reasons. These are computed for each scroll begin.
50 kNonFastScrollableRegion = 1 << 5, 51 kNonFastScrollableRegion = 1 << 5,
51 kFailedHitTest = 1 << 7, 52 kFailedHitTest = 1 << 7,
52 kNoScrollingLayer = 1 << 8, 53 kNoScrollingLayer = 1 << 8,
53 kNotScrollable = 1 << 9, 54 kNotScrollable = 1 << 9,
54 kContinuingMainThreadScroll = 1 << 10, 55 kContinuingMainThreadScroll = 1 << 10,
55 kNonInvertibleTransform = 1 << 11, 56 kNonInvertibleTransform = 1 << 11,
56 kPageBasedScrolling = 1 << 12, 57 kPageBasedScrolling = 1 << 12,
57 58
58 // The maximum number of flags in this struct (excluding itself). 59 // The maximum number of flags in this struct (excluding itself).
59 // New flags should increment this number but it should never be decremented 60 // New flags should increment this number but it should never be decremented
60 // because the values are used in UMA histograms. It should also be noted 61 // because the values are used in UMA histograms. It should also be noted
61 // that it excludes the kNotScrollingOnMain value. 62 // that it excludes the kNotScrollingOnMain value.
62 kMainThreadScrollingReasonCount = 22, 63 kMainThreadScrollingReasonCount = 23,
63 }; 64 };
64 65
65 static const uint32_t kNonCompositedReasons = 66 static const uint32_t kNonCompositedReasons =
66 kHasOpacityAndLCDText | kHasTransformAndLCDText | 67 kHasOpacityAndLCDText | kHasTransformAndLCDText |
67 kBackgroundNotOpaqueInRectAndLCDText | kHasBorderRadius | 68 kBackgroundNotOpaqueInRectAndLCDText | kHasBorderRadius |
68 kHasClipRelatedProperty | kHasBoxShadowFromNonRootLayer; 69 kHasClipRelatedProperty | kHasBoxShadowFromNonRootLayer |
70 kIsNotStackingContextAndLCDText;
69 71
70 // Returns true if the given MainThreadScrollingReason can be set by the main 72 // Returns true if the given MainThreadScrollingReason can be set by the main
71 // thread. 73 // thread.
72 static bool MainThreadCanSetScrollReasons(uint32_t reasons) { 74 static bool MainThreadCanSetScrollReasons(uint32_t reasons) {
73 uint32_t reasons_set_by_main_thread = 75 uint32_t reasons_set_by_main_thread =
74 kNotScrollingOnMain | kHasBackgroundAttachmentFixedObjects | 76 kNotScrollingOnMain | kHasBackgroundAttachmentFixedObjects |
75 kHasNonLayerViewportConstrainedObjects | kThreadedScrollingDisabled | 77 kHasNonLayerViewportConstrainedObjects | kThreadedScrollingDisabled |
76 kScrollbarScrolling | kPageOverlay | kHandlingScrollFromMainThread | 78 kScrollbarScrolling | kPageOverlay | kHandlingScrollFromMainThread |
77 kCustomScrollbarScrolling; 79 kCustomScrollbarScrolling;
78 return (reasons & reasons_set_by_main_thread) == reasons; 80 return (reasons & reasons_set_by_main_thread) == reasons;
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 MainThreadScrollingReason::kBackgroundNotOpaqueInRectAndLCDText) { 135 MainThreadScrollingReason::kBackgroundNotOpaqueInRectAndLCDText) {
134 tracedValue->AppendString( 136 tracedValue->AppendString(
135 "Background is not opaque in rect and LCD text"); 137 "Background is not opaque in rect and LCD text");
136 } 138 }
137 if (reasons & MainThreadScrollingReason::kHasBorderRadius) 139 if (reasons & MainThreadScrollingReason::kHasBorderRadius)
138 tracedValue->AppendString("Has border radius"); 140 tracedValue->AppendString("Has border radius");
139 if (reasons & MainThreadScrollingReason::kHasClipRelatedProperty) 141 if (reasons & MainThreadScrollingReason::kHasClipRelatedProperty)
140 tracedValue->AppendString("Has clip related property"); 142 tracedValue->AppendString("Has clip related property");
141 if (reasons & MainThreadScrollingReason::kHasBoxShadowFromNonRootLayer) 143 if (reasons & MainThreadScrollingReason::kHasBoxShadowFromNonRootLayer)
142 tracedValue->AppendString("Has box shadow from non-root layer"); 144 tracedValue->AppendString("Has box shadow from non-root layer");
145 if (reasons & MainThreadScrollingReason::kIsNotStackingContextAndLCDText)
146 tracedValue->AppendString("Is not stacking context and LCD text");
143 147
144 // Transient scrolling reasons. 148 // Transient scrolling reasons.
145 if (reasons & MainThreadScrollingReason::kNonFastScrollableRegion) 149 if (reasons & MainThreadScrollingReason::kNonFastScrollableRegion)
146 tracedValue->AppendString("Non fast scrollable region"); 150 tracedValue->AppendString("Non fast scrollable region");
147 if (reasons & MainThreadScrollingReason::kFailedHitTest) 151 if (reasons & MainThreadScrollingReason::kFailedHitTest)
148 tracedValue->AppendString("Failed hit test"); 152 tracedValue->AppendString("Failed hit test");
149 if (reasons & MainThreadScrollingReason::kNoScrollingLayer) 153 if (reasons & MainThreadScrollingReason::kNoScrollingLayer)
150 tracedValue->AppendString("No scrolling layer"); 154 tracedValue->AppendString("No scrolling layer");
151 if (reasons & MainThreadScrollingReason::kNotScrollable) 155 if (reasons & MainThreadScrollingReason::kNotScrollable)
152 tracedValue->AppendString("Not scrollable"); 156 tracedValue->AppendString("Not scrollable");
153 if (reasons & MainThreadScrollingReason::kContinuingMainThreadScroll) 157 if (reasons & MainThreadScrollingReason::kContinuingMainThreadScroll)
154 tracedValue->AppendString("Continuing main thread scroll"); 158 tracedValue->AppendString("Continuing main thread scroll");
155 if (reasons & MainThreadScrollingReason::kNonInvertibleTransform) 159 if (reasons & MainThreadScrollingReason::kNonInvertibleTransform)
156 tracedValue->AppendString("Non-invertible transform"); 160 tracedValue->AppendString("Non-invertible transform");
157 if (reasons & MainThreadScrollingReason::kPageBasedScrolling) 161 if (reasons & MainThreadScrollingReason::kPageBasedScrolling)
158 tracedValue->AppendString("Page-based scrolling"); 162 tracedValue->AppendString("Page-based scrolling");
159 tracedValue->EndArray(); 163 tracedValue->EndArray();
160 } 164 }
161 }; 165 };
162 166
163 } // namespace cc 167 } // namespace cc
164 168
165 #endif // CC_INPUT_MAIN_THREAD_SCROLLING_REASON_H_ 169 #endif // CC_INPUT_MAIN_THREAD_SCROLLING_REASON_H_
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698