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

Side by Side Diff: third_party/WebKit/Source/core/frame/FrameView.cpp

Issue 2773593005: Move logic of recording main thread scrolling reasons from cc to blink::ScrollManager (Closed)
Patch Set: Update recording logic for non composited reasons 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 * 1999 Lars Knoll <knoll@kde.org> 3 * 1999 Lars Knoll <knoll@kde.org>
4 * 1999 Antti Koivisto <koivisto@kde.org> 4 * 1999 Antti Koivisto <koivisto@kde.org>
5 * 2000 Dirk Mueller <mueller@kde.org> 5 * 2000 Dirk Mueller <mueller@kde.org>
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com)
8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
9 * Copyright (C) 2009 Google Inc. All rights reserved. 9 * Copyright (C) 2009 Google Inc. All rights reserved.
10 * 10 *
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 m_subtreeThrottled(false), 197 m_subtreeThrottled(false),
198 m_lifecycleUpdatesThrottled(false), 198 m_lifecycleUpdatesThrottled(false),
199 m_needsPaintPropertyUpdate(true), 199 m_needsPaintPropertyUpdate(true),
200 m_currentUpdateLifecyclePhasesTargetState( 200 m_currentUpdateLifecyclePhasesTargetState(
201 DocumentLifecycle::Uninitialized), 201 DocumentLifecycle::Uninitialized),
202 m_scrollAnchor(this), 202 m_scrollAnchor(this),
203 m_scrollbarManager(*this), 203 m_scrollbarManager(*this),
204 m_needsScrollbarsUpdate(false), 204 m_needsScrollbarsUpdate(false),
205 m_suppressAdjustViewSize(false), 205 m_suppressAdjustViewSize(false),
206 m_allowsLayoutInvalidationAfterLayoutClean(true), 206 m_allowsLayoutInvalidationAfterLayoutClean(true),
207 m_mainThreadScrollingReasons(0), 207 m_mainThreadScrollingReasons(0) {
208 m_mainThreadScrollingReasonsCounter(
209 MainThreadScrollingReason::kMainThreadScrollingReasonCount,
210 0) {
211 init(); 208 init();
212 } 209 }
213 210
214 FrameView* FrameView::create(LocalFrame& frame) { 211 FrameView* FrameView::create(LocalFrame& frame) {
215 FrameView* view = new FrameView(frame); 212 FrameView* view = new FrameView(frame);
216 view->show(); 213 view->show();
217 return view; 214 return view;
218 } 215 }
219 216
220 FrameView* FrameView::create(LocalFrame& frame, const IntSize& initialSize) { 217 FrameView* FrameView::create(LocalFrame& frame, const IntSize& initialSize) {
(...skipping 4948 matching lines...) Expand 10 before | Expand all | Expand 10 after
5169 .c_str()); 5166 .c_str());
5170 return result; 5167 return result;
5171 } 5168 }
5172 5169
5173 String result(MainThreadScrollingReason::mainThreadScrollingReasonsAsText( 5170 String result(MainThreadScrollingReason::mainThreadScrollingReasonsAsText(
5174 m_mainThreadScrollingReasons) 5171 m_mainThreadScrollingReasons)
5175 .c_str()); 5172 .c_str());
5176 return result; 5173 return result;
5177 } 5174 }
5178 5175
5179 void FrameView::adjustStyleRelatedMainThreadScrollingReasons(
5180 const uint32_t reason,
5181 bool increase) {
5182 int index = MainThreadScrollingReason::getReasonIndex(reason);
5183 DCHECK_GE(index, 0);
5184 m_mainThreadScrollingReasonsCounter[index] += increase ? 1 : -1;
5185 DCHECK_GE(m_mainThreadScrollingReasonsCounter[index], 0);
5186 }
5187
5188 MainThreadScrollingReasons
5189 FrameView::getStyleRelatedMainThreadScrollingReasons() const {
5190 MainThreadScrollingReasons reasons =
5191 static_cast<MainThreadScrollingReasons>(0);
5192 for (uint32_t reason = 0;
5193 reason < MainThreadScrollingReason::kMainThreadScrollingReasonCount;
5194 ++reason) {
5195 if (m_mainThreadScrollingReasonsCounter[reason] > 0) {
5196 reasons |= 1 << reason;
5197 }
5198 }
5199 return reasons;
5200 }
5201
5202 void FrameView::setViewportIntersectionFromParent( 5176 void FrameView::setViewportIntersectionFromParent(
5203 const IntRect& viewportIntersection) { 5177 const IntRect& viewportIntersection) {
5204 if (m_remoteViewportIntersection != viewportIntersection) { 5178 if (m_remoteViewportIntersection != viewportIntersection) {
5205 m_remoteViewportIntersection = viewportIntersection; 5179 m_remoteViewportIntersection = viewportIntersection;
5206 scheduleAnimation(); 5180 scheduleAnimation();
5207 } 5181 }
5208 } 5182 }
5209 5183
5210 IntRect FrameView::remoteViewportIntersection() { 5184 IntRect FrameView::remoteViewportIntersection() {
5211 IntRect intersection(m_remoteViewportIntersection); 5185 IntRect intersection(m_remoteViewportIntersection);
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
5265 void FrameView::setAnimationHost( 5239 void FrameView::setAnimationHost(
5266 std::unique_ptr<CompositorAnimationHost> host) { 5240 std::unique_ptr<CompositorAnimationHost> host) {
5267 m_animationHost = std::move(host); 5241 m_animationHost = std::move(host);
5268 } 5242 }
5269 5243
5270 LayoutUnit FrameView::caretWidth() const { 5244 LayoutUnit FrameView::caretWidth() const {
5271 return LayoutUnit(getHostWindow()->windowToViewportScalar(1)); 5245 return LayoutUnit(getHostWindow()->windowToViewportScalar(1));
5272 } 5246 }
5273 5247
5274 } // namespace blink 5248 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698