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

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

Issue 1327563003: Don't cache subsequence whose layer is not fully contained by repaint rect (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: For review Created 5 years, 3 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 2409 matching lines...) Expand 10 before | Expand all | Expand 10 after
2420 void FrameView::updateWidgetPositionsIfNeeded() 2420 void FrameView::updateWidgetPositionsIfNeeded()
2421 { 2421 {
2422 if (!m_needsUpdateWidgetPositions) 2422 if (!m_needsUpdateWidgetPositions)
2423 return; 2423 return;
2424 2424
2425 m_needsUpdateWidgetPositions = false; 2425 m_needsUpdateWidgetPositions = false;
2426 2426
2427 updateWidgetPositions(); 2427 updateWidgetPositions();
2428 } 2428 }
2429 2429
2430 void FrameView::updateAllLifecyclePhases() 2430 void FrameView::updateAllLifecyclePhases(const LayoutRect& interestRect)
2431 { 2431 {
2432 frame().localFrameRoot()->view()->updateLifecyclePhasesInternal(AllPhases); 2432 frame().localFrameRoot()->view()->updateLifecyclePhasesInternal(AllPhases, i nterestRect);
2433 } 2433 }
2434 2434
2435 // TODO(chrishtr): add a scrolling update lifecycle phase. 2435 // TODO(chrishtr): add a scrolling update lifecycle phase.
2436 void FrameView::updateLifecycleToCompositingCleanPlusScrolling() 2436 void FrameView::updateLifecycleToCompositingCleanPlusScrolling()
2437 { 2437 {
2438 frame().localFrameRoot()->view()->updateLifecyclePhasesInternal(OnlyUpToComp ositingCleanPlusScrolling); 2438 frame().localFrameRoot()->view()->updateLifecyclePhasesInternal(OnlyUpToComp ositingCleanPlusScrolling);
2439 } 2439 }
2440 2440
2441 void FrameView::updateLifecyclePhasesInternal(LifeCycleUpdateOption phases) 2441 void FrameView::updateLifecyclePhasesInternal(LifeCycleUpdateOption phases, cons t LayoutRect& interestRect)
2442 { 2442 {
2443 // This must be called from the root frame, since it recurses down, not up. 2443 // This must be called from the root frame, since it recurses down, not up.
2444 // Otherwise the lifecycles of the frames might be out of sync. 2444 // Otherwise the lifecycles of the frames might be out of sync.
2445 ASSERT(m_frame->isLocalRoot()); 2445 ASSERT(m_frame->isLocalRoot());
2446 2446
2447 // Updating layout can run script, which can tear down the FrameView. 2447 // Updating layout can run script, which can tear down the FrameView.
2448 RefPtrWillBeRawPtr<FrameView> protector(this); 2448 RefPtrWillBeRawPtr<FrameView> protector(this);
2449 2449
2450 updateStyleAndLayoutIfNeededRecursive(); 2450 updateStyleAndLayoutIfNeededRecursive();
2451 2451
2452 if (LayoutView* view = layoutView()) { 2452 if (LayoutView* view = layoutView()) {
2453 TRACE_EVENT1("devtools.timeline", "UpdateLayerTree", "data", InspectorUp dateLayerTreeEvent::data(m_frame.get())); 2453 TRACE_EVENT1("devtools.timeline", "UpdateLayerTree", "data", InspectorUp dateLayerTreeEvent::data(m_frame.get()));
2454 2454
2455 // This was required for slimming paint v1 but is only temporarily 2455 // This was required for slimming paint v1 but is only temporarily
2456 // needed for slimming paint v2. 2456 // needed for slimming paint v2.
2457 view->compositor()->updateIfNeededRecursive(); 2457 view->compositor()->updateIfNeededRecursive();
2458 scrollContentsIfNeededRecursive(); 2458 scrollContentsIfNeededRecursive();
2459 2459
2460 ASSERT(lifecycle().state() >= DocumentLifecycle::CompositingClean); 2460 ASSERT(lifecycle().state() >= DocumentLifecycle::CompositingClean);
2461 2461
2462 if (phases == AllPhases) { 2462 if (phases == AllPhases) {
2463 invalidateTreeIfNeededRecursive(); 2463 invalidateTreeIfNeededRecursive();
2464 2464
2465 if (view->compositor()->inCompositingMode()) 2465 if (view->compositor()->inCompositingMode())
2466 scrollingCoordinator()->updateAfterCompositingChangeIfNeeded(); 2466 scrollingCoordinator()->updateAfterCompositingChangeIfNeeded();
2467 2467
2468 updateCompositedSelectionIfNeeded(); 2468 updateCompositedSelectionIfNeeded();
2469 2469
2470 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { 2470 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
2471 paintForSlimmingPaintV2(); 2471 paintForSlimmingPaintV2(interestRect);
2472 compositeForSlimmingPaintV2(); 2472 compositeForSlimmingPaintV2();
2473 } 2473 }
2474 2474
2475 if (RuntimeEnabledFeatures::frameTimingSupportEnabled()) 2475 if (RuntimeEnabledFeatures::frameTimingSupportEnabled())
2476 updateFrameTimingRequestsIfNeeded(); 2476 updateFrameTimingRequestsIfNeeded();
2477 2477
2478 ASSERT(!view->hasPendingSelection()); 2478 ASSERT(!view->hasPendingSelection());
2479 ASSERT(lifecycle().state() == DocumentLifecycle::PaintInvalidationCl ean 2479 ASSERT(lifecycle().state() == DocumentLifecycle::PaintInvalidationCl ean
2480 || (RuntimeEnabledFeatures::slimmingPaintV2Enabled() && lifecycl e().state() == DocumentLifecycle::CompositingForSlimmingPaintV2Clean)); 2480 || (RuntimeEnabledFeatures::slimmingPaintV2Enabled() && lifecycl e().state() == DocumentLifecycle::CompositingForSlimmingPaintV2Clean));
2481 } 2481 }
2482 } 2482 }
2483 } 2483 }
2484 2484
2485 void FrameView::paintForSlimmingPaintV2() 2485 void FrameView::paintForSlimmingPaintV2(const LayoutRect& interestRect)
2486 { 2486 {
2487 ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled()); 2487 ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled());
2488 ASSERT(frame() == page()->mainFrame() || (!frame().tree().parent()->isLocalF rame())); 2488 ASSERT(frame() == page()->mainFrame() || (!frame().tree().parent()->isLocalF rame()));
2489 2489
2490 LayoutView* view = layoutView(); 2490 LayoutView* view = layoutView();
2491 ASSERT(view); 2491 ASSERT(view);
2492 GraphicsLayer* rootGraphicsLayer = view->layer()->graphicsLayerBacking(); 2492 GraphicsLayer* rootGraphicsLayer = view->layer()->graphicsLayerBacking();
2493 2493
2494 // Detached frames can have no root graphics layer. 2494 // Detached frames can have no root graphics layer.
2495 if (!rootGraphicsLayer) 2495 if (!rootGraphicsLayer)
2496 return; 2496 return;
2497 2497
2498 lifecycle().advanceTo(DocumentLifecycle::InPaintForSlimmingPaintV2); 2498 lifecycle().advanceTo(DocumentLifecycle::InPaintForSlimmingPaintV2);
2499 2499
2500 // TODO(pdr): Update callers to pass in the interest rect.
2501 IntRect interestRect = LayoutRect::infiniteIntRect();
2502 GraphicsContext context(rootGraphicsLayer->displayItemList()); 2500 GraphicsContext context(rootGraphicsLayer->displayItemList());
2503 rootGraphicsLayer->paint(context, interestRect); 2501 rootGraphicsLayer->paint(context, roundedIntRect(interestRect));
2504 2502
2505 lifecycle().advanceTo(DocumentLifecycle::PaintForSlimmingPaintV2Clean); 2503 lifecycle().advanceTo(DocumentLifecycle::PaintForSlimmingPaintV2Clean);
2506 } 2504 }
2507 2505
2508 void FrameView::compositeForSlimmingPaintV2() 2506 void FrameView::compositeForSlimmingPaintV2()
2509 { 2507 {
2510 ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled()); 2508 ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled());
2511 ASSERT(frame() == page()->mainFrame() || (!frame().tree().parent()->isLocalF rame())); 2509 ASSERT(frame() == page()->mainFrame() || (!frame().tree().parent()->isLocalF rame()));
2512 2510
2513 GraphicsLayer* rootGraphicsLayer = layoutView()->layer()->graphicsLayerBacki ng(); 2511 GraphicsLayer* rootGraphicsLayer = layoutView()->layer()->graphicsLayerBacki ng();
(...skipping 1449 matching lines...) Expand 10 before | Expand all | Expand 10 after
3963 3961
3964 if (!graphicsLayer) 3962 if (!graphicsLayer)
3965 return; 3963 return;
3966 3964
3967 DeprecatedPaintLayer::mapRectToPaintInvalidationBacking(localFrame->contentL ayoutObject(), paintInvalidationContainer, viewRect); 3965 DeprecatedPaintLayer::mapRectToPaintInvalidationBacking(localFrame->contentL ayoutObject(), paintInvalidationContainer, viewRect);
3968 3966
3969 graphicsLayerTimingRequests.add(graphicsLayer, Vector<std::pair<int64_t, Web Rect>>()).storedValue->value.append(std::make_pair(m_frame->frameID(), enclosing IntRect(viewRect))); 3967 graphicsLayerTimingRequests.add(graphicsLayer, Vector<std::pair<int64_t, Web Rect>>()).storedValue->value.append(std::make_pair(m_frame->frameID(), enclosing IntRect(viewRect)));
3970 } 3968 }
3971 3969
3972 } // namespace blink 3970 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698