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 2418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2429 if (!m_needsUpdateWidgetPositions) | 2429 if (!m_needsUpdateWidgetPositions) |
| 2430 return; | 2430 return; |
| 2431 | 2431 |
| 2432 m_needsUpdateWidgetPositions = false; | 2432 m_needsUpdateWidgetPositions = false; |
| 2433 | 2433 |
| 2434 updateWidgetPositions(); | 2434 updateWidgetPositions(); |
| 2435 } | 2435 } |
| 2436 | 2436 |
| 2437 void FrameView::updateAllLifecyclePhases() | 2437 void FrameView::updateAllLifecyclePhases() |
| 2438 { | 2438 { |
| 2439 frame().localFrameRoot()->view()->updateAllLifecyclePhasesInternal(); | 2439 frame().localFrameRoot()->view()->updateLifecyclePhasesInternal(AllPhases); |
| 2440 } | 2440 } |
| 2441 | 2441 |
| 2442 // TODO(chrishtr): add a scrolling update lifecycle phase, after compositing and before invalidation. | 2442 // TODO(chrishtr): add a scrolling update lifecycle phase, after compositing and before invalidation. |
| 2443 void FrameView::updateLifecycleToCompositingCleanPlusScrolling() | 2443 void FrameView::updateLifecycleToCompositingCleanPlusScrolling() |
| 2444 { | 2444 { |
| 2445 frame().localFrameRoot()->view()->updateStyleAndLayoutIfNeededRecursive(); | 2445 frame().localFrameRoot()->view()->updateLifecyclePhasesInternal(OnlyUpToComp ositingCleanPlusScrolling); |
| 2446 LayoutView* view = layoutView(); | |
| 2447 if (view) | |
| 2448 view->compositor()->updateIfNeededRecursive(); | |
| 2449 scrollContentsIfNeededRecursive(); | |
| 2450 | |
| 2451 ASSERT(lifecycle().state() >= DocumentLifecycle::CompositingClean); | |
| 2452 } | 2446 } |
| 2453 | 2447 |
| 2454 void FrameView::updateAllLifecyclePhasesInternal() | 2448 void FrameView::updateLifecyclePhasesInternal(LifeCycleUpdateOption phases) |
| 2455 { | 2449 { |
| 2456 // This must be called from the root frame, since it recurses down, not up. Otherwise the lifecycles of the frames might be out of sync. | 2450 // This must be called from the root frame, since it recurses down, not up. Otherwise the lifecycles of the frames might be out of sync. |
| 2457 ASSERT(frame() == page()->mainFrame() || (!frame().tree().parent()->isLocalF rame())); | 2451 ASSERT(frame() == page()->mainFrame() || (!frame().tree().parent()->isLocalF rame())); |
| 2458 | 2452 |
| 2459 // Updating layout can run script, which can tear down the FrameView. | 2453 // Updating layout can run script, which can tear down the FrameView. |
| 2460 RefPtrWillBeRawPtr<FrameView> protector(this); | 2454 RefPtrWillBeRawPtr<FrameView> protector(this); |
| 2461 | 2455 |
| 2462 updateStyleAndLayoutIfNeededRecursive(); | 2456 updateStyleAndLayoutIfNeededRecursive(); |
| 2463 | 2457 |
| 2464 LayoutView* view = layoutView(); | 2458 if (LayoutView* view = layoutView()) { |
| 2465 if (view) { | |
| 2466 TRACE_EVENT1("devtools.timeline", "UpdateLayerTree", "data", InspectorUp dateLayerTreeEvent::data(m_frame.get())); | 2459 TRACE_EVENT1("devtools.timeline", "UpdateLayerTree", "data", InspectorUp dateLayerTreeEvent::data(m_frame.get())); |
| 2467 | 2460 |
| 2468 view->compositor()->updateIfNeededRecursive(); | 2461 view->compositor()->updateIfNeededRecursive(); |
| 2469 scrollContentsIfNeededRecursive(); | 2462 scrollContentsIfNeededRecursive(); |
| 2470 invalidateTreeIfNeededRecursive(); | |
| 2471 updatePostLifecycleData(); | |
| 2472 | 2463 |
| 2473 ASSERT(!view->hasPendingSelection()); | 2464 ASSERT(lifecycle().state() >= DocumentLifecycle::CompositingClean); |
| 2465 | |
| 2466 if (phases == AllPhases) { | |
| 2467 invalidateTreeIfNeededRecursive(); | |
| 2468 updatePostLifecycleData(); | |
| 2469 | |
| 2470 ASSERT(!view->hasPendingSelection()); | |
| 2471 ASSERT(lifecycle().state() == DocumentLifecycle::PaintInvalidationCl ean); | |
|
ojan
2015/08/14 23:14:39
Please take another look.
Moved this assert into
| |
| 2472 } | |
| 2474 } | 2473 } |
| 2475 | |
| 2476 ASSERT(lifecycle().state() == DocumentLifecycle::PaintInvalidationClean); | |
| 2477 } | 2474 } |
| 2478 | 2475 |
| 2479 void FrameView::updatePostLifecycleData() | 2476 void FrameView::updatePostLifecycleData() |
| 2480 { | 2477 { |
| 2481 LayoutView* view = layoutView(); | 2478 LayoutView* view = layoutView(); |
| 2482 ASSERT(view); | 2479 ASSERT(view); |
| 2483 | 2480 |
| 2484 if (view->compositor()->inCompositingMode() && m_frame->isLocalRoot()) | 2481 if (view->compositor()->inCompositingMode() && m_frame->isLocalRoot()) |
| 2485 scrollingCoordinator()->updateAfterCompositingChangeIfNeeded(); | 2482 scrollingCoordinator()->updateAfterCompositingChangeIfNeeded(); |
| 2486 | 2483 |
| (...skipping 1447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3934 | 3931 |
| 3935 if (!graphicsLayer) | 3932 if (!graphicsLayer) |
| 3936 return; | 3933 return; |
| 3937 | 3934 |
| 3938 DeprecatedPaintLayer::mapRectToPaintInvalidationBacking(localFrame->contentL ayoutObject(), paintInvalidationContainer, viewRect); | 3935 DeprecatedPaintLayer::mapRectToPaintInvalidationBacking(localFrame->contentL ayoutObject(), paintInvalidationContainer, viewRect); |
| 3939 | 3936 |
| 3940 graphicsLayerTimingRequests.add(graphicsLayer, Vector<std::pair<int64_t, Web Rect>>()).storedValue->value.append(std::make_pair(m_frame->frameID(), enclosing IntRect(viewRect))); | 3937 graphicsLayerTimingRequests.add(graphicsLayer, Vector<std::pair<int64_t, Web Rect>>()).storedValue->value.append(std::make_pair(m_frame->frameID(), enclosing IntRect(viewRect))); |
| 3941 } | 3938 } |
| 3942 | 3939 |
| 3943 } // namespace blink | 3940 } // namespace blink |
| OLD | NEW |