| 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 1095 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1106     // necessitating this check here. | 1106     // necessitating this check here. | 
| 1107     // ASSERT(frame()->page()); | 1107     // ASSERT(frame()->page()); | 
| 1108     if (frame().page()) | 1108     if (frame().page()) | 
| 1109         frame().page()->chrome().client().layoutUpdated(m_frame.get()); | 1109         frame().page()->chrome().client().layoutUpdated(m_frame.get()); | 
| 1110 } | 1110 } | 
| 1111 | 1111 | 
| 1112 // The plan is to move to compositor-queried paint invalidation, in which case t
      his | 1112 // The plan is to move to compositor-queried paint invalidation, in which case t
      his | 
| 1113 // method would setNeedsRedraw on the GraphicsLayers with invalidations and | 1113 // method would setNeedsRedraw on the GraphicsLayers with invalidations and | 
| 1114 // let the compositor pick which to actually draw. | 1114 // let the compositor pick which to actually draw. | 
| 1115 // See http://crbug.com/306706 | 1115 // See http://crbug.com/306706 | 
| 1116 void FrameView::invalidateTreeIfNeeded() | 1116 void FrameView::invalidateTreeIfNeeded(Vector<LayoutObject*>& pendingDelayedPain
      tInvalidations) | 
| 1117 { | 1117 { | 
| 1118     ASSERT(layoutView()); | 1118     ASSERT(layoutView()); | 
| 1119     LayoutView& rootForPaintInvalidation = *layoutView(); | 1119     LayoutView& rootForPaintInvalidation = *layoutView(); | 
| 1120     ASSERT(!rootForPaintInvalidation.needsLayout()); | 1120     ASSERT(!rootForPaintInvalidation.needsLayout()); | 
| 1121 | 1121 | 
| 1122     TRACE_EVENT1("blink", "FrameView::invalidateTree", "root", rootForPaintInval
      idation.debugName().ascii()); | 1122     TRACE_EVENT1("blink", "FrameView::invalidateTree", "root", rootForPaintInval
      idation.debugName().ascii()); | 
| 1123 | 1123 | 
| 1124     PaintInvalidationState rootPaintInvalidationState(rootForPaintInvalidation); | 1124     PaintInvalidationState rootPaintInvalidationState(rootForPaintInvalidation, 
      pendingDelayedPaintInvalidations); | 
| 1125 | 1125 | 
| 1126     // In slimming paint mode we do per-object invalidation. | 1126     // In slimming paint mode we do per-object invalidation. | 
| 1127     if (m_doFullPaintInvalidation && !RuntimeEnabledFeatures::slimmingPaintEnabl
      ed()) | 1127     if (m_doFullPaintInvalidation && !RuntimeEnabledFeatures::slimmingPaintEnabl
      ed()) | 
| 1128         layoutView()->compositor()->fullyInvalidatePaint(); | 1128         layoutView()->compositor()->fullyInvalidatePaint(); | 
| 1129 | 1129 | 
| 1130     rootForPaintInvalidation.invalidateTreeIfNeeded(rootPaintInvalidationState); | 1130     rootForPaintInvalidation.invalidateTreeIfNeeded(rootPaintInvalidationState); | 
| 1131 | 1131 | 
| 1132     // Invalidate the paint of the frameviews scrollbars if needed | 1132     // Invalidate the paint of the frameviews scrollbars if needed | 
| 1133     if (hasVerticalBarDamage()) | 1133     if (hasVerticalBarDamage()) | 
| 1134         invalidateRect(verticalBarDamage()); | 1134         invalidateRect(verticalBarDamage()); | 
| 1135     if (hasHorizontalBarDamage()) | 1135     if (hasHorizontalBarDamage()) | 
| 1136         invalidateRect(horizontalBarDamage()); | 1136         invalidateRect(horizontalBarDamage()); | 
| 1137     resetScrollbarDamage(); | 1137     resetScrollbarDamage(); | 
| 1138 | 1138 | 
| 1139 |  | 
| 1140 #if ENABLE(ASSERT) | 1139 #if ENABLE(ASSERT) | 
| 1141     layoutView()->assertSubtreeClearedPaintInvalidationState(); | 1140     layoutView()->assertSubtreeClearedPaintInvalidationState(); | 
| 1142 #endif | 1141 #endif | 
| 1143 | 1142 | 
| 1144     if (m_frame->selection().isCaretBoundsDirty()) | 1143     if (m_frame->selection().isCaretBoundsDirty()) | 
| 1145         m_frame->selection().invalidateCaretRect(); | 1144         m_frame->selection().invalidateCaretRect(); | 
| 1146 } | 1145 } | 
| 1147 | 1146 | 
| 1148 DocumentLifecycle& FrameView::lifecycle() const | 1147 DocumentLifecycle& FrameView::lifecycle() const | 
| 1149 { | 1148 { | 
| (...skipping 1450 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 2600     m_frame->document()->layoutView()->assertRendererLaidOut(); | 2599     m_frame->document()->layoutView()->assertRendererLaidOut(); | 
| 2601 #endif | 2600 #endif | 
| 2602 | 2601 | 
| 2603     updateWidgetPositionsIfNeeded(); | 2602     updateWidgetPositionsIfNeeded(); | 
| 2604 } | 2603 } | 
| 2605 | 2604 | 
| 2606 void FrameView::invalidateTreeIfNeededRecursive() | 2605 void FrameView::invalidateTreeIfNeededRecursive() | 
| 2607 { | 2606 { | 
| 2608     // FIXME: We should be more aggressive at cutting tree traversals. | 2607     // FIXME: We should be more aggressive at cutting tree traversals. | 
| 2609     lifecycle().advanceTo(DocumentLifecycle::InPaintInvalidation); | 2608     lifecycle().advanceTo(DocumentLifecycle::InPaintInvalidation); | 
| 2610     invalidateTreeIfNeeded(); | 2609 | 
|  | 2610     Vector<LayoutObject*> pendingDelayedPaintInvalidations; | 
|  | 2611 | 
|  | 2612     invalidateTreeIfNeeded(pendingDelayedPaintInvalidations); | 
| 2611 | 2613 | 
| 2612     for (Frame* child = m_frame->tree().firstChild(); child; child = child->tree
      ().nextSibling()) { | 2614     for (Frame* child = m_frame->tree().firstChild(); child; child = child->tree
      ().nextSibling()) { | 
| 2613         if (!child->isLocalFrame()) | 2615         if (!child->isLocalFrame()) | 
| 2614             continue; | 2616             continue; | 
| 2615 | 2617 | 
| 2616         toLocalFrame(child)->view()->invalidateTreeIfNeededRecursive(); | 2618         toLocalFrame(child)->view()->invalidateTreeIfNeededRecursive(); | 
| 2617     } | 2619     } | 
| 2618 | 2620 | 
| 2619     m_doFullPaintInvalidation = false; | 2621     m_doFullPaintInvalidation = false; | 
| 2620     lifecycle().advanceTo(DocumentLifecycle::PaintInvalidationClean); | 2622     lifecycle().advanceTo(DocumentLifecycle::PaintInvalidationClean); | 
|  | 2623 | 
|  | 2624     // Process objects needing paint invalidation on the next frame. See the def
      inition of PaintInvalidationDelayedFull for more details. | 
|  | 2625     for (auto& target : pendingDelayedPaintInvalidations) | 
|  | 2626         target->setShouldDoFullPaintInvalidation(PaintInvalidationDelayedFull); | 
| 2621 } | 2627 } | 
| 2622 | 2628 | 
| 2623 void FrameView::enableAutoSizeMode(const IntSize& minSize, const IntSize& maxSiz
      e) | 2629 void FrameView::enableAutoSizeMode(const IntSize& minSize, const IntSize& maxSiz
      e) | 
| 2624 { | 2630 { | 
| 2625     if (!m_autoSizeInfo) | 2631     if (!m_autoSizeInfo) | 
| 2626         m_autoSizeInfo = FrameViewAutoSizeInfo::create(this); | 2632         m_autoSizeInfo = FrameViewAutoSizeInfo::create(this); | 
| 2627 | 2633 | 
| 2628     m_autoSizeInfo->configureAutoSizeMode(minSize, maxSize); | 2634     m_autoSizeInfo->configureAutoSizeMode(minSize, maxSize); | 
| 2629     setLayoutSizeFixedToFrameSize(true); | 2635     setLayoutSizeFixedToFrameSize(true); | 
| 2630     setNeedsLayout(); | 2636     setNeedsLayout(); | 
| (...skipping 1417 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 4048 { | 4054 { | 
| 4049     Settings* settings = frame().settings(); | 4055     Settings* settings = frame().settings(); | 
| 4050     if (!settings || !settings->rootLayerScrolls()) | 4056     if (!settings || !settings->rootLayerScrolls()) | 
| 4051         return this; | 4057         return this; | 
| 4052 | 4058 | 
| 4053     LayoutView* layoutView = this->layoutView(); | 4059     LayoutView* layoutView = this->layoutView(); | 
| 4054     return layoutView ? layoutView->scrollableArea() : nullptr; | 4060     return layoutView ? layoutView->scrollableArea() : nullptr; | 
| 4055 } | 4061 } | 
| 4056 | 4062 | 
| 4057 } // namespace blink | 4063 } // namespace blink | 
| OLD | NEW | 
|---|