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

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

Issue 2773593005: Move logic of recording main thread scrolling reasons from cc to blink::ScrollManager (Closed)
Patch Set: nit 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 unified diff | Download patch
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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 if (reasons & MainThreadScrollingReason::kNotScrollable) 141 if (reasons & MainThreadScrollingReason::kNotScrollable)
142 tracedValue->AppendString("Not scrollable"); 142 tracedValue->AppendString("Not scrollable");
143 if (reasons & MainThreadScrollingReason::kContinuingMainThreadScroll) 143 if (reasons & MainThreadScrollingReason::kContinuingMainThreadScroll)
144 tracedValue->AppendString("Continuing main thread scroll"); 144 tracedValue->AppendString("Continuing main thread scroll");
145 if (reasons & MainThreadScrollingReason::kNonInvertibleTransform) 145 if (reasons & MainThreadScrollingReason::kNonInvertibleTransform)
146 tracedValue->AppendString("Non-invertible transform"); 146 tracedValue->AppendString("Non-invertible transform");
147 if (reasons & MainThreadScrollingReason::kPageBasedScrolling) 147 if (reasons & MainThreadScrollingReason::kPageBasedScrolling)
148 tracedValue->AppendString("Page-based scrolling"); 148 tracedValue->AppendString("Page-based scrolling");
149 tracedValue->EndArray(); 149 tracedValue->EndArray();
150 } 150 }
151
152 // For a given reason, return its index in enum
153 static int getReasonIndex(uint32_t reason) {
154 // Multiple reasons provided
155 if (reason & (reason - 1))
156 return -1;
157
158 int index = -1;
159 while (reason > 0) {
160 reason = reason >> 1;
161 ++index;
162 }
163 return index;
164 }
165 }; 151 };
166 152
167 } // namespace cc 153 } // namespace cc
168 154
169 #endif // CC_INPUT_MAIN_THREAD_SCROLLING_REASON_H_ 155 #endif // CC_INPUT_MAIN_THREAD_SCROLLING_REASON_H_
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/FrameView.h » ('j') | third_party/WebKit/Source/core/input/ScrollManager.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698