| 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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 m_subtreeThrottled(false), | 189 m_subtreeThrottled(false), |
| 190 m_lifecycleUpdatesThrottled(false), | 190 m_lifecycleUpdatesThrottled(false), |
| 191 m_needsPaintPropertyUpdate(true), | 191 m_needsPaintPropertyUpdate(true), |
| 192 m_currentUpdateLifecyclePhasesTargetState( | 192 m_currentUpdateLifecyclePhasesTargetState( |
| 193 DocumentLifecycle::Uninitialized), | 193 DocumentLifecycle::Uninitialized), |
| 194 m_scrollAnchor(this), | 194 m_scrollAnchor(this), |
| 195 m_scrollbarManager(*this), | 195 m_scrollbarManager(*this), |
| 196 m_needsScrollbarsUpdate(false), | 196 m_needsScrollbarsUpdate(false), |
| 197 m_suppressAdjustViewSize(false), | 197 m_suppressAdjustViewSize(false), |
| 198 m_allowsLayoutInvalidationAfterLayoutClean(true), | 198 m_allowsLayoutInvalidationAfterLayoutClean(true), |
| 199 m_needsOpaquenessUpdate(false), |
| 199 m_mainThreadScrollingReasons(0), | 200 m_mainThreadScrollingReasons(0), |
| 200 m_mainThreadScrollingReasonsCounter( | 201 m_mainThreadScrollingReasonsCounter( |
| 201 MainThreadScrollingReason::kMainThreadScrollingReasonCount, | 202 MainThreadScrollingReason::kMainThreadScrollingReasonCount, |
| 202 0) { | 203 0) { |
| 203 init(); | 204 init(); |
| 204 } | 205 } |
| 205 | 206 |
| 206 FrameView* FrameView::create(LocalFrame& frame) { | 207 FrameView* FrameView::create(LocalFrame& frame) { |
| 207 FrameView* view = new FrameView(frame); | 208 FrameView* view = new FrameView(frame); |
| 208 view->show(); | 209 view->show(); |
| (...skipping 2092 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2301 bool FrameView::hasOpaqueBackground() const { | 2302 bool FrameView::hasOpaqueBackground() const { |
| 2302 return !m_isTransparent && !m_baseBackgroundColor.hasAlpha(); | 2303 return !m_isTransparent && !m_baseBackgroundColor.hasAlpha(); |
| 2303 } | 2304 } |
| 2304 | 2305 |
| 2305 Color FrameView::baseBackgroundColor() const { | 2306 Color FrameView::baseBackgroundColor() const { |
| 2306 return m_baseBackgroundColor; | 2307 return m_baseBackgroundColor; |
| 2307 } | 2308 } |
| 2308 | 2309 |
| 2309 void FrameView::setBaseBackgroundColor(const Color& backgroundColor) { | 2310 void FrameView::setBaseBackgroundColor(const Color& backgroundColor) { |
| 2310 m_baseBackgroundColor = backgroundColor; | 2311 m_baseBackgroundColor = backgroundColor; |
| 2312 m_needsOpaquenessUpdate = true; |
| 2313 recalculateScrollbarOverlayColorTheme(documentBackgroundColor()); |
| 2314 |
| 2315 if (!shouldThrottleRendering()) |
| 2316 page()->animator().scheduleVisualUpdate(m_frame.get()); |
| 2317 } |
| 2318 |
| 2319 void FrameView::updateOpaquenessIfNeeded() { |
| 2320 if (!m_needsOpaquenessUpdate) |
| 2321 return; |
| 2311 | 2322 |
| 2312 if (!layoutViewItem().isNull() && | 2323 if (!layoutViewItem().isNull() && |
| 2313 layoutViewItem().layer()->hasCompositedLayerMapping()) { | 2324 layoutViewItem().layer()->hasCompositedLayerMapping()) { |
| 2314 CompositedLayerMapping* compositedLayerMapping = | 2325 CompositedLayerMapping* compositedLayerMapping = |
| 2315 layoutViewItem().layer()->compositedLayerMapping(); | 2326 layoutViewItem().layer()->compositedLayerMapping(); |
| 2316 compositedLayerMapping->updateContentsOpaque(); | 2327 compositedLayerMapping->updateContentsOpaque(); |
| 2317 if (compositedLayerMapping->mainGraphicsLayer()) | 2328 if (compositedLayerMapping->mainGraphicsLayer()) |
| 2318 compositedLayerMapping->mainGraphicsLayer()->setNeedsDisplay(); | 2329 compositedLayerMapping->mainGraphicsLayer()->setNeedsDisplay(); |
| 2319 } | 2330 } |
| 2320 recalculateScrollbarOverlayColorTheme(documentBackgroundColor()); | 2331 m_needsOpaquenessUpdate = false; |
| 2321 | |
| 2322 if (!shouldThrottleRendering()) | |
| 2323 page()->animator().scheduleVisualUpdate(m_frame.get()); | |
| 2324 } | 2332 } |
| 2325 | 2333 |
| 2326 void FrameView::updateBackgroundRecursively(const Color& backgroundColor, | 2334 void FrameView::updateBackgroundRecursively(const Color& backgroundColor, |
| 2327 bool transparent) { | 2335 bool transparent) { |
| 2328 forAllNonThrottledFrameViews( | 2336 forAllNonThrottledFrameViews( |
| 2329 [backgroundColor, transparent](FrameView& frameView) { | 2337 [backgroundColor, transparent](FrameView& frameView) { |
| 2330 frameView.setTransparent(transparent); | 2338 frameView.setTransparent(transparent); |
| 2331 frameView.setBaseBackgroundColor(backgroundColor); | 2339 frameView.setBaseBackgroundColor(backgroundColor); |
| 2332 }); | 2340 }); |
| 2333 } | 2341 } |
| (...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2950 | 2958 |
| 2951 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { | 2959 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
| 2952 view.compositor()->updateIfNeededRecursive(); | 2960 view.compositor()->updateIfNeededRecursive(); |
| 2953 } else { | 2961 } else { |
| 2954 forAllNonThrottledFrameViews([](FrameView& frameView) { | 2962 forAllNonThrottledFrameViews([](FrameView& frameView) { |
| 2955 frameView.layoutView()->layer()->updateDescendantDependentFlags(); | 2963 frameView.layoutView()->layer()->updateDescendantDependentFlags(); |
| 2956 frameView.layoutView()->commitPendingSelection(); | 2964 frameView.layoutView()->commitPendingSelection(); |
| 2957 }); | 2965 }); |
| 2958 } | 2966 } |
| 2959 | 2967 |
| 2968 updateOpaquenessIfNeeded(); |
| 2969 |
| 2960 scrollContentsIfNeededRecursive(); | 2970 scrollContentsIfNeededRecursive(); |
| 2961 DCHECK(RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled() || | 2971 DCHECK(RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled() || |
| 2962 lifecycle().state() >= DocumentLifecycle::CompositingClean); | 2972 lifecycle().state() >= DocumentLifecycle::CompositingClean); |
| 2963 | 2973 |
| 2964 m_frame->host()->globalRootScrollerController().didUpdateCompositing(); | 2974 m_frame->host()->globalRootScrollerController().didUpdateCompositing(); |
| 2965 | 2975 |
| 2966 if (targetState >= DocumentLifecycle::PrePaintClean) { | 2976 if (targetState >= DocumentLifecycle::PrePaintClean) { |
| 2967 if (!RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) | 2977 if (!RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) |
| 2968 invalidateTreeIfNeededRecursive(); | 2978 invalidateTreeIfNeededRecursive(); |
| 2969 | 2979 |
| (...skipping 2091 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5061 std::unique_ptr<CompositorAnimationTimeline> timeline) { | 5071 std::unique_ptr<CompositorAnimationTimeline> timeline) { |
| 5062 m_animationTimeline = std::move(timeline); | 5072 m_animationTimeline = std::move(timeline); |
| 5063 } | 5073 } |
| 5064 | 5074 |
| 5065 void FrameView::setAnimationHost( | 5075 void FrameView::setAnimationHost( |
| 5066 std::unique_ptr<CompositorAnimationHost> host) { | 5076 std::unique_ptr<CompositorAnimationHost> host) { |
| 5067 m_animationHost = std::move(host); | 5077 m_animationHost = std::move(host); |
| 5068 } | 5078 } |
| 5069 | 5079 |
| 5070 } // namespace blink | 5080 } // namespace blink |
| OLD | NEW |