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 11 matching lines...) Expand all Loading... |
22 * along with this library; see the file COPYING.LIB. If not, write to | 22 * along with this library; see the file COPYING.LIB. If not, write to |
23 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 23 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
24 * Boston, MA 02110-1301, USA. | 24 * Boston, MA 02110-1301, USA. |
25 */ | 25 */ |
26 | 26 |
27 #include "config.h" | 27 #include "config.h" |
28 #include "core/frame/FrameView.h" | 28 #include "core/frame/FrameView.h" |
29 | 29 |
30 #include "core/HTMLNames.h" | 30 #include "core/HTMLNames.h" |
31 #include "core/MediaTypeNames.h" | 31 #include "core/MediaTypeNames.h" |
| 32 #include "core/compositing/DisplayListCompositingBuilder.h" |
32 #include "core/css/FontFaceSet.h" | 33 #include "core/css/FontFaceSet.h" |
33 #include "core/css/resolver/StyleResolver.h" | 34 #include "core/css/resolver/StyleResolver.h" |
34 #include "core/dom/AXObjectCache.h" | 35 #include "core/dom/AXObjectCache.h" |
35 #include "core/dom/DocumentMarkerController.h" | 36 #include "core/dom/DocumentMarkerController.h" |
36 #include "core/dom/Fullscreen.h" | 37 #include "core/dom/Fullscreen.h" |
37 #include "core/editing/FrameSelection.h" | 38 #include "core/editing/FrameSelection.h" |
38 #include "core/editing/RenderedPosition.h" | 39 #include "core/editing/RenderedPosition.h" |
39 #include "core/fetch/ResourceFetcher.h" | 40 #include "core/fetch/ResourceFetcher.h" |
40 #include "core/fetch/ResourceLoadPriorityOptimizer.h" | 41 #include "core/fetch/ResourceLoadPriorityOptimizer.h" |
41 #include "core/frame/FrameHost.h" | 42 #include "core/frame/FrameHost.h" |
(...skipping 2413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2455 void FrameView::updateAllLifecyclePhases() | 2456 void FrameView::updateAllLifecyclePhases() |
2456 { | 2457 { |
2457 frame().localFrameRoot()->view()->updateAllLifecyclePhasesInternal(); | 2458 frame().localFrameRoot()->view()->updateAllLifecyclePhasesInternal(); |
2458 } | 2459 } |
2459 | 2460 |
2460 // TODO(chrishtr): add a scrolling update lifecycle phase, after compositing and
before invalidation. | 2461 // TODO(chrishtr): add a scrolling update lifecycle phase, after compositing and
before invalidation. |
2461 void FrameView::updateLifecycleToCompositingCleanPlusScrolling() | 2462 void FrameView::updateLifecycleToCompositingCleanPlusScrolling() |
2462 { | 2463 { |
2463 frame().localFrameRoot()->view()->updateStyleAndLayoutIfNeededRecursive(); | 2464 frame().localFrameRoot()->view()->updateStyleAndLayoutIfNeededRecursive(); |
2464 LayoutView* view = layoutView(); | 2465 LayoutView* view = layoutView(); |
2465 if (view) | 2466 if (view) { |
| 2467 // If SlimmingPaintCompositorLayerizationEnabled is on, we still need th
is to set up the root layer(s). |
2466 view->compositor()->updateIfNeededRecursive(); | 2468 view->compositor()->updateIfNeededRecursive(); |
2467 scrollContentsIfNeededRecursive(); | 2469 |
| 2470 if (RuntimeEnabledFeatures::slimmingPaintCompositorLayerizationEnabled()
) { |
| 2471 invalidateTreeIfNeededRecursive(); |
| 2472 paintAndComposite(); |
| 2473 } |
| 2474 scrollContentsIfNeededRecursive(); |
| 2475 } |
2468 | 2476 |
2469 ASSERT(lifecycle().state() >= DocumentLifecycle::CompositingClean); | 2477 ASSERT(lifecycle().state() >= DocumentLifecycle::CompositingClean); |
2470 } | 2478 } |
2471 | 2479 |
2472 void FrameView::updateAllLifecyclePhasesInternal() | 2480 void FrameView::updateAllLifecyclePhasesInternal() |
2473 { | 2481 { |
2474 // 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. | 2482 // 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. |
2475 ASSERT(frame() == page()->mainFrame() || (!frame().tree().parent()->isLocalF
rame())); | 2483 ASSERT(frame() == page()->mainFrame() || (!frame().tree().parent()->isLocalF
rame())); |
2476 | 2484 |
2477 // Updating layout can run script, which can tear down the FrameView. | 2485 // Updating layout can run script, which can tear down the FrameView. |
2478 RefPtrWillBeRawPtr<FrameView> protector(this); | 2486 RefPtrWillBeRawPtr<FrameView> protector(this); |
2479 | 2487 |
2480 updateStyleAndLayoutIfNeededRecursive(); | 2488 updateStyleAndLayoutIfNeededRecursive(); |
2481 | 2489 |
2482 LayoutView* view = layoutView(); | 2490 LayoutView* view = layoutView(); |
2483 if (view) { | 2491 if (view) { |
2484 TRACE_EVENT1("devtools.timeline", "UpdateLayerTree", "data", InspectorUp
dateLayerTreeEvent::data(m_frame.get())); | 2492 TRACE_EVENT1("devtools.timeline", "UpdateLayerTree", "data", InspectorUp
dateLayerTreeEvent::data(m_frame.get())); |
| 2493 // If SlimmingPaintCompositorLayerizationEnabled is on, we still need th
is to set up the root layer(s). |
| 2494 view->compositor()->updateIfNeededRecursive(); |
2485 | 2495 |
2486 view->compositor()->updateIfNeededRecursive(); | 2496 if (RuntimeEnabledFeatures::slimmingPaintCompositorLayerizationEnabled()
) { |
| 2497 invalidateTreeIfNeededRecursive(); |
| 2498 paintAndComposite(); |
| 2499 } |
2487 scrollContentsIfNeededRecursive(); | 2500 scrollContentsIfNeededRecursive(); |
2488 invalidateTreeIfNeededRecursive(); | |
2489 updatePostLifecycleData(); | 2501 updatePostLifecycleData(); |
2490 | 2502 |
2491 ASSERT(!view->hasPendingSelection()); | 2503 ASSERT(!view->hasPendingSelection()); |
2492 } | 2504 } |
2493 | 2505 |
2494 ASSERT(lifecycle().state() == DocumentLifecycle::PaintInvalidationClean); | 2506 ASSERT(lifecycle().state() == DocumentLifecycle::PaintInvalidationClean |
| 2507 || (RuntimeEnabledFeatures::slimmingPaintCompositorLayerizationEnabled()
&& lifecycle().state() == DocumentLifecycle::CompositingClean)); |
| 2508 } |
| 2509 |
| 2510 void FrameView::paintAndComposite() |
| 2511 { |
| 2512 ASSERT(frame() == page()->mainFrame() || (!frame().tree().parent()->isLocalF
rame())); |
| 2513 LayoutView* view = layoutView(); |
| 2514 ASSERT(view); |
| 2515 GraphicsLayer* rootGraphicsLayer = view->layer()->graphicsLayerBacking(); |
| 2516 // Detached frames can have no root graphics layer. |
| 2517 if (!rootGraphicsLayer) |
| 2518 return; |
| 2519 |
| 2520 GraphicsContext context(rootGraphicsLayer->displayItemList()); |
| 2521 rootGraphicsLayer->paint(context); |
| 2522 |
| 2523 DisplayListDiff displayListDiff; |
| 2524 rootGraphicsLayer->displayItemList()->commitNewDisplayItems(&displayListDiff
); |
| 2525 |
| 2526 lifecycle().advanceTo(DocumentLifecycle::InCompositingUpdate); |
| 2527 |
| 2528 DisplayListCompositingBuilder compositingBuilder(*rootGraphicsLayer->display
ItemList(), displayListDiff, *rootGraphicsLayer); |
| 2529 compositingBuilder.build(); |
| 2530 |
| 2531 lifecycle().advanceTo(DocumentLifecycle::CompositingClean); |
2495 } | 2532 } |
2496 | 2533 |
2497 void FrameView::updatePostLifecycleData() | 2534 void FrameView::updatePostLifecycleData() |
2498 { | 2535 { |
2499 LayoutView* view = layoutView(); | 2536 LayoutView* view = layoutView(); |
2500 ASSERT(view); | 2537 ASSERT(view); |
2501 | 2538 |
2502 if (view->compositor()->inCompositingMode() && m_frame->isLocalRoot()) | 2539 if (view->compositor()->inCompositingMode() && m_frame->isLocalRoot()) |
2503 scrollingCoordinator()->updateAfterCompositingChangeIfNeeded(); | 2540 scrollingCoordinator()->updateAfterCompositingChangeIfNeeded(); |
2504 | 2541 |
(...skipping 1447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3952 | 3989 |
3953 if (!graphicsLayer) | 3990 if (!graphicsLayer) |
3954 return; | 3991 return; |
3955 | 3992 |
3956 DeprecatedPaintLayer::mapRectToPaintInvalidationBacking(localFrame->contentL
ayoutObject(), paintInvalidationContainer, viewRect); | 3993 DeprecatedPaintLayer::mapRectToPaintInvalidationBacking(localFrame->contentL
ayoutObject(), paintInvalidationContainer, viewRect); |
3957 | 3994 |
3958 graphicsLayerTimingRequests.add(graphicsLayer, Vector<std::pair<int64_t, Web
Rect>>()).storedValue->value.append(std::make_pair(m_frame->frameID(), enclosing
IntRect(viewRect))); | 3995 graphicsLayerTimingRequests.add(graphicsLayer, Vector<std::pair<int64_t, Web
Rect>>()).storedValue->value.append(std::make_pair(m_frame->frameID(), enclosing
IntRect(viewRect))); |
3959 } | 3996 } |
3960 | 3997 |
3961 } // namespace blink | 3998 } // namespace blink |
OLD | NEW |