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

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: 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 2400 matching lines...) Expand 10 before | Expand all | Expand 10 after
2411 void FrameView::updateWidgetPositionsIfNeeded() 2411 void FrameView::updateWidgetPositionsIfNeeded()
2412 { 2412 {
2413 if (!m_needsUpdateWidgetPositions) 2413 if (!m_needsUpdateWidgetPositions)
2414 return; 2414 return;
2415 2415
2416 m_needsUpdateWidgetPositions = false; 2416 m_needsUpdateWidgetPositions = false;
2417 2417
2418 updateWidgetPositions(); 2418 updateWidgetPositions();
2419 } 2419 }
2420 2420
2421 void FrameView::updateAllLifecyclePhases() 2421 void FrameView::updateAllLifecyclePhases(const LayoutRect& interestRect)
2422 { 2422 {
2423 frame().localFrameRoot()->view()->updateLifecyclePhasesInternal(AllPhases); 2423 frame().localFrameRoot()->view()->updateLifecyclePhasesInternal(AllPhases, i nterestRect);
2424 } 2424 }
2425 2425
2426 // TODO(chrishtr): add a scrolling update lifecycle phase. 2426 // TODO(chrishtr): add a scrolling update lifecycle phase.
2427 void FrameView::updateLifecycleToCompositingCleanPlusScrolling() 2427 void FrameView::updateLifecycleToCompositingCleanPlusScrolling()
2428 { 2428 {
2429 frame().localFrameRoot()->view()->updateLifecyclePhasesInternal(OnlyUpToComp ositingCleanPlusScrolling); 2429 frame().localFrameRoot()->view()->updateLifecyclePhasesInternal(OnlyUpToComp ositingCleanPlusScrolling);
2430 } 2430 }
2431 2431
2432 void FrameView::updateLifecyclePhasesInternal(LifeCycleUpdateOption phases) 2432 void FrameView::updateLifecyclePhasesInternal(LifeCycleUpdateOption phases, cons t LayoutRect& interestRect)
2433 { 2433 {
2434 // This must be called from the root frame, since it recurses down, not up. 2434 // This must be called from the root frame, since it recurses down, not up.
2435 // Otherwise the lifecycles of the frames might be out of sync. 2435 // Otherwise the lifecycles of the frames might be out of sync.
2436 ASSERT(m_frame->isLocalRoot()); 2436 ASSERT(m_frame->isLocalRoot());
2437 2437
2438 // Updating layout can run script, which can tear down the FrameView. 2438 // Updating layout can run script, which can tear down the FrameView.
2439 RefPtrWillBeRawPtr<FrameView> protector(this); 2439 RefPtrWillBeRawPtr<FrameView> protector(this);
2440 2440
2441 updateStyleAndLayoutIfNeededRecursive(); 2441 updateStyleAndLayoutIfNeededRecursive();
2442 2442
2443 if (LayoutView* view = layoutView()) { 2443 if (LayoutView* view = layoutView()) {
2444 TRACE_EVENT1("devtools.timeline", "UpdateLayerTree", "data", InspectorUp dateLayerTreeEvent::data(m_frame.get())); 2444 TRACE_EVENT1("devtools.timeline", "UpdateLayerTree", "data", InspectorUp dateLayerTreeEvent::data(m_frame.get()));
2445 2445
2446 // This was required for slimming paint v1 but is only temporarily 2446 // This was required for slimming paint v1 but is only temporarily
2447 // needed for slimming paint v2. 2447 // needed for slimming paint v2.
2448 view->compositor()->updateIfNeededRecursive(); 2448 view->compositor()->updateIfNeededRecursive();
2449 scrollContentsIfNeededRecursive(); 2449 scrollContentsIfNeededRecursive();
2450 2450
2451 ASSERT(lifecycle().state() >= DocumentLifecycle::CompositingClean); 2451 ASSERT(lifecycle().state() >= DocumentLifecycle::CompositingClean);
2452 2452
2453 if (phases == AllPhases) { 2453 if (phases == AllPhases) {
2454 invalidateTreeIfNeededRecursive(); 2454 invalidateTreeIfNeededRecursive();
2455 2455
2456 if (view->compositor()->inCompositingMode()) 2456 if (view->compositor()->inCompositingMode())
2457 scrollingCoordinator()->updateAfterCompositingChangeIfNeeded(); 2457 scrollingCoordinator()->updateAfterCompositingChangeIfNeeded();
2458 2458
2459 updateCompositedSelectionIfNeeded(); 2459 updateCompositedSelectionIfNeeded();
2460 2460
2461 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { 2461 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
2462 paintForSlimmingPaintV2(); 2462 paintForSlimmingPaintV2(interestRect);
2463 compositeForSlimmingPaintV2(); 2463 compositeForSlimmingPaintV2();
2464 } 2464 }
2465 2465
2466 if (RuntimeEnabledFeatures::frameTimingSupportEnabled()) 2466 if (RuntimeEnabledFeatures::frameTimingSupportEnabled())
2467 updateFrameTimingRequestsIfNeeded(); 2467 updateFrameTimingRequestsIfNeeded();
2468 2468
2469 ASSERT(!view->hasPendingSelection()); 2469 ASSERT(!view->hasPendingSelection());
2470 ASSERT(lifecycle().state() == DocumentLifecycle::PaintInvalidationCl ean 2470 ASSERT(lifecycle().state() == DocumentLifecycle::PaintInvalidationCl ean
2471 || (RuntimeEnabledFeatures::slimmingPaintV2Enabled() && lifecycl e().state() == DocumentLifecycle::CompositingForSlimmingPaintV2Clean)); 2471 || (RuntimeEnabledFeatures::slimmingPaintV2Enabled() && lifecycl e().state() == DocumentLifecycle::CompositingForSlimmingPaintV2Clean));
2472 } 2472 }
2473 } 2473 }
2474 } 2474 }
2475 2475
2476 void FrameView::paintForSlimmingPaintV2() 2476 void FrameView::paintForSlimmingPaintV2(const LayoutRect& interestRect)
2477 { 2477 {
2478 ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled()); 2478 ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled());
2479 ASSERT(frame() == page()->mainFrame() || (!frame().tree().parent()->isLocalF rame())); 2479 ASSERT(frame() == page()->mainFrame() || (!frame().tree().parent()->isLocalF rame()));
2480 2480
2481 LayoutView* view = layoutView(); 2481 LayoutView* view = layoutView();
2482 ASSERT(view); 2482 ASSERT(view);
2483 GraphicsLayer* rootGraphicsLayer = view->layer()->graphicsLayerBacking(); 2483 GraphicsLayer* rootGraphicsLayer = view->layer()->graphicsLayerBacking();
2484 2484
2485 // Detached frames can have no root graphics layer. 2485 // Detached frames can have no root graphics layer.
2486 if (!rootGraphicsLayer) 2486 if (!rootGraphicsLayer)
2487 return; 2487 return;
2488 2488
2489 lifecycle().advanceTo(DocumentLifecycle::InPaintForSlimmingPaintV2); 2489 lifecycle().advanceTo(DocumentLifecycle::InPaintForSlimmingPaintV2);
2490 2490
2491 // TODO(pdr): Update callers to pass in the interest rect.
2492 IntRect interestRect = LayoutRect::infiniteIntRect();
2493 GraphicsContext context(rootGraphicsLayer->displayItemList()); 2491 GraphicsContext context(rootGraphicsLayer->displayItemList());
2494 rootGraphicsLayer->paint(context, interestRect); 2492 rootGraphicsLayer->paint(context, roundedIntRect(interestRect));
2495 2493
2496 lifecycle().advanceTo(DocumentLifecycle::PaintForSlimmingPaintV2Clean); 2494 lifecycle().advanceTo(DocumentLifecycle::PaintForSlimmingPaintV2Clean);
2497 } 2495 }
2498 2496
2499 void FrameView::compositeForSlimmingPaintV2() 2497 void FrameView::compositeForSlimmingPaintV2()
2500 { 2498 {
2501 ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled()); 2499 ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled());
2502 ASSERT(frame() == page()->mainFrame() || (!frame().tree().parent()->isLocalF rame())); 2500 ASSERT(frame() == page()->mainFrame() || (!frame().tree().parent()->isLocalF rame()));
2503 2501
2504 GraphicsLayer* rootGraphicsLayer = layoutView()->layer()->graphicsLayerBacki ng(); 2502 GraphicsLayer* rootGraphicsLayer = layoutView()->layer()->graphicsLayerBacki ng();
(...skipping 1436 matching lines...) Expand 10 before | Expand all | Expand 10 after
3941 3939
3942 if (!graphicsLayer) 3940 if (!graphicsLayer)
3943 return; 3941 return;
3944 3942
3945 DeprecatedPaintLayer::mapRectToPaintInvalidationBacking(localFrame->contentL ayoutObject(), paintInvalidationContainer, viewRect); 3943 DeprecatedPaintLayer::mapRectToPaintInvalidationBacking(localFrame->contentL ayoutObject(), paintInvalidationContainer, viewRect);
3946 3944
3947 graphicsLayerTimingRequests.add(graphicsLayer, Vector<std::pair<int64_t, Web Rect>>()).storedValue->value.append(std::make_pair(m_frame->frameID(), enclosing IntRect(viewRect))); 3945 graphicsLayerTimingRequests.add(graphicsLayer, Vector<std::pair<int64_t, Web Rect>>()).storedValue->value.append(std::make_pair(m_frame->frameID(), enclosing IntRect(viewRect)));
3948 } 3946 }
3949 3947
3950 } // namespace blink 3948 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698