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 2430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2441 if (!m_needsUpdateWidgetPositions) | 2441 if (!m_needsUpdateWidgetPositions) |
2442 return; | 2442 return; |
2443 | 2443 |
2444 m_needsUpdateWidgetPositions = false; | 2444 m_needsUpdateWidgetPositions = false; |
2445 | 2445 |
2446 updateWidgetPositions(); | 2446 updateWidgetPositions(); |
2447 } | 2447 } |
2448 | 2448 |
2449 void FrameView::updateAllLifecyclePhases() | 2449 void FrameView::updateAllLifecyclePhases() |
2450 { | 2450 { |
2451 frame().localFrameRoot()->view()->updateAllLifecyclePhasesInternal(); | 2451 frame().localFrameRoot()->view()->updateLifecyclePhasesInternal(AllPhases); |
2452 } | 2452 } |
2453 | 2453 |
2454 // TODO(chrishtr): add a scrolling update lifecycle phase, after compositing and
before invalidation. | 2454 // TODO(chrishtr): add a scrolling update lifecycle phase, after compositing and
before invalidation. |
2455 void FrameView::updateLifecycleToCompositingCleanPlusScrolling() | 2455 void FrameView::updateLifecycleToCompositingCleanPlusScrolling() |
2456 { | 2456 { |
2457 frame().localFrameRoot()->view()->updateStyleAndLayoutIfNeededRecursive(); | 2457 frame().localFrameRoot()->view()->updateLifecyclePhasesInternal(OnlyUpToComp
ositingClean); |
2458 LayoutView* view = layoutView(); | |
2459 if (view) | |
2460 view->compositor()->updateIfNeededRecursive(); | |
2461 scrollContentsIfNeededRecursive(); | |
2462 | |
2463 ASSERT(lifecycle().state() >= DocumentLifecycle::CompositingClean); | |
2464 } | 2458 } |
2465 | 2459 |
2466 void FrameView::updateAllLifecyclePhasesInternal() | 2460 void FrameView::updateLifecyclePhasesInternal(LifeCycleUpdateOption phases) |
2467 { | 2461 { |
2468 // 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. | 2462 // 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. |
2469 ASSERT(frame() == page()->mainFrame() || (!frame().tree().parent()->isLocalF
rame())); | 2463 ASSERT(frame() == page()->mainFrame() || (!frame().tree().parent()->isLocalF
rame())); |
2470 | 2464 |
2471 // Updating layout can run script, which can tear down the FrameView. | 2465 // Updating layout can run script, which can tear down the FrameView. |
2472 RefPtrWillBeRawPtr<FrameView> protector(this); | 2466 RefPtrWillBeRawPtr<FrameView> protector(this); |
2473 | 2467 |
2474 updateStyleAndLayoutIfNeededRecursive(); | 2468 updateStyleAndLayoutIfNeededRecursive(); |
2475 | 2469 |
2476 LayoutView* view = layoutView(); | 2470 LayoutView* view = layoutView(); |
2477 if (view) { | 2471 if (view) { |
2478 TRACE_EVENT1("devtools.timeline", "UpdateLayerTree", "data", InspectorUp
dateLayerTreeEvent::data(m_frame.get())); | 2472 TRACE_EVENT1("devtools.timeline", "UpdateLayerTree", "data", InspectorUp
dateLayerTreeEvent::data(m_frame.get())); |
2479 | 2473 |
2480 view->compositor()->updateIfNeededRecursive(); | 2474 view->compositor()->updateIfNeededRecursive(); |
2481 scrollContentsIfNeededRecursive(); | 2475 scrollContentsIfNeededRecursive(); |
2482 invalidateTreeIfNeededRecursive(); | 2476 |
2483 updatePostLifecycleData(); | 2477 ASSERT(lifecycle().state() >= DocumentLifecycle::CompositingClean); |
| 2478 |
| 2479 if (phases == AllPhases) { |
| 2480 invalidateTreeIfNeededRecursive(); |
| 2481 updatePostLifecycleData(); |
| 2482 } |
2484 | 2483 |
2485 ASSERT(!view->hasPendingSelection()); | 2484 ASSERT(!view->hasPendingSelection()); |
2486 } | 2485 } |
2487 | 2486 |
2488 ASSERT(lifecycle().state() == DocumentLifecycle::PaintInvalidationClean); | 2487 ASSERT(lifecycle().state() == DocumentLifecycle::PaintInvalidationClean); |
2489 } | 2488 } |
2490 | 2489 |
2491 void FrameView::updatePostLifecycleData() | 2490 void FrameView::updatePostLifecycleData() |
2492 { | 2491 { |
2493 LayoutView* view = layoutView(); | 2492 LayoutView* view = layoutView(); |
(...skipping 1452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3946 | 3945 |
3947 if (!graphicsLayer) | 3946 if (!graphicsLayer) |
3948 return; | 3947 return; |
3949 | 3948 |
3950 DeprecatedPaintLayer::mapRectToPaintInvalidationBacking(localFrame->contentL
ayoutObject(), paintInvalidationContainer, viewRect); | 3949 DeprecatedPaintLayer::mapRectToPaintInvalidationBacking(localFrame->contentL
ayoutObject(), paintInvalidationContainer, viewRect); |
3951 | 3950 |
3952 graphicsLayerTimingRequests.add(graphicsLayer, Vector<std::pair<int64_t, Web
Rect>>()).storedValue->value.append(std::make_pair(m_frame->frameID(), enclosing
IntRect(viewRect))); | 3951 graphicsLayerTimingRequests.add(graphicsLayer, Vector<std::pair<int64_t, Web
Rect>>()).storedValue->value.append(std::make_pair(m_frame->frameID(), enclosing
IntRect(viewRect))); |
3953 } | 3952 } |
3954 | 3953 |
3955 } // namespace blink | 3954 } // namespace blink |
OLD | NEW |