OLD | NEW |
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 Loading... |
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 4863 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5083 } | 5080 } |
5084 | 5081 |
5085 Frame* child = frame.tree().firstChild(); | 5082 Frame* child = frame.tree().firstChild(); |
5086 while (child) { | 5083 while (child) { |
5087 updateSubFrameScrollOnMainReason(*child, reasons); | 5084 updateSubFrameScrollOnMainReason(*child, reasons); |
5088 child = child->tree().nextSibling(); | 5085 child = child->tree().nextSibling(); |
5089 } | 5086 } |
5090 | 5087 |
5091 if (frame.isMainFrame()) | 5088 if (frame.isMainFrame()) |
5092 m_mainThreadScrollingReasons = reasons; | 5089 m_mainThreadScrollingReasons = reasons; |
| 5090 DCHECK(!MainThreadScrollingReason::NonCompositedScrollReasons( |
| 5091 m_mainThreadScrollingReasons)); |
5093 } | 5092 } |
5094 | 5093 |
5095 MainThreadScrollingReasons FrameView::mainThreadScrollingReasonsPerFrame() | 5094 MainThreadScrollingReasons FrameView::mainThreadScrollingReasonsPerFrame() |
5096 const { | 5095 const { |
5097 MainThreadScrollingReasons reasons = | 5096 MainThreadScrollingReasons reasons = |
5098 static_cast<MainThreadScrollingReasons>(0); | 5097 static_cast<MainThreadScrollingReasons>(0); |
5099 | 5098 |
5100 if (shouldThrottleRendering()) | 5099 if (shouldThrottleRendering()) |
5101 return reasons; | 5100 return reasons; |
5102 | 5101 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5141 // Walk the tree to the root. Use the gathered reasons to determine | 5140 // Walk the tree to the root. Use the gathered reasons to determine |
5142 // whether the target frame should be scrolled on main thread regardless | 5141 // whether the target frame should be scrolled on main thread regardless |
5143 // other subframes on the same page. | 5142 // other subframes on the same page. |
5144 for (Frame* frame = m_frame; frame; frame = frame->tree().parent()) { | 5143 for (Frame* frame = m_frame; frame; frame = frame->tree().parent()) { |
5145 if (!frame->isLocalFrame()) | 5144 if (!frame->isLocalFrame()) |
5146 continue; | 5145 continue; |
5147 reasons |= | 5146 reasons |= |
5148 toLocalFrame(frame)->view()->mainThreadScrollingReasonsPerFrame(); | 5147 toLocalFrame(frame)->view()->mainThreadScrollingReasonsPerFrame(); |
5149 } | 5148 } |
5150 | 5149 |
| 5150 DCHECK(!MainThreadScrollingReason::NonCompositedScrollReasons(reasons)); |
5151 return reasons; | 5151 return reasons; |
5152 } | 5152 } |
5153 | 5153 |
5154 String FrameView::mainThreadScrollingReasonsAsText() const { | 5154 String FrameView::mainThreadScrollingReasonsAsText() const { |
5155 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { | 5155 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
5156 DCHECK(lifecycle().state() >= DocumentLifecycle::PrePaintClean); | 5156 DCHECK(lifecycle().state() >= DocumentLifecycle::PrePaintClean); |
5157 | 5157 |
5158 // Slimming paint v2 stores main thread scrolling reasons on property | 5158 // Slimming paint v2 stores main thread scrolling reasons on property |
5159 // trees instead of in |m_mainThreadScrollingReasons|. | 5159 // trees instead of in |m_mainThreadScrollingReasons|. |
5160 MainThreadScrollingReasons reasons = 0; | 5160 MainThreadScrollingReasons reasons = 0; |
(...skipping 12 matching lines...) Expand all Loading... |
5173 .c_str()); | 5173 .c_str()); |
5174 return result; | 5174 return result; |
5175 } | 5175 } |
5176 | 5176 |
5177 String result(MainThreadScrollingReason::mainThreadScrollingReasonsAsText( | 5177 String result(MainThreadScrollingReason::mainThreadScrollingReasonsAsText( |
5178 m_mainThreadScrollingReasons) | 5178 m_mainThreadScrollingReasons) |
5179 .c_str()); | 5179 .c_str()); |
5180 return result; | 5180 return result; |
5181 } | 5181 } |
5182 | 5182 |
5183 void FrameView::adjustStyleRelatedMainThreadScrollingReasons( | |
5184 const uint32_t reason, | |
5185 bool increase) { | |
5186 int index = MainThreadScrollingReason::getReasonIndex(reason); | |
5187 DCHECK_GE(index, 0); | |
5188 m_mainThreadScrollingReasonsCounter[index] += increase ? 1 : -1; | |
5189 DCHECK_GE(m_mainThreadScrollingReasonsCounter[index], 0); | |
5190 } | |
5191 | |
5192 MainThreadScrollingReasons | |
5193 FrameView::getStyleRelatedMainThreadScrollingReasons() const { | |
5194 MainThreadScrollingReasons reasons = | |
5195 static_cast<MainThreadScrollingReasons>(0); | |
5196 for (uint32_t reason = 0; | |
5197 reason < MainThreadScrollingReason::kMainThreadScrollingReasonCount; | |
5198 ++reason) { | |
5199 if (m_mainThreadScrollingReasonsCounter[reason] > 0) { | |
5200 reasons |= 1 << reason; | |
5201 } | |
5202 } | |
5203 return reasons; | |
5204 } | |
5205 | |
5206 void FrameView::setViewportIntersectionFromParent( | 5183 void FrameView::setViewportIntersectionFromParent( |
5207 const IntRect& viewportIntersection) { | 5184 const IntRect& viewportIntersection) { |
5208 if (m_remoteViewportIntersection != viewportIntersection) { | 5185 if (m_remoteViewportIntersection != viewportIntersection) { |
5209 m_remoteViewportIntersection = viewportIntersection; | 5186 m_remoteViewportIntersection = viewportIntersection; |
5210 scheduleAnimation(); | 5187 scheduleAnimation(); |
5211 } | 5188 } |
5212 } | 5189 } |
5213 | 5190 |
5214 IntRect FrameView::remoteViewportIntersection() { | 5191 IntRect FrameView::remoteViewportIntersection() { |
5215 IntRect intersection(m_remoteViewportIntersection); | 5192 IntRect intersection(m_remoteViewportIntersection); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5269 void FrameView::setAnimationHost( | 5246 void FrameView::setAnimationHost( |
5270 std::unique_ptr<CompositorAnimationHost> host) { | 5247 std::unique_ptr<CompositorAnimationHost> host) { |
5271 m_animationHost = std::move(host); | 5248 m_animationHost = std::move(host); |
5272 } | 5249 } |
5273 | 5250 |
5274 LayoutUnit FrameView::caretWidth() const { | 5251 LayoutUnit FrameView::caretWidth() const { |
5275 return LayoutUnit(getHostWindow()->windowToViewportScalar(1)); | 5252 return LayoutUnit(getHostWindow()->windowToViewportScalar(1)); |
5276 } | 5253 } |
5277 | 5254 |
5278 } // namespace blink | 5255 } // namespace blink |
OLD | NEW |