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

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: 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 /* 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 4940 matching lines...) Expand 10 before | Expand all | Expand 10 after
5161 .c_str()); 5158 .c_str());
5162 return result; 5159 return result;
5163 } 5160 }
5164 5161
5165 String result(MainThreadScrollingReason::mainThreadScrollingReasonsAsText( 5162 String result(MainThreadScrollingReason::mainThreadScrollingReasonsAsText(
5166 m_mainThreadScrollingReasons) 5163 m_mainThreadScrollingReasons)
5167 .c_str()); 5164 .c_str());
5168 return result; 5165 return result;
5169 } 5166 }
5170 5167
5171 void FrameView::adjustStyleRelatedMainThreadScrollingReasons(
5172 const uint32_t reason,
5173 bool increase) {
5174 int index = MainThreadScrollingReason::getReasonIndex(reason);
5175 DCHECK_GE(index, 0);
5176 m_mainThreadScrollingReasonsCounter[index] += increase ? 1 : -1;
5177 DCHECK_GE(m_mainThreadScrollingReasonsCounter[index], 0);
5178 }
5179
5180 MainThreadScrollingReasons
5181 FrameView::getStyleRelatedMainThreadScrollingReasons() const {
5182 MainThreadScrollingReasons reasons =
5183 static_cast<MainThreadScrollingReasons>(0);
5184 for (uint32_t reason = 0;
5185 reason < MainThreadScrollingReason::kMainThreadScrollingReasonCount;
5186 ++reason) {
5187 if (m_mainThreadScrollingReasonsCounter[reason] > 0) {
5188 reasons |= 1 << reason;
5189 }
5190 }
5191 return reasons;
5192 }
5193
5194 void FrameView::setViewportIntersectionFromParent( 5168 void FrameView::setViewportIntersectionFromParent(
5195 const IntRect& viewportIntersection) { 5169 const IntRect& viewportIntersection) {
5196 if (m_remoteViewportIntersection != viewportIntersection) { 5170 if (m_remoteViewportIntersection != viewportIntersection) {
5197 m_remoteViewportIntersection = viewportIntersection; 5171 m_remoteViewportIntersection = viewportIntersection;
5198 scheduleAnimation(); 5172 scheduleAnimation();
5199 } 5173 }
5200 } 5174 }
5201 5175
5202 IntRect FrameView::remoteViewportIntersection() { 5176 IntRect FrameView::remoteViewportIntersection() {
5203 IntRect intersection(m_remoteViewportIntersection); 5177 IntRect intersection(m_remoteViewportIntersection);
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
5257 void FrameView::setAnimationHost( 5231 void FrameView::setAnimationHost(
5258 std::unique_ptr<CompositorAnimationHost> host) { 5232 std::unique_ptr<CompositorAnimationHost> host) {
5259 m_animationHost = std::move(host); 5233 m_animationHost = std::move(host);
5260 } 5234 }
5261 5235
5262 LayoutUnit FrameView::caretWidth() const { 5236 LayoutUnit FrameView::caretWidth() const {
5263 return LayoutUnit(getHostWindow()->windowToViewportScalar(1)); 5237 return LayoutUnit(getHostWindow()->windowToViewportScalar(1));
5264 } 5238 }
5265 5239
5266 } // namespace blink 5240 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698