| 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 2413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2424 if (!m_needsUpdateWidgetPositions) | 2424 if (!m_needsUpdateWidgetPositions) |
| 2425 return; | 2425 return; |
| 2426 | 2426 |
| 2427 m_needsUpdateWidgetPositions = false; | 2427 m_needsUpdateWidgetPositions = false; |
| 2428 | 2428 |
| 2429 updateWidgetPositions(); | 2429 updateWidgetPositions(); |
| 2430 } | 2430 } |
| 2431 | 2431 |
| 2432 void FrameView::updateAllLifecyclePhases() | 2432 void FrameView::updateAllLifecyclePhases() |
| 2433 { | 2433 { |
| 2434 frame().localFrameRoot()->view()->updateAllLifecyclePhasesInternal(); | 2434 frame().localFrameRoot()->view()->updateLifecyclePhasesInternal(AllPhases); |
| 2435 } | 2435 } |
| 2436 | 2436 |
| 2437 // TODO(chrishtr): add a scrolling update lifecycle phase, after compositing and
before invalidation. | 2437 // TODO(chrishtr): add a scrolling update lifecycle phase, after compositing and
before invalidation. |
| 2438 void FrameView::updateLifecycleToCompositingCleanPlusScrolling() | 2438 void FrameView::updateLifecycleToCompositingCleanPlusScrolling() |
| 2439 { | 2439 { |
| 2440 frame().localFrameRoot()->view()->updateStyleAndLayoutIfNeededRecursive(); | 2440 frame().localFrameRoot()->view()->updateLifecyclePhasesInternal(OnlyUpToComp
ositingCleanPlusScrolling); |
| 2441 LayoutView* view = layoutView(); | |
| 2442 if (view) | |
| 2443 view->compositor()->updateIfNeededRecursive(); | |
| 2444 scrollContentsIfNeededRecursive(); | |
| 2445 | |
| 2446 ASSERT(lifecycle().state() >= DocumentLifecycle::CompositingClean); | |
| 2447 } | 2441 } |
| 2448 | 2442 |
| 2449 void FrameView::updateAllLifecyclePhasesInternal() | 2443 void FrameView::updateLifecyclePhasesInternal(LifeCycleUpdateOption phases) |
| 2450 { | 2444 { |
| 2451 // This must be called from the root frame, since it recurses down, not up. | 2445 // This must be called from the root frame, since it recurses down, not up. |
| 2452 // Otherwise the lifecycles of the frames might be out of sync. | 2446 // Otherwise the lifecycles of the frames might be out of sync. |
| 2453 ASSERT(m_frame->isLocalRoot()); | 2447 ASSERT(m_frame->isLocalRoot()); |
| 2454 | 2448 |
| 2455 // Updating layout can run script, which can tear down the FrameView. | 2449 // Updating layout can run script, which can tear down the FrameView. |
| 2456 RefPtrWillBeRawPtr<FrameView> protector(this); | 2450 RefPtrWillBeRawPtr<FrameView> protector(this); |
| 2457 | 2451 |
| 2458 updateStyleAndLayoutIfNeededRecursive(); | 2452 updateStyleAndLayoutIfNeededRecursive(); |
| 2459 | 2453 |
| 2460 if (LayoutView* view = layoutView()) { | 2454 if (LayoutView* view = layoutView()) { |
| 2461 TRACE_EVENT1("devtools.timeline", "UpdateLayerTree", "data", InspectorUp
dateLayerTreeEvent::data(m_frame.get())); | 2455 TRACE_EVENT1("devtools.timeline", "UpdateLayerTree", "data", InspectorUp
dateLayerTreeEvent::data(m_frame.get())); |
| 2462 | 2456 |
| 2463 view->compositor()->updateIfNeededRecursive(); | 2457 view->compositor()->updateIfNeededRecursive(); |
| 2464 scrollContentsIfNeededRecursive(); | 2458 scrollContentsIfNeededRecursive(); |
| 2465 invalidateTreeIfNeededRecursive(); | |
| 2466 | 2459 |
| 2467 if (view->compositor()->inCompositingMode()) | 2460 ASSERT(lifecycle().state() >= DocumentLifecycle::CompositingClean); |
| 2468 scrollingCoordinator()->updateAfterCompositingChangeIfNeeded(); | |
| 2469 | 2461 |
| 2470 updateCompositedSelectionIfNeeded(); | 2462 if (phases == AllPhases) { |
| 2471 if (RuntimeEnabledFeatures::frameTimingSupportEnabled()) | 2463 invalidateTreeIfNeededRecursive(); |
| 2472 updateFrameTimingRequestsIfNeeded(); | |
| 2473 | 2464 |
| 2474 ASSERT(!view->hasPendingSelection()); | 2465 if (view->compositor()->inCompositingMode()) |
| 2466 scrollingCoordinator()->updateAfterCompositingChangeIfNeeded(); |
| 2467 |
| 2468 updateCompositedSelectionIfNeeded(); |
| 2469 if (RuntimeEnabledFeatures::frameTimingSupportEnabled()) |
| 2470 updateFrameTimingRequestsIfNeeded(); |
| 2471 |
| 2472 ASSERT(!view->hasPendingSelection()); |
| 2473 ASSERT(lifecycle().state() == DocumentLifecycle::PaintInvalidationCl
ean); |
| 2474 } |
| 2475 } | 2475 } |
| 2476 | |
| 2477 ASSERT(lifecycle().state() == DocumentLifecycle::PaintInvalidationClean); | |
| 2478 } | 2476 } |
| 2479 | 2477 |
| 2480 void FrameView::updateFrameTimingRequestsIfNeeded() | 2478 void FrameView::updateFrameTimingRequestsIfNeeded() |
| 2481 { | 2479 { |
| 2482 GraphicsLayerFrameTimingRequests graphicsLayerTimingRequests; | 2480 GraphicsLayerFrameTimingRequests graphicsLayerTimingRequests; |
| 2483 // TODO(mpb) use a 'dirty' bit to not call this every time. | 2481 // TODO(mpb) use a 'dirty' bit to not call this every time. |
| 2484 collectFrameTimingRequestsRecursive(graphicsLayerTimingRequests); | 2482 collectFrameTimingRequestsRecursive(graphicsLayerTimingRequests); |
| 2485 | 2483 |
| 2486 for (const auto& iter : graphicsLayerTimingRequests) { | 2484 for (const auto& iter : graphicsLayerTimingRequests) { |
| 2487 const GraphicsLayer* graphicsLayer = iter.key; | 2485 const GraphicsLayer* graphicsLayer = iter.key; |
| (...skipping 1434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3922 | 3920 |
| 3923 if (!graphicsLayer) | 3921 if (!graphicsLayer) |
| 3924 return; | 3922 return; |
| 3925 | 3923 |
| 3926 DeprecatedPaintLayer::mapRectToPaintInvalidationBacking(localFrame->contentL
ayoutObject(), paintInvalidationContainer, viewRect); | 3924 DeprecatedPaintLayer::mapRectToPaintInvalidationBacking(localFrame->contentL
ayoutObject(), paintInvalidationContainer, viewRect); |
| 3927 | 3925 |
| 3928 graphicsLayerTimingRequests.add(graphicsLayer, Vector<std::pair<int64_t, Web
Rect>>()).storedValue->value.append(std::make_pair(m_frame->frameID(), enclosing
IntRect(viewRect))); | 3926 graphicsLayerTimingRequests.add(graphicsLayer, Vector<std::pair<int64_t, Web
Rect>>()).storedValue->value.append(std::make_pair(m_frame->frameID(), enclosing
IntRect(viewRect))); |
| 3929 } | 3927 } |
| 3930 | 3928 |
| 3931 } // namespace blink | 3929 } // namespace blink |
| OLD | NEW |