Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: third_party/WebKit/Source/core/frame/FrameView.cpp

Issue 1391753005: (WIP) Invalidation during painting (for synchronized painting) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1077 matching lines...) Expand 10 before | Expand all | Expand 10 after
1088 1088
1089 lifecycle().advanceTo(DocumentLifecycle::InPaintInvalidation); 1089 lifecycle().advanceTo(DocumentLifecycle::InPaintInvalidation);
1090 1090
1091 RELEASE_ASSERT(layoutView()); 1091 RELEASE_ASSERT(layoutView());
1092 LayoutView& rootForPaintInvalidation = *layoutView(); 1092 LayoutView& rootForPaintInvalidation = *layoutView();
1093 ASSERT(!rootForPaintInvalidation.needsLayout()); 1093 ASSERT(!rootForPaintInvalidation.needsLayout());
1094 1094
1095 TRACE_EVENT1("blink", "FrameView::invalidateTree", "root", rootForPaintInval idation.debugName().ascii()); 1095 TRACE_EVENT1("blink", "FrameView::invalidateTree", "root", rootForPaintInval idation.debugName().ascii());
1096 1096
1097 rootForPaintInvalidation.invalidateTreeIfNeeded(paintInvalidationState); 1097 rootForPaintInvalidation.invalidateTreeIfNeeded(paintInvalidationState);
1098 invalidatePaintIfNeeded();
1099 lifecycle().advanceTo(DocumentLifecycle::PaintInvalidationClean);
1100 }
1098 1101
1102 void FrameView::invalidatePaintIfNeeded()
1103 {
1099 if (!m_frame->settings() || !m_frame->settings()->rootLayerScrolls()) { 1104 if (!m_frame->settings() || !m_frame->settings()->rootLayerScrolls()) {
1100 paintInvalidationState.setViewClippingAndScrollOffsetDisabled(true); 1105 paintInvalidationState.setViewClippingAndScrollOffsetDisabled(true);
1101 invalidatePaintOfScrollControlsIfNeeded(paintInvalidationState, paintInv alidationState.paintInvalidationContainer()); 1106 invalidatePaintOfScrollControlsIfNeeded(paintInvalidationState, paintInv alidationState.paintInvalidationContainer());
1102 paintInvalidationState.setViewClippingAndScrollOffsetDisabled(false); 1107 paintInvalidationState.setViewClippingAndScrollOffsetDisabled(false);
1103 } 1108 }
1104 1109
1105 #if ENABLE(ASSERT) 1110 #if ENABLE(ASSERT)
1106 layoutView()->assertSubtreeClearedPaintInvalidationState(); 1111 if (!RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled())
1112 layoutView()->assertSubtreeClearedPaintInvalidationState();
1107 #endif 1113 #endif
1108 1114
1109 if (m_frame->selection().isCaretBoundsDirty()) 1115 if (m_frame->selection().isCaretBoundsDirty())
1110 m_frame->selection().invalidateCaretRect(); 1116 m_frame->selection().invalidateCaretRect();
1111 1117
1112 m_doFullPaintInvalidation = false; 1118 m_doFullPaintInvalidation = false;
1113 lifecycle().advanceTo(DocumentLifecycle::PaintInvalidationClean);
1114 1119
1115 // Temporary callback for crbug.com/487345,402044 1120 // Temporary callback for crbug.com/487345,402044
1116 // TODO(ojan): Make this more general to be used by PositionObserver 1121 // TODO(ojan): Make this more general to be used by PositionObserver
1117 // and rAF throttling. 1122 // and rAF throttling.
1118 IntRect visibleRect = rootFrameToContents(computeVisibleArea()); 1123 IntRect visibleRect = rootFrameToContents(computeVisibleArea());
1119 rootForPaintInvalidation.sendMediaPositionChangeNotifications(visibleRect); 1124 rootForPaintInvalidation.sendMediaPositionChangeNotifications(visibleRect);
1120 } 1125 }
1121 1126
1122 IntRect FrameView::computeVisibleArea() 1127 IntRect FrameView::computeVisibleArea()
1123 { 1128 {
(...skipping 1361 matching lines...) Expand 10 before | Expand all | Expand 10 after
2485 TRACE_EVENT1("devtools.timeline", "UpdateLayerTree", "data", Inspect orUpdateLayerTreeEvent::data(m_frame.get())); 2490 TRACE_EVENT1("devtools.timeline", "UpdateLayerTree", "data", Inspect orUpdateLayerTreeEvent::data(m_frame.get()));
2486 2491
2487 // This was required for slimming paint v1 but is only temporarily 2492 // This was required for slimming paint v1 but is only temporarily
2488 // needed for slimming paint v2. 2493 // needed for slimming paint v2.
2489 view->compositor()->updateIfNeededRecursive(); 2494 view->compositor()->updateIfNeededRecursive();
2490 scrollContentsIfNeededRecursive(); 2495 scrollContentsIfNeededRecursive();
2491 2496
2492 ASSERT(lifecycle().state() >= DocumentLifecycle::CompositingClean); 2497 ASSERT(lifecycle().state() >= DocumentLifecycle::CompositingClean);
2493 2498
2494 if (phases == AllPhases) { 2499 if (phases == AllPhases) {
2495 invalidateTreeIfNeededRecursive(); 2500 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled())
2501 invalidateTreeIfNeededRecursive();
2496 2502
2497 if (view->compositor()->inCompositingMode()) 2503 if (view->compositor()->inCompositingMode())
2498 scrollingCoordinator()->updateAfterCompositingChangeIfNeeded (); 2504 scrollingCoordinator()->updateAfterCompositingChangeIfNeeded ();
2499 2505
2500 updateCompositedSelectionIfNeeded(); 2506 updateCompositedSelectionIfNeeded();
2501 } 2507 }
2502 } 2508 }
2503 2509
2504 if (phases == AllPhases) { 2510 if (phases == AllPhases) {
2505 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) 2511 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled())
(...skipping 1621 matching lines...) Expand 10 before | Expand all | Expand 10 after
4127 return m_hiddenForThrottling && m_crossOriginForThrottling; 4133 return m_hiddenForThrottling && m_crossOriginForThrottling;
4128 } 4134 }
4129 4135
4130 LayoutBox& FrameView::boxForScrollControlPaintInvalidation() const 4136 LayoutBox& FrameView::boxForScrollControlPaintInvalidation() const
4131 { 4137 {
4132 ASSERT(layoutView()); 4138 ASSERT(layoutView());
4133 return *layoutView(); 4139 return *layoutView();
4134 } 4140 }
4135 4141
4136 } // namespace blink 4142 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.h ('k') | third_party/WebKit/Source/core/layout/LayoutBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698