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

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 2404 matching lines...) Expand 10 before | Expand all | Expand 10 after
2446 m_needsUpdateWidgetPositions = false; 2447 m_needsUpdateWidgetPositions = false;
2447 2448
2448 updateWidgetPositions(); 2449 updateWidgetPositions();
2449 } 2450 }
2450 2451
2451 void FrameView::updateAllLifecyclePhases() 2452 void FrameView::updateAllLifecyclePhases()
2452 { 2453 {
2453 frame().localFrameRoot()->view()->updateAllLifecyclePhasesInternal(); 2454 frame().localFrameRoot()->view()->updateAllLifecyclePhasesInternal();
2454 } 2455 }
2455 2456
2457 void FrameView::updateAllLifecyclePhasesIncludingPaint()
2458 {
2459 frame().localFrameRoot()->view()->updateAllLifecyclePhasesIncludingPaintInte rnal();
2460 }
2461
2456 // TODO(chrishtr): add a scrolling update lifecycle phase, after compositing and before invalidation. 2462 // TODO(chrishtr): add a scrolling update lifecycle phase, after compositing and before invalidation.
2457 void FrameView::updateLifecycleToCompositingCleanPlusScrolling() 2463 void FrameView::updateLifecycleToCompositingCleanPlusScrolling()
2458 { 2464 {
2459 frame().localFrameRoot()->view()->updateStyleAndLayoutIfNeededRecursive(); 2465 frame().localFrameRoot()->view()->updateStyleAndLayoutIfNeededRecursive();
2460 LayoutView* view = layoutView(); 2466 LayoutView* view = layoutView();
2461 if (view) 2467 if (view)
2462 view->compositor()->updateIfNeededRecursive(); 2468 view->compositor()->updateIfNeededRecursive();
2463 scrollContentsIfNeededRecursive(); 2469 scrollContentsIfNeededRecursive();
2464 2470
2465 ASSERT(lifecycle().state() >= DocumentLifecycle::CompositingClean); 2471 ASSERT(lifecycle().state() >= DocumentLifecycle::CompositingClean);
(...skipping 17 matching lines...) Expand all
2483 scrollContentsIfNeededRecursive(); 2489 scrollContentsIfNeededRecursive();
2484 invalidateTreeIfNeededRecursive(); 2490 invalidateTreeIfNeededRecursive();
2485 updatePostLifecycleData(); 2491 updatePostLifecycleData();
2486 2492
2487 ASSERT(!view->hasPendingSelection()); 2493 ASSERT(!view->hasPendingSelection());
2488 } 2494 }
2489 2495
2490 ASSERT(lifecycle().state() == DocumentLifecycle::PaintInvalidationClean); 2496 ASSERT(lifecycle().state() == DocumentLifecycle::PaintInvalidationClean);
2491 } 2497 }
2492 2498
2499 void FrameView::paintAndComposite()
2500 {
2501 ASSERT(frame() == page()->mainFrame() || (!frame().tree().parent()->isLocalF rame()));
2502 LayoutView* view = layoutView();
2503 ASSERT(view);
2504 GraphicsLayer* rootGraphicsLayer = view->compositor()->rootGraphicsLayer();
2505
2506 GraphicsContext context(rootGraphicsLayer->displayItemList());
2507 rootGraphicsLayer->paint(context);
2508
2509 WebDisplayListDiff displayListDiff;
2510 rootGraphicsLayer->displayItemList()->commitNewDisplayItems(&displayListDiff );
2511
2512 DisplayListCompositingBuilder compositingBuilder(*rootGraphicsLayer->display ItemList(), displayListDiff, *rootGraphicsLayer);
2513 compositingBuilder.build();
2514 }
2515
2516 void FrameView::updateAllLifecyclePhasesIncludingPaintInternal()
2517 {
2518 // 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.
2519 ASSERT(frame() == page()->mainFrame() || (!frame().tree().parent()->isLocalF rame()));
2520 ASSERT(RuntimeEnabledFeatures::slimmingPaintCompositorLayerization());
2521
2522 // Updating layout can run script, which can tear down the FrameView.
2523 RefPtrWillBeRawPtr<FrameView> protector(this);
2524
2525 updateStyleAndLayoutIfNeededRecursive();
2526
2527 LayoutView* view = layoutView();
2528 if (view) {
2529 TRACE_EVENT1("devtools.timeline", "UpdateLayerTree", "data", InspectorUp dateLayerTreeEvent::data(m_frame.get()));
2530
2531 invalidateTreeIfNeededRecursive();
2532 paintAndComposite();
2533
2534 scrollContentsIfNeededRecursive();
2535 updatePostLifecycleData();
2536
2537 ASSERT(!view->hasPendingSelection());
2538 }
2539
2540 ASSERT(lifecycle().state() == DocumentLifecycle::PaintInvalidationClean);
2541 }
2542
2493 void FrameView::updatePostLifecycleData() 2543 void FrameView::updatePostLifecycleData()
2494 { 2544 {
2495 LayoutView* view = layoutView(); 2545 LayoutView* view = layoutView();
2496 ASSERT(view); 2546 ASSERT(view);
2497 2547
2498 if (view->compositor()->inCompositingMode() && m_frame->isLocalRoot()) 2548 if (view->compositor()->inCompositingMode() && m_frame->isLocalRoot())
2499 scrollingCoordinator()->updateAfterCompositingChangeIfNeeded(); 2549 scrollingCoordinator()->updateAfterCompositingChangeIfNeeded();
2500 2550
2501 updateCompositedSelectionIfNeeded(); 2551 updateCompositedSelectionIfNeeded();
2502 if (RuntimeEnabledFeatures::frameTimingSupportEnabled()) 2552 if (RuntimeEnabledFeatures::frameTimingSupportEnabled())
(...skipping 1436 matching lines...) Expand 10 before | Expand all | Expand 10 after
3939 3989
3940 if (!graphicsLayer) 3990 if (!graphicsLayer)
3941 return; 3991 return;
3942 3992
3943 DeprecatedPaintLayer::mapRectToPaintInvalidationBacking(localFrame->contentL ayoutObject(), paintInvalidationContainer, viewRect); 3993 DeprecatedPaintLayer::mapRectToPaintInvalidationBacking(localFrame->contentL ayoutObject(), paintInvalidationContainer, viewRect);
3944 3994
3945 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)));
3946 } 3996 }
3947 3997
3948 } // namespace blink 3998 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698