| 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 1081 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1092 if (frame().page()) | 1092 if (frame().page()) |
| 1093 frame().page()->chromeClient().layoutUpdated(m_frame.get()); | 1093 frame().page()->chromeClient().layoutUpdated(m_frame.get()); |
| 1094 | 1094 |
| 1095 frame().document()->markers().updateRenderedRectsForMarkers(); | 1095 frame().document()->markers().updateRenderedRectsForMarkers(); |
| 1096 } | 1096 } |
| 1097 | 1097 |
| 1098 // The plan is to move to compositor-queried paint invalidation, in which case t
his | 1098 // The plan is to move to compositor-queried paint invalidation, in which case t
his |
| 1099 // method would setNeedsRedraw on the GraphicsLayers with invalidations and | 1099 // method would setNeedsRedraw on the GraphicsLayers with invalidations and |
| 1100 // let the compositor pick which to actually draw. | 1100 // let the compositor pick which to actually draw. |
| 1101 // See http://crbug.com/306706 | 1101 // See http://crbug.com/306706 |
| 1102 void FrameView::invalidateTreeIfNeeded(Vector<LayoutObject*>& pendingDelayedPain
tInvalidations) | 1102 void FrameView::invalidateTreeIfNeeded(PaintInvalidationState& paintInvalidation
State) |
| 1103 { | 1103 { |
| 1104 lifecycle().advanceTo(DocumentLifecycle::InPaintInvalidation); |
| 1105 |
| 1104 ASSERT(layoutView()); | 1106 ASSERT(layoutView()); |
| 1105 LayoutView& rootForPaintInvalidation = *layoutView(); | 1107 LayoutView& rootForPaintInvalidation = *layoutView(); |
| 1106 ASSERT(!rootForPaintInvalidation.needsLayout()); | 1108 ASSERT(!rootForPaintInvalidation.needsLayout()); |
| 1107 | 1109 |
| 1108 TRACE_EVENT1("blink", "FrameView::invalidateTree", "root", rootForPaintInval
idation.debugName().ascii()); | 1110 TRACE_EVENT1("blink", "FrameView::invalidateTree", "root", rootForPaintInval
idation.debugName().ascii()); |
| 1109 | 1111 |
| 1110 PaintInvalidationState rootPaintInvalidationState(rootForPaintInvalidation,
pendingDelayedPaintInvalidations); | |
| 1111 | |
| 1112 // In slimming paint mode we do per-object invalidation. | 1112 // In slimming paint mode we do per-object invalidation. |
| 1113 if (m_doFullPaintInvalidation && !RuntimeEnabledFeatures::slimmingPaintEnabl
ed()) | 1113 if (m_doFullPaintInvalidation && !RuntimeEnabledFeatures::slimmingPaintEnabl
ed()) |
| 1114 layoutView()->compositor()->fullyInvalidatePaint(); | 1114 layoutView()->compositor()->fullyInvalidatePaint(); |
| 1115 | 1115 |
| 1116 rootForPaintInvalidation.invalidateTreeIfNeeded(rootPaintInvalidationState); | 1116 rootForPaintInvalidation.invalidateTreeIfNeeded(paintInvalidationState); |
| 1117 | 1117 |
| 1118 // Invalidate the paint of the frameviews scrollbars if needed | 1118 // Invalidate the paint of the frameviews scrollbars if needed |
| 1119 if (hasVerticalBarDamage()) | 1119 if (hasVerticalBarDamage()) |
| 1120 invalidateRect(verticalBarDamage()); | 1120 invalidateRect(verticalBarDamage()); |
| 1121 if (hasHorizontalBarDamage()) | 1121 if (hasHorizontalBarDamage()) |
| 1122 invalidateRect(horizontalBarDamage()); | 1122 invalidateRect(horizontalBarDamage()); |
| 1123 resetScrollbarDamage(); | 1123 resetScrollbarDamage(); |
| 1124 | 1124 |
| 1125 #if ENABLE(ASSERT) | 1125 #if ENABLE(ASSERT) |
| 1126 layoutView()->assertSubtreeClearedPaintInvalidationState(); | 1126 layoutView()->assertSubtreeClearedPaintInvalidationState(); |
| 1127 #endif | 1127 #endif |
| 1128 | 1128 |
| 1129 if (m_frame->selection().isCaretBoundsDirty()) | 1129 if (m_frame->selection().isCaretBoundsDirty()) |
| 1130 m_frame->selection().invalidateCaretRect(); | 1130 m_frame->selection().invalidateCaretRect(); |
| 1131 |
| 1132 m_doFullPaintInvalidation = false; |
| 1133 lifecycle().advanceTo(DocumentLifecycle::PaintInvalidationClean); |
| 1131 } | 1134 } |
| 1132 | 1135 |
| 1133 DocumentLifecycle& FrameView::lifecycle() const | 1136 DocumentLifecycle& FrameView::lifecycle() const |
| 1134 { | 1137 { |
| 1135 return m_frame->document()->lifecycle(); | 1138 return m_frame->document()->lifecycle(); |
| 1136 } | 1139 } |
| 1137 | 1140 |
| 1138 LayoutBox* FrameView::embeddedContentBox() const | 1141 LayoutBox* FrameView::embeddedContentBox() const |
| 1139 { | 1142 { |
| 1140 LayoutView* layoutView = this->layoutView(); | 1143 LayoutView* layoutView = this->layoutView(); |
| (...skipping 1438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2579 ASSERT(!m_frame->document()->hasSVGFilterElementsRequiringLayerUpdate()); | 2582 ASSERT(!m_frame->document()->hasSVGFilterElementsRequiringLayerUpdate()); |
| 2580 #if ENABLE(ASSERT) | 2583 #if ENABLE(ASSERT) |
| 2581 m_frame->document()->layoutView()->assertLaidOut(); | 2584 m_frame->document()->layoutView()->assertLaidOut(); |
| 2582 #endif | 2585 #endif |
| 2583 | 2586 |
| 2584 updateWidgetPositionsIfNeeded(); | 2587 updateWidgetPositionsIfNeeded(); |
| 2585 } | 2588 } |
| 2586 | 2589 |
| 2587 void FrameView::invalidateTreeIfNeededRecursive() | 2590 void FrameView::invalidateTreeIfNeededRecursive() |
| 2588 { | 2591 { |
| 2589 // FIXME: We should be more aggressive at cutting tree traversals. | 2592 ASSERT(layoutView()); |
| 2590 lifecycle().advanceTo(DocumentLifecycle::InPaintInvalidation); | 2593 TRACE_EVENT1("blink", "FrameView::invalidateTreeIfNeededRecursive", "root",
layoutView()->debugName().ascii()); |
| 2591 | 2594 |
| 2592 Vector<LayoutObject*> pendingDelayedPaintInvalidations; | 2595 Vector<LayoutObject*> pendingDelayedPaintInvalidations; |
| 2596 PaintInvalidationState rootPaintInvalidationState(*layoutView(), pendingDela
yedPaintInvalidations); |
| 2593 | 2597 |
| 2594 invalidateTreeIfNeeded(pendingDelayedPaintInvalidations); | 2598 invalidateTreeIfNeeded(rootPaintInvalidationState); |
| 2595 | 2599 |
| 2600 // Some frames may be not reached during the above invalidateTreeIfNeeded be
cause |
| 2601 // - the frame is a detached frame; or |
| 2602 // - it didn't need paint invalidation. |
| 2603 // We need to call invalidateTreeIfNeededRecursive() for such frames to fini
sh required |
| 2604 // paint invalidation and advance their life cycle state. |
| 2596 for (Frame* child = m_frame->tree().firstChild(); child; child = child->tree
().nextSibling()) { | 2605 for (Frame* child = m_frame->tree().firstChild(); child; child = child->tree
().nextSibling()) { |
| 2597 if (!child->isLocalFrame()) | 2606 if (!child->isLocalFrame()) |
| 2598 continue; | 2607 continue; |
| 2599 | 2608 FrameView* childFrameView = toLocalFrame(child)->view(); |
| 2600 toLocalFrame(child)->view()->invalidateTreeIfNeededRecursive(); | 2609 if (childFrameView->lifecycle().state() < DocumentLifecycle::PaintInvali
dationClean) |
| 2610 childFrameView->invalidateTreeIfNeededRecursive(); |
| 2601 } | 2611 } |
| 2602 | 2612 |
| 2603 m_doFullPaintInvalidation = false; | |
| 2604 lifecycle().advanceTo(DocumentLifecycle::PaintInvalidationClean); | |
| 2605 | |
| 2606 // Process objects needing paint invalidation on the next frame. See the def
inition of PaintInvalidationDelayedFull for more details. | 2613 // Process objects needing paint invalidation on the next frame. See the def
inition of PaintInvalidationDelayedFull for more details. |
| 2607 for (auto& target : pendingDelayedPaintInvalidations) | 2614 for (auto& target : pendingDelayedPaintInvalidations) |
| 2608 target->setShouldDoFullPaintInvalidation(PaintInvalidationDelayedFull); | 2615 target->setShouldDoFullPaintInvalidation(PaintInvalidationDelayedFull); |
| 2609 } | 2616 } |
| 2610 | 2617 |
| 2611 void FrameView::enableAutoSizeMode(const IntSize& minSize, const IntSize& maxSiz
e) | 2618 void FrameView::enableAutoSizeMode(const IntSize& minSize, const IntSize& maxSiz
e) |
| 2612 { | 2619 { |
| 2613 if (!m_autoSizeInfo) | 2620 if (!m_autoSizeInfo) |
| 2614 m_autoSizeInfo = FrameViewAutoSizeInfo::create(this); | 2621 m_autoSizeInfo = FrameViewAutoSizeInfo::create(this); |
| 2615 | 2622 |
| (...skipping 1355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3971 | 3978 |
| 3972 if (!graphicsLayer) | 3979 if (!graphicsLayer) |
| 3973 return; | 3980 return; |
| 3974 | 3981 |
| 3975 DeprecatedPaintLayer::mapRectToPaintInvalidationBacking(localFrame->contentL
ayoutObject(), paintInvalidationContainer, viewRect); | 3982 DeprecatedPaintLayer::mapRectToPaintInvalidationBacking(localFrame->contentL
ayoutObject(), paintInvalidationContainer, viewRect); |
| 3976 | 3983 |
| 3977 graphicsLayerTimingRequests.add(graphicsLayer, Vector<std::pair<int64_t, Web
Rect>>()).storedValue->value.append(std::make_pair(m_frame->frameID(), enclosing
IntRect(viewRect))); | 3984 graphicsLayerTimingRequests.add(graphicsLayer, Vector<std::pair<int64_t, Web
Rect>>()).storedValue->value.append(std::make_pair(m_frame->frameID(), enclosing
IntRect(viewRect))); |
| 3978 } | 3985 } |
| 3979 | 3986 |
| 3980 } // namespace blink | 3987 } // namespace blink |
| OLD | NEW |