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

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

Issue 1428643004: Repaint on interest rect change (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@EnableSyncPaint
Patch Set: Copy display_list_recording_source unit tests Created 5 years, 1 month 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
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 2385 matching lines...) Expand 10 before | Expand all | Expand 10 after
2396 void FrameView::updateWidgetPositionsIfNeeded() 2396 void FrameView::updateWidgetPositionsIfNeeded()
2397 { 2397 {
2398 if (!m_needsUpdateWidgetPositions) 2398 if (!m_needsUpdateWidgetPositions)
2399 return; 2399 return;
2400 2400
2401 m_needsUpdateWidgetPositions = false; 2401 m_needsUpdateWidgetPositions = false;
2402 2402
2403 updateWidgetPositions(); 2403 updateWidgetPositions();
2404 } 2404 }
2405 2405
2406 void FrameView::updateAllLifecyclePhases(const LayoutRect* interestRect) 2406 void FrameView::updateAllLifecyclePhases(const IntRect* interestRect)
2407 { 2407 {
2408 frame().localFrameRoot()->view()->updateLifecyclePhasesInternal(AllPhases, i nterestRect); 2408 frame().localFrameRoot()->view()->updateLifecyclePhasesInternal(AllPhases, i nterestRect);
2409 } 2409 }
2410 2410
2411 // TODO(chrishtr): add a scrolling update lifecycle phase. 2411 // TODO(chrishtr): add a scrolling update lifecycle phase.
2412 void FrameView::updateLifecycleToCompositingCleanPlusScrolling() 2412 void FrameView::updateLifecycleToCompositingCleanPlusScrolling()
2413 { 2413 {
2414 frame().localFrameRoot()->view()->updateLifecyclePhasesInternal(OnlyUpToComp ositingCleanPlusScrolling, nullptr); 2414 frame().localFrameRoot()->view()->updateLifecyclePhasesInternal(OnlyUpToComp ositingCleanPlusScrolling, nullptr);
2415 } 2415 }
2416 2416
2417 void FrameView::updateLifecycleToLayoutClean() 2417 void FrameView::updateLifecycleToLayoutClean()
2418 { 2418 {
2419 frame().localFrameRoot()->view()->updateLifecyclePhasesInternal(OnlyUpToLayo utClean, nullptr); 2419 frame().localFrameRoot()->view()->updateLifecyclePhasesInternal(OnlyUpToLayo utClean, nullptr);
2420 } 2420 }
2421 2421
2422 void FrameView::updateLifecyclePhasesInternal(LifeCycleUpdateOption phases, cons t LayoutRect* interestRect) 2422 void FrameView::updateLifecyclePhasesInternal(LifeCycleUpdateOption phases, cons t IntRect* interestRect)
2423 { 2423 {
2424 // This must be called from the root frame, since it recurses down, not up. 2424 // This must be called from the root frame, since it recurses down, not up.
2425 // Otherwise the lifecycles of the frames might be out of sync. 2425 // Otherwise the lifecycles of the frames might be out of sync.
2426 ASSERT(m_frame->isLocalRoot()); 2426 ASSERT(m_frame->isLocalRoot());
2427 2427
2428 // Updating layout can run script, which can tear down the FrameView. 2428 // Updating layout can run script, which can tear down the FrameView.
2429 RefPtrWillBeRawPtr<FrameView> protector(this); 2429 RefPtrWillBeRawPtr<FrameView> protector(this);
2430 2430
2431 updateStyleAndLayoutIfNeededRecursive(); 2431 updateStyleAndLayoutIfNeededRecursive();
2432 ASSERT(lifecycle().state() >= DocumentLifecycle::LayoutClean); 2432 ASSERT(lifecycle().state() >= DocumentLifecycle::LayoutClean);
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
2478 2478
2479 void FrameView::updatePaintProperties() 2479 void FrameView::updatePaintProperties()
2480 { 2480 {
2481 ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled()); 2481 ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled());
2482 2482
2483 forAllFrameViews([](FrameView& frameView) { frameView.lifecycle().advanceTo( DocumentLifecycle::InUpdatePaintProperties); }); 2483 forAllFrameViews([](FrameView& frameView) { frameView.lifecycle().advanceTo( DocumentLifecycle::InUpdatePaintProperties); });
2484 PaintPropertyTreeBuilder().buildPropertyTrees(*this); 2484 PaintPropertyTreeBuilder().buildPropertyTrees(*this);
2485 forAllFrameViews([](FrameView& frameView) { frameView.lifecycle().advanceTo( DocumentLifecycle::UpdatePaintPropertiesClean); }); 2485 forAllFrameViews([](FrameView& frameView) { frameView.lifecycle().advanceTo( DocumentLifecycle::UpdatePaintPropertiesClean); });
2486 } 2486 }
2487 2487
2488 void FrameView::synchronizedPaint(const LayoutRect* interestRect) 2488 void FrameView::synchronizedPaint(const IntRect* interestRect)
2489 { 2489 {
2490 ASSERT(RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled()); 2490 ASSERT(RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled());
2491 ASSERT(frame() == page()->mainFrame() || (!frame().tree().parent()->isLocalF rame())); 2491 ASSERT(frame() == page()->mainFrame() || (!frame().tree().parent()->isLocalF rame()));
2492 2492
2493 LayoutView* view = layoutView(); 2493 LayoutView* view = layoutView();
2494 ASSERT(view); 2494 ASSERT(view);
2495 // TODO(chrishtr): figure out if there can be any GraphicsLayer above this o ne that draws content. 2495 // TODO(chrishtr): figure out if there can be any GraphicsLayer above this o ne that draws content.
2496 GraphicsLayer* rootGraphicsLayer = view->layer()->graphicsLayerBacking(); 2496 GraphicsLayer* rootGraphicsLayer = view->layer()->graphicsLayerBacking();
2497 forAllFrameViews([](FrameView& frameView) { frameView.lifecycle().advanceTo( DocumentLifecycle::InPaint); }); 2497 forAllFrameViews([](FrameView& frameView) { frameView.lifecycle().advanceTo( DocumentLifecycle::InPaint); });
2498 2498
2499 // A null graphics layer can occur for painting of SVG images that are not p arented into the main frame tree. 2499 // A null graphics layer can occur for painting of SVG images that are not p arented into the main frame tree.
2500 if (rootGraphicsLayer) { 2500 if (rootGraphicsLayer) {
2501 synchronizedPaintRecursively(rootGraphicsLayer, interestRect); 2501 synchronizedPaintRecursively(rootGraphicsLayer, interestRect);
2502 } 2502 }
2503 2503
2504 forAllFrameViews([](FrameView& frameView) { 2504 forAllFrameViews([](FrameView& frameView) {
2505 frameView.lifecycle().advanceTo(DocumentLifecycle::PaintClean); 2505 frameView.lifecycle().advanceTo(DocumentLifecycle::PaintClean);
2506 frameView.layoutView()->layer()->clearNeedsRepaintRecursively(); 2506 frameView.layoutView()->layer()->clearNeedsRepaintRecursively();
2507 }); 2507 });
2508 } 2508 }
2509 2509
2510 void FrameView::synchronizedPaintRecursively(GraphicsLayer* graphicsLayer, const LayoutRect* interestRect) 2510 void FrameView::synchronizedPaintRecursively(GraphicsLayer* graphicsLayer, const IntRect* interestRect)
2511 { 2511 {
2512 ASSERT(graphicsLayer->paintController()); 2512 ASSERT(graphicsLayer->paintController());
2513 GraphicsContext context(*graphicsLayer->paintController()); 2513 GraphicsContext context(*graphicsLayer->paintController());
2514 2514
2515 // TODO(chrishtr): fix unit tests to not inject one-off interest rects. 2515 // TODO(chrishtr): fix unit tests to not inject one-off interest rects.
2516 if (interestRect) 2516 graphicsLayer->paint(context, interestRect);
2517 graphicsLayer->paint(context, roundedIntRect(*interestRect));
2518 else
2519 graphicsLayer->paintIfNeeded(context);
2520 2517
2521 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled()) 2518 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled())
2522 graphicsLayer->paintController()->commitNewDisplayItems(); 2519 graphicsLayer->paintController()->commitNewDisplayItems();
2523 2520
2524 for (auto& child : graphicsLayer->children()) 2521 for (auto& child : graphicsLayer->children())
2525 synchronizedPaintRecursively(child, interestRect); 2522 synchronizedPaintRecursively(child, interestRect);
2526 } 2523 }
2527 2524
2528 void FrameView::compositeForSlimmingPaintV2() 2525 void FrameView::compositeForSlimmingPaintV2()
2529 { 2526 {
(...skipping 1549 matching lines...) Expand 10 before | Expand all | Expand 10 after
4079 } 4076 }
4080 4077
4081 bool FrameView::canThrottleRendering() const 4078 bool FrameView::canThrottleRendering() const
4082 { 4079 {
4083 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled()) 4080 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled())
4084 return false; 4081 return false;
4085 return m_hiddenForThrottling && m_crossOriginForThrottling; 4082 return m_hiddenForThrottling && m_crossOriginForThrottling;
4086 } 4083 }
4087 4084
4088 } // namespace blink 4085 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698