| 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 1450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1461 | 1461 |
| 1462 void FrameView::addBackgroundAttachmentFixedObject(LayoutObject* object) { | 1462 void FrameView::addBackgroundAttachmentFixedObject(LayoutObject* object) { |
| 1463 ASSERT(!m_backgroundAttachmentFixedObjects.contains(object)); | 1463 ASSERT(!m_backgroundAttachmentFixedObjects.contains(object)); |
| 1464 | 1464 |
| 1465 m_backgroundAttachmentFixedObjects.add(object); | 1465 m_backgroundAttachmentFixedObjects.add(object); |
| 1466 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) | 1466 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) |
| 1467 scrollingCoordinator->frameViewHasBackgroundAttachmentFixedObjectsDidChange( | 1467 scrollingCoordinator->frameViewHasBackgroundAttachmentFixedObjectsDidChange( |
| 1468 this); | 1468 this); |
| 1469 | 1469 |
| 1470 // Ensure main thread scrolling reasons are recomputed. | 1470 // Ensure main thread scrolling reasons are recomputed. |
| 1471 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { | 1471 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) { |
| 1472 setNeedsPaintPropertyUpdate(); | 1472 setNeedsPaintPropertyUpdate(); |
| 1473 // The object's scroll properties are not affected by its own background. | 1473 // The object's scroll properties are not affected by its own background. |
| 1474 object->setAncestorsNeedPaintPropertyUpdateForMainThreadScrolling(); | 1474 object->setAncestorsNeedPaintPropertyUpdateForMainThreadScrolling(); |
| 1475 } | 1475 } |
| 1476 } | 1476 } |
| 1477 | 1477 |
| 1478 void FrameView::removeBackgroundAttachmentFixedObject(LayoutObject* object) { | 1478 void FrameView::removeBackgroundAttachmentFixedObject(LayoutObject* object) { |
| 1479 ASSERT(m_backgroundAttachmentFixedObjects.contains(object)); | 1479 ASSERT(m_backgroundAttachmentFixedObjects.contains(object)); |
| 1480 | 1480 |
| 1481 m_backgroundAttachmentFixedObjects.remove(object); | 1481 m_backgroundAttachmentFixedObjects.remove(object); |
| 1482 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) | 1482 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) |
| 1483 scrollingCoordinator->frameViewHasBackgroundAttachmentFixedObjectsDidChange( | 1483 scrollingCoordinator->frameViewHasBackgroundAttachmentFixedObjectsDidChange( |
| 1484 this); | 1484 this); |
| 1485 | 1485 |
| 1486 // Ensure main thread scrolling reasons are recomputed. | 1486 // Ensure main thread scrolling reasons are recomputed. |
| 1487 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { | 1487 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) { |
| 1488 setNeedsPaintPropertyUpdate(); | 1488 setNeedsPaintPropertyUpdate(); |
| 1489 // The object's scroll properties are not affected by its own background. | 1489 // The object's scroll properties are not affected by its own background. |
| 1490 object->setAncestorsNeedPaintPropertyUpdateForMainThreadScrolling(); | 1490 object->setAncestorsNeedPaintPropertyUpdateForMainThreadScrolling(); |
| 1491 } | 1491 } |
| 1492 } | 1492 } |
| 1493 | 1493 |
| 1494 void FrameView::addViewportConstrainedObject(LayoutObject* object) { | 1494 void FrameView::addViewportConstrainedObject(LayoutObject* object) { |
| 1495 if (!m_viewportConstrainedObjects) | 1495 if (!m_viewportConstrainedObjects) |
| 1496 m_viewportConstrainedObjects = wrapUnique(new ViewportConstrainedObjectSet); | 1496 m_viewportConstrainedObjects = wrapUnique(new ViewportConstrainedObjectSet); |
| 1497 | 1497 |
| (...skipping 1219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2717 updateWidgetGeometries(); | 2717 updateWidgetGeometries(); |
| 2718 } | 2718 } |
| 2719 | 2719 |
| 2720 void FrameView::updateAllLifecyclePhases() { | 2720 void FrameView::updateAllLifecyclePhases() { |
| 2721 frame().localFrameRoot()->view()->updateLifecyclePhasesInternal( | 2721 frame().localFrameRoot()->view()->updateLifecyclePhasesInternal( |
| 2722 DocumentLifecycle::PaintClean); | 2722 DocumentLifecycle::PaintClean); |
| 2723 } | 2723 } |
| 2724 | 2724 |
| 2725 // TODO(chrishtr): add a scrolling update lifecycle phase. | 2725 // TODO(chrishtr): add a scrolling update lifecycle phase. |
| 2726 void FrameView::updateLifecycleToCompositingCleanPlusScrolling() { | 2726 void FrameView::updateLifecycleToCompositingCleanPlusScrolling() { |
| 2727 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) | 2727 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
| 2728 updateAllLifecyclePhasesExceptPaint(); | 2728 updateAllLifecyclePhasesExceptPaint(); |
| 2729 else | 2729 } else { |
| 2730 frame().localFrameRoot()->view()->updateLifecyclePhasesInternal( | 2730 frame().localFrameRoot()->view()->updateLifecyclePhasesInternal( |
| 2731 DocumentLifecycle::CompositingClean); | 2731 DocumentLifecycle::CompositingClean); |
| 2732 } |
| 2732 } | 2733 } |
| 2733 | 2734 |
| 2734 void FrameView::updateAllLifecyclePhasesExceptPaint() { | 2735 void FrameView::updateAllLifecyclePhasesExceptPaint() { |
| 2735 frame().localFrameRoot()->view()->updateLifecyclePhasesInternal( | 2736 frame().localFrameRoot()->view()->updateLifecyclePhasesInternal( |
| 2736 DocumentLifecycle::PrePaintClean); | 2737 DocumentLifecycle::PrePaintClean); |
| 2737 } | 2738 } |
| 2738 | 2739 |
| 2739 void FrameView::updateLifecycleToLayoutClean() { | 2740 void FrameView::updateLifecycleToLayoutClean() { |
| 2740 frame().localFrameRoot()->view()->updateLifecyclePhasesInternal( | 2741 frame().localFrameRoot()->view()->updateLifecyclePhasesInternal( |
| 2741 DocumentLifecycle::LayoutClean); | 2742 DocumentLifecycle::LayoutClean); |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3004 synchronizedPaintRecursively(contentsClippingMaskLayer); | 3005 synchronizedPaintRecursively(contentsClippingMaskLayer); |
| 3005 } | 3006 } |
| 3006 | 3007 |
| 3007 for (auto& child : graphicsLayer->children()) | 3008 for (auto& child : graphicsLayer->children()) |
| 3008 synchronizedPaintRecursively(child); | 3009 synchronizedPaintRecursively(child); |
| 3009 } | 3010 } |
| 3010 | 3011 |
| 3011 void FrameView::pushPaintArtifactToCompositor() { | 3012 void FrameView::pushPaintArtifactToCompositor() { |
| 3012 TRACE_EVENT0("blink", "FrameView::pushPaintArtifactToCompositor"); | 3013 TRACE_EVENT0("blink", "FrameView::pushPaintArtifactToCompositor"); |
| 3013 | 3014 |
| 3014 ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled()); | 3015 DCHECK(RuntimeEnabledFeatures::slimmingPaintV2Enabled()); |
| 3015 | 3016 |
| 3016 Page* page = frame().page(); | 3017 Page* page = frame().page(); |
| 3017 if (!page) | 3018 if (!page) |
| 3018 return; | 3019 return; |
| 3019 | 3020 |
| 3020 if (!m_paintArtifactCompositor) { | 3021 if (!m_paintArtifactCompositor) { |
| 3021 m_paintArtifactCompositor = PaintArtifactCompositor::create(); | 3022 m_paintArtifactCompositor = PaintArtifactCompositor::create(); |
| 3022 page->chromeClient().attachRootLayer( | 3023 page->chromeClient().attachRootLayer( |
| 3023 m_paintArtifactCompositor->getWebLayer(), &frame()); | 3024 m_paintArtifactCompositor->getWebLayer(), &frame()); |
| 3024 } | 3025 } |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3115 frame().loader().stateMachine()->committedFirstRealDocumentLoad()) | 3116 frame().loader().stateMachine()->committedFirstRealDocumentLoad()) |
| 3116 m_isVisuallyNonEmpty = true; | 3117 m_isVisuallyNonEmpty = true; |
| 3117 } | 3118 } |
| 3118 | 3119 |
| 3119 void FrameView::invalidateTreeIfNeededRecursive() { | 3120 void FrameView::invalidateTreeIfNeededRecursive() { |
| 3120 SCOPED_BLINK_UMA_HISTOGRAM_TIMER("Blink.PaintInvalidation.UpdateTime"); | 3121 SCOPED_BLINK_UMA_HISTOGRAM_TIMER("Blink.PaintInvalidation.UpdateTime"); |
| 3121 invalidateTreeIfNeededRecursiveInternal(); | 3122 invalidateTreeIfNeededRecursiveInternal(); |
| 3122 } | 3123 } |
| 3123 | 3124 |
| 3124 void FrameView::invalidateTreeIfNeededRecursiveInternal() { | 3125 void FrameView::invalidateTreeIfNeededRecursiveInternal() { |
| 3125 DCHECK(!RuntimeEnabledFeatures::slimmingPaintV2Enabled()); | 3126 DCHECK(!RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()); |
| 3126 CHECK(layoutView()); | 3127 CHECK(layoutView()); |
| 3127 | 3128 |
| 3128 // We need to stop recursing here since a child frame view might not be | 3129 // We need to stop recursing here since a child frame view might not be |
| 3129 // throttled even though we are (e.g., it didn't compute its visibility yet). | 3130 // throttled even though we are (e.g., it didn't compute its visibility yet). |
| 3130 if (shouldThrottleRendering()) | 3131 if (shouldThrottleRendering()) |
| 3131 return; | 3132 return; |
| 3132 TRACE_EVENT1("blink", "FrameView::invalidateTreeIfNeededRecursive", "root", | 3133 TRACE_EVENT1("blink", "FrameView::invalidateTreeIfNeededRecursive", "root", |
| 3133 layoutView()->debugName().ascii()); | 3134 layoutView()->debugName().ascii()); |
| 3134 | 3135 |
| 3135 Vector<const LayoutObject*> pendingDelayedPaintInvalidations; | 3136 Vector<const LayoutObject*> pendingDelayedPaintInvalidations; |
| (...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3561 return; | 3562 return; |
| 3562 page->chromeClient().setCursor(cursor, m_frame); | 3563 page->chromeClient().setCursor(cursor, m_frame); |
| 3563 } | 3564 } |
| 3564 | 3565 |
| 3565 void FrameView::frameRectsChanged() { | 3566 void FrameView::frameRectsChanged() { |
| 3566 TRACE_EVENT0("blink", "FrameView::frameRectsChanged"); | 3567 TRACE_EVENT0("blink", "FrameView::frameRectsChanged"); |
| 3567 if (layoutSizeFixedToFrameSize()) | 3568 if (layoutSizeFixedToFrameSize()) |
| 3568 setLayoutSizeInternal(frameRect().size()); | 3569 setLayoutSizeInternal(frameRect().size()); |
| 3569 | 3570 |
| 3570 setNeedsUpdateViewportIntersection(); | 3571 setNeedsUpdateViewportIntersection(); |
| 3571 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { | 3572 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) { |
| 3572 // The overflow clip property depends on the frame rect. | 3573 // The overflow clip property depends on the frame rect. |
| 3573 setNeedsPaintPropertyUpdate(); | 3574 setNeedsPaintPropertyUpdate(); |
| 3574 } | 3575 } |
| 3575 | 3576 |
| 3576 for (const auto& child : m_children) | 3577 for (const auto& child : m_children) |
| 3577 child->frameRectsChanged(); | 3578 child->frameRectsChanged(); |
| 3578 } | 3579 } |
| 3579 | 3580 |
| 3580 void FrameView::setLayoutSizeInternal(const IntSize& size) { | 3581 void FrameView::setLayoutSizeInternal(const IntSize& size) { |
| 3581 if (m_layoutSize == size) | 3582 if (m_layoutSize == size) |
| (...skipping 1069 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4651 DCHECK(m_frame->isMainFrame()); | 4652 DCHECK(m_frame->isMainFrame()); |
| 4652 return m_initialViewportSize.width(); | 4653 return m_initialViewportSize.width(); |
| 4653 } | 4654 } |
| 4654 | 4655 |
| 4655 int FrameView::initialViewportHeight() const { | 4656 int FrameView::initialViewportHeight() const { |
| 4656 DCHECK(m_frame->isMainFrame()); | 4657 DCHECK(m_frame->isMainFrame()); |
| 4657 return m_initialViewportSize.height(); | 4658 return m_initialViewportSize.height(); |
| 4658 } | 4659 } |
| 4659 | 4660 |
| 4660 } // namespace blink | 4661 } // namespace blink |
| OLD | NEW |