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

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: bug fix 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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 m_subtreeThrottled(false), 196 m_subtreeThrottled(false),
197 m_lifecycleUpdatesThrottled(false), 197 m_lifecycleUpdatesThrottled(false),
198 m_needsPaintPropertyUpdate(true), 198 m_needsPaintPropertyUpdate(true),
199 m_currentUpdateLifecyclePhasesTargetState( 199 m_currentUpdateLifecyclePhasesTargetState(
200 DocumentLifecycle::Uninitialized), 200 DocumentLifecycle::Uninitialized),
201 m_scrollAnchor(this), 201 m_scrollAnchor(this),
202 m_scrollbarManager(*this), 202 m_scrollbarManager(*this),
203 m_needsScrollbarsUpdate(false), 203 m_needsScrollbarsUpdate(false),
204 m_suppressAdjustViewSize(false), 204 m_suppressAdjustViewSize(false),
205 m_allowsLayoutInvalidationAfterLayoutClean(true), 205 m_allowsLayoutInvalidationAfterLayoutClean(true),
206 m_mainThreadScrollingReasons(0), 206 m_mainThreadScrollingReasons(0) {
207 m_mainThreadScrollingReasonsCounter(
208 MainThreadScrollingReason::kMainThreadScrollingReasonCount,
209 0) {
210 init(); 207 init();
211 } 208 }
212 209
213 FrameView* FrameView::create(LocalFrame& frame) { 210 FrameView* FrameView::create(LocalFrame& frame) {
214 FrameView* view = new FrameView(frame); 211 FrameView* view = new FrameView(frame);
215 view->show(); 212 view->show();
216 return view; 213 return view;
217 } 214 }
218 215
219 FrameView* FrameView::create(LocalFrame& frame, const IntSize& initialSize) { 216 FrameView* FrameView::create(LocalFrame& frame, const IntSize& initialSize) {
(...skipping 4935 matching lines...) Expand 10 before | Expand all | Expand 10 after
5155 .c_str()); 5152 .c_str());
5156 return result; 5153 return result;
5157 } 5154 }
5158 5155
5159 String result(MainThreadScrollingReason::mainThreadScrollingReasonsAsText( 5156 String result(MainThreadScrollingReason::mainThreadScrollingReasonsAsText(
5160 m_mainThreadScrollingReasons) 5157 m_mainThreadScrollingReasons)
5161 .c_str()); 5158 .c_str());
5162 return result; 5159 return result;
5163 } 5160 }
5164 5161
5165 void FrameView::adjustStyleRelatedMainThreadScrollingReasons(
5166 const uint32_t reason,
5167 bool increase) {
5168 int index = MainThreadScrollingReason::getReasonIndex(reason);
5169 DCHECK_GE(index, 0);
5170 m_mainThreadScrollingReasonsCounter[index] += increase ? 1 : -1;
5171 DCHECK_GE(m_mainThreadScrollingReasonsCounter[index], 0);
5172 }
5173
5174 MainThreadScrollingReasons
5175 FrameView::getStyleRelatedMainThreadScrollingReasons() const {
5176 MainThreadScrollingReasons reasons =
5177 static_cast<MainThreadScrollingReasons>(0);
5178 for (uint32_t reason = 0;
5179 reason < MainThreadScrollingReason::kMainThreadScrollingReasonCount;
5180 ++reason) {
5181 if (m_mainThreadScrollingReasonsCounter[reason] > 0) {
5182 reasons |= 1 << reason;
5183 }
5184 }
5185 return reasons;
5186 }
5187
5188 void FrameView::setViewportIntersectionFromParent( 5162 void FrameView::setViewportIntersectionFromParent(
5189 const IntRect& viewportIntersection) { 5163 const IntRect& viewportIntersection) {
5190 if (m_remoteViewportIntersection != viewportIntersection) { 5164 if (m_remoteViewportIntersection != viewportIntersection) {
5191 m_remoteViewportIntersection = viewportIntersection; 5165 m_remoteViewportIntersection = viewportIntersection;
5192 scheduleAnimation(); 5166 scheduleAnimation();
5193 } 5167 }
5194 } 5168 }
5195 5169
5196 IntRect FrameView::remoteViewportIntersection() { 5170 IntRect FrameView::remoteViewportIntersection() {
5197 IntRect intersection(m_remoteViewportIntersection); 5171 IntRect intersection(m_remoteViewportIntersection);
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
5251 void FrameView::setAnimationHost( 5225 void FrameView::setAnimationHost(
5252 std::unique_ptr<CompositorAnimationHost> host) { 5226 std::unique_ptr<CompositorAnimationHost> host) {
5253 m_animationHost = std::move(host); 5227 m_animationHost = std::move(host);
5254 } 5228 }
5255 5229
5256 LayoutUnit FrameView::caretWidth() const { 5230 LayoutUnit FrameView::caretWidth() const {
5257 return LayoutUnit(getHostWindow()->windowToViewportScalar(1)); 5231 return LayoutUnit(getHostWindow()->windowToViewportScalar(1));
5258 } 5232 }
5259 5233
5260 } // namespace blink 5234 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698