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