Chromium Code Reviews| 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 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1095 if (frame().page()) | 1095 if (frame().page()) |
| 1096 frame().page()->chromeClient().layoutUpdated(m_frame.get()); | 1096 frame().page()->chromeClient().layoutUpdated(m_frame.get()); |
| 1097 | 1097 |
| 1098 frame().document()->markers().updateRenderedRectsForMarkers(); | 1098 frame().document()->markers().updateRenderedRectsForMarkers(); |
| 1099 } | 1099 } |
| 1100 | 1100 |
| 1101 // The plan is to move to compositor-queried paint invalidation, in which case t his | 1101 // The plan is to move to compositor-queried paint invalidation, in which case t his |
| 1102 // method would setNeedsRedraw on the GraphicsLayers with invalidations and | 1102 // method would setNeedsRedraw on the GraphicsLayers with invalidations and |
| 1103 // let the compositor pick which to actually draw. | 1103 // let the compositor pick which to actually draw. |
| 1104 // See http://crbug.com/306706 | 1104 // See http://crbug.com/306706 |
| 1105 void FrameView::invalidateTreeIfNeeded(Vector<LayoutObject*>& pendingDelayedPain tInvalidations) | 1105 void FrameView::invalidateTreeIfNeeded(PaintInvalidationState& paintInvalidation State) |
|
chrishtr
2015/06/29 23:32:22
Do you need to clean out some of these fields if i
Xianzhu
2015/06/30 00:02:12
No. This paintInvalidationState should be just for
| |
| 1106 { | 1106 { |
| 1107 // FIXME: We should be more aggressive at cutting tree traversals. | |
|
chrishtr
2015/06/29 23:32:22
Change to TODO(wangxianzhu)
Xianzhu
2015/06/30 00:02:12
This is moved from invalidateTreeIfNeededRecursive
| |
| 1108 lifecycle().advanceTo(DocumentLifecycle::InPaintInvalidation); | |
| 1109 | |
| 1107 ASSERT(layoutView()); | 1110 ASSERT(layoutView()); |
| 1108 LayoutView& rootForPaintInvalidation = *layoutView(); | 1111 LayoutView& rootForPaintInvalidation = *layoutView(); |
| 1109 ASSERT(!rootForPaintInvalidation.needsLayout()); | 1112 ASSERT(!rootForPaintInvalidation.needsLayout()); |
| 1110 | 1113 |
| 1111 TRACE_EVENT1("blink", "FrameView::invalidateTree", "root", rootForPaintInval idation.debugName().ascii()); | 1114 TRACE_EVENT1("blink", "FrameView::invalidateTree", "root", rootForPaintInval idation.debugName().ascii()); |
| 1112 | 1115 |
| 1113 PaintInvalidationState rootPaintInvalidationState(rootForPaintInvalidation, pendingDelayedPaintInvalidations); | |
| 1114 | |
| 1115 // In slimming paint mode we do per-object invalidation. | 1116 // In slimming paint mode we do per-object invalidation. |
| 1116 if (m_doFullPaintInvalidation && !RuntimeEnabledFeatures::slimmingPaintEnabl ed()) | 1117 if (m_doFullPaintInvalidation && !RuntimeEnabledFeatures::slimmingPaintEnabl ed()) |
| 1117 layoutView()->compositor()->fullyInvalidatePaint(); | 1118 layoutView()->compositor()->fullyInvalidatePaint(); |
| 1118 | 1119 |
| 1119 rootForPaintInvalidation.invalidateTreeIfNeeded(rootPaintInvalidationState); | 1120 rootForPaintInvalidation.invalidateTreeIfNeeded(paintInvalidationState); |
| 1120 | 1121 |
| 1121 // Invalidate the paint of the frameviews scrollbars if needed | 1122 // Invalidate the paint of the frameviews scrollbars if needed |
| 1122 if (hasVerticalBarDamage()) | 1123 if (hasVerticalBarDamage()) |
| 1123 invalidateRect(verticalBarDamage()); | 1124 invalidateRect(verticalBarDamage()); |
| 1124 if (hasHorizontalBarDamage()) | 1125 if (hasHorizontalBarDamage()) |
| 1125 invalidateRect(horizontalBarDamage()); | 1126 invalidateRect(horizontalBarDamage()); |
| 1126 resetScrollbarDamage(); | 1127 resetScrollbarDamage(); |
| 1127 | 1128 |
| 1128 #if ENABLE(ASSERT) | 1129 #if ENABLE(ASSERT) |
| 1129 layoutView()->assertSubtreeClearedPaintInvalidationState(); | 1130 layoutView()->assertSubtreeClearedPaintInvalidationState(); |
| 1130 #endif | 1131 #endif |
| 1131 | 1132 |
| 1132 if (m_frame->selection().isCaretBoundsDirty()) | 1133 if (m_frame->selection().isCaretBoundsDirty()) |
| 1133 m_frame->selection().invalidateCaretRect(); | 1134 m_frame->selection().invalidateCaretRect(); |
| 1135 | |
| 1136 m_doFullPaintInvalidation = false; | |
| 1137 lifecycle().advanceTo(DocumentLifecycle::PaintInvalidationClean); | |
| 1134 } | 1138 } |
| 1135 | 1139 |
| 1136 DocumentLifecycle& FrameView::lifecycle() const | 1140 DocumentLifecycle& FrameView::lifecycle() const |
| 1137 { | 1141 { |
| 1138 return m_frame->document()->lifecycle(); | 1142 return m_frame->document()->lifecycle(); |
| 1139 } | 1143 } |
| 1140 | 1144 |
| 1141 LayoutBox* FrameView::embeddedContentBox() const | 1145 LayoutBox* FrameView::embeddedContentBox() const |
| 1142 { | 1146 { |
| 1143 LayoutView* layoutView = this->layoutView(); | 1147 LayoutView* layoutView = this->layoutView(); |
| (...skipping 1438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2582 ASSERT(!m_frame->document()->hasSVGFilterElementsRequiringLayerUpdate()); | 2586 ASSERT(!m_frame->document()->hasSVGFilterElementsRequiringLayerUpdate()); |
| 2583 #if ENABLE(ASSERT) | 2587 #if ENABLE(ASSERT) |
| 2584 m_frame->document()->layoutView()->assertLaidOut(); | 2588 m_frame->document()->layoutView()->assertLaidOut(); |
| 2585 #endif | 2589 #endif |
| 2586 | 2590 |
| 2587 updateWidgetPositionsIfNeeded(); | 2591 updateWidgetPositionsIfNeeded(); |
| 2588 } | 2592 } |
| 2589 | 2593 |
| 2590 void FrameView::invalidateTreeIfNeededRecursive() | 2594 void FrameView::invalidateTreeIfNeededRecursive() |
| 2591 { | 2595 { |
| 2592 // FIXME: We should be more aggressive at cutting tree traversals. | 2596 ASSERT(layoutView()); |
| 2593 lifecycle().advanceTo(DocumentLifecycle::InPaintInvalidation); | 2597 TRACE_EVENT1("blink", "FrameView::invalidateTreeIfNeededRecursive", "root", layoutView()->debugName().ascii()); |
| 2594 | 2598 |
| 2595 Vector<LayoutObject*> pendingDelayedPaintInvalidations; | 2599 Vector<LayoutObject*> pendingDelayedPaintInvalidations; |
| 2600 PaintInvalidationState rootPaintInvalidationState(*layoutView(), pendingDela yedPaintInvalidations); | |
| 2596 | 2601 |
| 2597 invalidateTreeIfNeeded(pendingDelayedPaintInvalidations); | 2602 invalidateTreeIfNeeded(rootPaintInvalidationState); |
| 2598 | 2603 |
| 2599 for (Frame* child = m_frame->tree().firstChild(); child; child = child->tree ().nextSibling()) { | 2604 for (Frame* child = m_frame->tree().firstChild(); child; child = child->tree ().nextSibling()) { |
| 2600 if (!child->isLocalFrame()) | 2605 if (!child->isLocalFrame()) |
| 2601 continue; | 2606 continue; |
| 2602 | 2607 |
| 2603 toLocalFrame(child)->view()->invalidateTreeIfNeededRecursive(); | 2608 // The child frame should either has done paint invalidation via the con taining LayoutPart, |
| 2609 // or need to advance the lifecycle here because it didn't need and do p aint invalidation. | |
| 2610 FrameView* childFrameView = toLocalFrame(child)->view(); | |
| 2611 ASSERT(!childFrameView->layoutView()->shouldCheckForPaintInvalidationReg ardlessOfPaintInvalidationState()); | |
| 2612 DocumentLifecycle& childLifecycle = childFrameView->lifecycle(); | |
| 2613 if (childLifecycle.state() < DocumentLifecycle::PaintInvalidationClean) { | |
| 2614 childLifecycle.advanceTo(DocumentLifecycle::InPaintInvalidation); | |
| 2615 childLifecycle.advanceTo(DocumentLifecycle::PaintInvalidationClean); | |
| 2616 } | |
| 2604 } | 2617 } |
| 2605 | 2618 |
| 2606 m_doFullPaintInvalidation = false; | |
| 2607 lifecycle().advanceTo(DocumentLifecycle::PaintInvalidationClean); | |
| 2608 | |
| 2609 // Process objects needing paint invalidation on the next frame. See the def inition of PaintInvalidationDelayedFull for more details. | 2619 // Process objects needing paint invalidation on the next frame. See the def inition of PaintInvalidationDelayedFull for more details. |
| 2610 for (auto& target : pendingDelayedPaintInvalidations) | 2620 for (auto& target : pendingDelayedPaintInvalidations) |
| 2611 target->setShouldDoFullPaintInvalidation(PaintInvalidationDelayedFull); | 2621 target->setShouldDoFullPaintInvalidation(PaintInvalidationDelayedFull); |
| 2612 } | 2622 } |
| 2613 | 2623 |
| 2614 void FrameView::enableAutoSizeMode(const IntSize& minSize, const IntSize& maxSiz e) | 2624 void FrameView::enableAutoSizeMode(const IntSize& minSize, const IntSize& maxSiz e) |
| 2615 { | 2625 { |
| 2616 if (!m_autoSizeInfo) | 2626 if (!m_autoSizeInfo) |
| 2617 m_autoSizeInfo = FrameViewAutoSizeInfo::create(this); | 2627 m_autoSizeInfo = FrameViewAutoSizeInfo::create(this); |
| 2618 | 2628 |
| (...skipping 1353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3972 | 3982 |
| 3973 if (!graphicsLayer) | 3983 if (!graphicsLayer) |
| 3974 return; | 3984 return; |
| 3975 | 3985 |
| 3976 DeprecatedPaintLayer::mapRectToPaintInvalidationBacking(localFrame->contentL ayoutObject(), paintInvalidationContainer, viewRect); | 3986 DeprecatedPaintLayer::mapRectToPaintInvalidationBacking(localFrame->contentL ayoutObject(), paintInvalidationContainer, viewRect); |
| 3977 | 3987 |
| 3978 graphicsLayerTimingRequests.add(graphicsLayer, Vector<std::pair<int64_t, Web Rect>>()).storedValue->value.append(std::make_pair(m_frame->frameID(), enclosing IntRect(viewRect))); | 3988 graphicsLayerTimingRequests.add(graphicsLayer, Vector<std::pair<int64_t, Web Rect>>()).storedValue->value.append(std::make_pair(m_frame->frameID(), enclosing IntRect(viewRect))); |
| 3979 } | 3989 } |
| 3980 | 3990 |
| 3981 } // namespace blink | 3991 } // namespace blink |
| OLD | NEW |