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

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

Issue 1238123004: Slimming Paint phase 2 compositing algorithm plumbing & skeleton display list API. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 5 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 | Annotate | Revision Log
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 11 matching lines...) Expand all
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 2409 matching lines...) Expand 10 before | Expand all | Expand 10 after
2451 void FrameView::updateAllLifecyclePhases() 2452 void FrameView::updateAllLifecyclePhases()
2452 { 2453 {
2453 frame().localFrameRoot()->view()->updateAllLifecyclePhasesInternal(); 2454 frame().localFrameRoot()->view()->updateAllLifecyclePhasesInternal();
2454 } 2455 }
2455 2456
2456 // TODO(chrishtr): add a scrolling update lifecycle phase, after compositing and before invalidation. 2457 // TODO(chrishtr): add a scrolling update lifecycle phase, after compositing and before invalidation.
2457 void FrameView::updateLifecycleToCompositingCleanPlusScrolling() 2458 void FrameView::updateLifecycleToCompositingCleanPlusScrolling()
2458 { 2459 {
2459 frame().localFrameRoot()->view()->updateStyleAndLayoutIfNeededRecursive(); 2460 frame().localFrameRoot()->view()->updateStyleAndLayoutIfNeededRecursive();
2460 LayoutView* view = layoutView(); 2461 LayoutView* view = layoutView();
2461 if (view) 2462 if (view) {
2463 // If SlimmingPaintCompositorLayerizationEnabled is on, we still need th is to set up the root layer(s).
2462 view->compositor()->updateIfNeededRecursive(); 2464 view->compositor()->updateIfNeededRecursive();
2463 scrollContentsIfNeededRecursive(); 2465
2466 if (RuntimeEnabledFeatures::slimmingPaintCompositorLayerizationEnabled() ) {
2467 invalidateTreeIfNeededRecursive();
2468 paintAndComposite();
2469 }
2470 scrollContentsIfNeededRecursive();
2471 }
2464 2472
2465 ASSERT(lifecycle().state() >= DocumentLifecycle::CompositingClean); 2473 ASSERT(lifecycle().state() >= DocumentLifecycle::CompositingClean);
2466 } 2474 }
2467 2475
2468 void FrameView::updateAllLifecyclePhasesInternal() 2476 void FrameView::updateAllLifecyclePhasesInternal()
2469 { 2477 {
2470 // 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. 2478 // 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.
2471 ASSERT(frame() == page()->mainFrame() || (!frame().tree().parent()->isLocalF rame())); 2479 ASSERT(frame() == page()->mainFrame() || (!frame().tree().parent()->isLocalF rame()));
2472 2480
2473 // Updating layout can run script, which can tear down the FrameView. 2481 // Updating layout can run script, which can tear down the FrameView.
2474 RefPtrWillBeRawPtr<FrameView> protector(this); 2482 RefPtrWillBeRawPtr<FrameView> protector(this);
2475 2483
2476 updateStyleAndLayoutIfNeededRecursive(); 2484 updateStyleAndLayoutIfNeededRecursive();
2477 2485
2478 LayoutView* view = layoutView(); 2486 LayoutView* view = layoutView();
2479 if (view) { 2487 if (view) {
2480 TRACE_EVENT1("devtools.timeline", "UpdateLayerTree", "data", InspectorUp dateLayerTreeEvent::data(m_frame.get())); 2488 TRACE_EVENT1("devtools.timeline", "UpdateLayerTree", "data", InspectorUp dateLayerTreeEvent::data(m_frame.get()));
2489 // If SlimmingPaintCompositorLayerizationEnabled is on, we still need th is to set up the root layer(s).
2490 view->compositor()->updateIfNeededRecursive();
2481 2491
2482 view->compositor()->updateIfNeededRecursive(); 2492 if (RuntimeEnabledFeatures::slimmingPaintCompositorLayerizationEnabled() ) {
2493 invalidateTreeIfNeededRecursive();
2494 paintAndComposite();
2495 }
2483 scrollContentsIfNeededRecursive(); 2496 scrollContentsIfNeededRecursive();
2484 invalidateTreeIfNeededRecursive();
2485 updatePostLifecycleData(); 2497 updatePostLifecycleData();
2486 2498
2487 ASSERT(!view->hasPendingSelection()); 2499 ASSERT(!view->hasPendingSelection());
2488 } 2500 }
2489 2501
2490 ASSERT(lifecycle().state() == DocumentLifecycle::PaintInvalidationClean); 2502 ASSERT(lifecycle().state() == DocumentLifecycle::PaintInvalidationClean
2503 || (RuntimeEnabledFeatures::slimmingPaintCompositorLayerizationEnabled() && lifecycle().state() == DocumentLifecycle::CompositingClean));
2504 }
2505
2506 void FrameView::paintAndComposite()
2507 {
2508 ASSERT(frame() == page()->mainFrame() || (!frame().tree().parent()->isLocalF rame()));
2509 LayoutView* view = layoutView();
2510 ASSERT(view);
2511 GraphicsLayer* rootGraphicsLayer = view->layer()->graphicsLayerBacking();
2512 // Detached frames can have no root graphics layer.
2513 if (!rootGraphicsLayer)
2514 return;
2515
2516 GraphicsContext context(rootGraphicsLayer->displayItemList());
2517 rootGraphicsLayer->paint(context);
2518
2519 DisplayListDiff displayListDiff;
2520 rootGraphicsLayer->displayItemList()->commitNewDisplayItems(&displayListDiff );
2521
2522 lifecycle().advanceTo(DocumentLifecycle::InCompositingUpdate);
2523
2524 DisplayListCompositingBuilder compositingBuilder(*rootGraphicsLayer->display ItemList(), displayListDiff, *rootGraphicsLayer);
2525 compositingBuilder.build();
2526
2527 lifecycle().advanceTo(DocumentLifecycle::CompositingClean);
2491 } 2528 }
2492 2529
2493 void FrameView::updatePostLifecycleData() 2530 void FrameView::updatePostLifecycleData()
2494 { 2531 {
2495 LayoutView* view = layoutView(); 2532 LayoutView* view = layoutView();
2496 ASSERT(view); 2533 ASSERT(view);
2497 2534
2498 if (view->compositor()->inCompositingMode() && m_frame->isLocalRoot()) 2535 if (view->compositor()->inCompositingMode() && m_frame->isLocalRoot())
2499 scrollingCoordinator()->updateAfterCompositingChangeIfNeeded(); 2536 scrollingCoordinator()->updateAfterCompositingChangeIfNeeded();
2500 2537
(...skipping 1438 matching lines...) Expand 10 before | Expand all | Expand 10 after
3939 3976
3940 if (!graphicsLayer) 3977 if (!graphicsLayer)
3941 return; 3978 return;
3942 3979
3943 DeprecatedPaintLayer::mapRectToPaintInvalidationBacking(localFrame->contentL ayoutObject(), paintInvalidationContainer, viewRect); 3980 DeprecatedPaintLayer::mapRectToPaintInvalidationBacking(localFrame->contentL ayoutObject(), paintInvalidationContainer, viewRect);
3944 3981
3945 graphicsLayerTimingRequests.add(graphicsLayer, Vector<std::pair<int64_t, Web Rect>>()).storedValue->value.append(std::make_pair(m_frame->frameID(), enclosing IntRect(viewRect))); 3982 graphicsLayerTimingRequests.add(graphicsLayer, Vector<std::pair<int64_t, Web Rect>>()).storedValue->value.append(std::make_pair(m_frame->frameID(), enclosing IntRect(viewRect)));
3946 } 3983 }
3947 3984
3948 } // namespace blink 3985 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698