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 3084 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3095 // for slimming paint v2. | 3095 // for slimming paint v2. |
3096 if (targetState >= DocumentLifecycle::PrePaintClean) | 3096 if (targetState >= DocumentLifecycle::PrePaintClean) |
3097 prePaint(); | 3097 prePaint(); |
3098 } | 3098 } |
3099 | 3099 |
3100 if (targetState == DocumentLifecycle::PaintClean) { | 3100 if (targetState == DocumentLifecycle::PaintClean) { |
3101 if (!m_frame->document()->printing() || | 3101 if (!m_frame->document()->printing() || |
3102 RuntimeEnabledFeatures::printBrowserEnabled()) | 3102 RuntimeEnabledFeatures::printBrowserEnabled()) |
3103 paintTree(); | 3103 paintTree(); |
3104 | 3104 |
3105 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) | 3105 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
3106 pushPaintArtifactToCompositor(); | 3106 Optional<CompositorElementIdSet> compositedElementIds = |
| 3107 CompositorElementIdSet(); |
| 3108 pushPaintArtifactToCompositor(compositedElementIds.value()); |
| 3109 DocumentAnimations::updateAnimations(layoutView()->document(), |
| 3110 DocumentLifecycle::PaintClean, |
| 3111 compositedElementIds); |
| 3112 } |
3107 | 3113 |
3108 DCHECK(!view.hasPendingSelection()); | 3114 DCHECK(!view.hasPendingSelection()); |
3109 DCHECK((m_frame->document()->printing() && | 3115 DCHECK((m_frame->document()->printing() && |
3110 lifecycle().state() == DocumentLifecycle::PrePaintClean) || | 3116 lifecycle().state() == DocumentLifecycle::PrePaintClean) || |
3111 lifecycle().state() == DocumentLifecycle::PaintClean); | 3117 lifecycle().state() == DocumentLifecycle::PaintClean); |
3112 | |
3113 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { | |
3114 DocumentAnimations::updateAnimations(layoutView()->document(), | |
3115 DocumentLifecycle::PaintClean); | |
3116 } | |
3117 } | 3118 } |
3118 | 3119 |
3119 forAllNonThrottledFrameViews([](FrameView& frameView) { | 3120 forAllNonThrottledFrameViews([](FrameView& frameView) { |
3120 frameView.checkDoesNotNeedLayout(); | 3121 frameView.checkDoesNotNeedLayout(); |
3121 frameView.m_allowsLayoutInvalidationAfterLayoutClean = true; | 3122 frameView.m_allowsLayoutInvalidationAfterLayoutClean = true; |
3122 }); | 3123 }); |
3123 } | 3124 } |
3124 | 3125 |
3125 updateViewportIntersectionsForSubtree(targetState); | 3126 updateViewportIntersectionsForSubtree(targetState); |
3126 } | 3127 } |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3243 if (GraphicsLayer* maskLayer = graphicsLayer->maskLayer()) | 3244 if (GraphicsLayer* maskLayer = graphicsLayer->maskLayer()) |
3244 paintGraphicsLayerRecursively(maskLayer); | 3245 paintGraphicsLayerRecursively(maskLayer); |
3245 if (GraphicsLayer* contentsClippingMaskLayer = | 3246 if (GraphicsLayer* contentsClippingMaskLayer = |
3246 graphicsLayer->contentsClippingMaskLayer()) | 3247 graphicsLayer->contentsClippingMaskLayer()) |
3247 paintGraphicsLayerRecursively(contentsClippingMaskLayer); | 3248 paintGraphicsLayerRecursively(contentsClippingMaskLayer); |
3248 | 3249 |
3249 for (auto& child : graphicsLayer->children()) | 3250 for (auto& child : graphicsLayer->children()) |
3250 paintGraphicsLayerRecursively(child); | 3251 paintGraphicsLayerRecursively(child); |
3251 } | 3252 } |
3252 | 3253 |
3253 void FrameView::pushPaintArtifactToCompositor() { | 3254 void FrameView::pushPaintArtifactToCompositor( |
| 3255 CompositorElementIdSet& compositedElementIds) { |
3254 TRACE_EVENT0("blink", "FrameView::pushPaintArtifactToCompositor"); | 3256 TRACE_EVENT0("blink", "FrameView::pushPaintArtifactToCompositor"); |
3255 | 3257 |
3256 DCHECK(RuntimeEnabledFeatures::slimmingPaintV2Enabled()); | 3258 DCHECK(RuntimeEnabledFeatures::slimmingPaintV2Enabled()); |
3257 | 3259 |
3258 Page* page = frame().page(); | 3260 Page* page = frame().page(); |
3259 if (!page) | 3261 if (!page) |
3260 return; | 3262 return; |
3261 | 3263 |
3262 if (!m_paintArtifactCompositor) { | 3264 if (!m_paintArtifactCompositor) { |
3263 m_paintArtifactCompositor = PaintArtifactCompositor::create(); | 3265 m_paintArtifactCompositor = PaintArtifactCompositor::create(); |
3264 page->chromeClient().attachRootLayer( | 3266 page->chromeClient().attachRootLayer( |
3265 m_paintArtifactCompositor->getWebLayer(), &frame()); | 3267 m_paintArtifactCompositor->getWebLayer(), &frame()); |
3266 } | 3268 } |
3267 | 3269 |
3268 SCOPED_BLINK_UMA_HISTOGRAM_TIMER("Blink.Compositing.UpdateTime"); | 3270 SCOPED_BLINK_UMA_HISTOGRAM_TIMER("Blink.Compositing.UpdateTime"); |
3269 | 3271 |
3270 DCHECK(m_geometryMapper.get()); | 3272 DCHECK(m_geometryMapper.get()); |
3271 m_paintArtifactCompositor->update( | 3273 m_paintArtifactCompositor->update( |
3272 m_paintController->paintArtifact(), | 3274 m_paintController->paintArtifact(), |
3273 m_paintController->paintChunksRasterInvalidationTrackingMap(), | 3275 m_paintController->paintChunksRasterInvalidationTrackingMap(), |
3274 m_isStoringCompositedLayerDebugInfo, *m_geometryMapper); | 3276 m_isStoringCompositedLayerDebugInfo, *m_geometryMapper, |
| 3277 compositedElementIds); |
3275 } | 3278 } |
3276 | 3279 |
3277 std::unique_ptr<JSONObject> FrameView::compositedLayersAsJSON( | 3280 std::unique_ptr<JSONObject> FrameView::compositedLayersAsJSON( |
3278 LayerTreeFlags flags) { | 3281 LayerTreeFlags flags) { |
3279 return frame() | 3282 return frame() |
3280 .localFrameRoot() | 3283 .localFrameRoot() |
3281 ->view() | 3284 ->view() |
3282 ->m_paintArtifactCompositor->layersAsJSON(flags); | 3285 ->m_paintArtifactCompositor->layersAsJSON(flags); |
3283 } | 3286 } |
3284 | 3287 |
(...skipping 1976 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5261 void FrameView::setAnimationHost( | 5264 void FrameView::setAnimationHost( |
5262 std::unique_ptr<CompositorAnimationHost> host) { | 5265 std::unique_ptr<CompositorAnimationHost> host) { |
5263 m_animationHost = std::move(host); | 5266 m_animationHost = std::move(host); |
5264 } | 5267 } |
5265 | 5268 |
5266 LayoutUnit FrameView::caretWidth() const { | 5269 LayoutUnit FrameView::caretWidth() const { |
5267 return LayoutUnit(getHostWindow()->windowToViewportScalar(1)); | 5270 return LayoutUnit(getHostWindow()->windowToViewportScalar(1)); |
5268 } | 5271 } |
5269 | 5272 |
5270 } // namespace blink | 5273 } // namespace blink |
OLD | NEW |