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 Optional<CompositorElementIdSet> compositedAnimationElementIds; |
3106 pushPaintArtifactToCompositor(); | 3106 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
3107 compositedAnimationElementIds.emplace(); | |
pdr.
2017/03/16 21:20:05
Is "animation" correct here? Are we returning comp
wkorman
2017/03/16 21:53:31
Name needs improvement, agreed, let's come up with
pdr.
2017/03/16 22:16:01
compositedElementIds SGTM
short is beautiful
| |
3108 pushPaintArtifactToCompositor(compositedAnimationElementIds.value()); | |
pdr.
2017/03/16 21:20:05
Idea for not needing to pass this Optional around
wkorman
2017/03/16 21:53:31
I like this general idea. How do you envision mark
pdr.
2017/03/16 22:16:01
I was thinking about re-using setEffectSuppressed
wkorman
2017/03/16 22:32:25
Yes, but the overhead of an omnipresent bool field
| |
3109 } | |
3107 | 3110 |
3108 DCHECK(!view.hasPendingSelection()); | 3111 DCHECK(!view.hasPendingSelection()); |
3109 DCHECK((m_frame->document()->printing() && | 3112 DCHECK((m_frame->document()->printing() && |
3110 lifecycle().state() == DocumentLifecycle::PrePaintClean) || | 3113 lifecycle().state() == DocumentLifecycle::PrePaintClean) || |
3111 lifecycle().state() == DocumentLifecycle::PaintClean); | 3114 lifecycle().state() == DocumentLifecycle::PaintClean); |
3112 | 3115 |
3113 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { | 3116 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
3114 DocumentAnimations::updateAnimations(layoutView()->document(), | 3117 DocumentAnimations::updateAnimations(layoutView()->document(), |
pdr.
2017/03/16 21:20:05
Can this call be moved right after pushPaintArtifa
wkorman
2017/03/16 21:53:31
Yes, though I think we'd want to duplicate the two
pdr.
2017/03/16 22:16:01
Do the checks actually need to come before updateA
| |
3115 DocumentLifecycle::PaintClean); | 3118 DocumentLifecycle::PaintClean, |
3119 compositedAnimationElementIds); | |
3116 } | 3120 } |
3117 } | 3121 } |
3118 | 3122 |
3119 forAllNonThrottledFrameViews([](FrameView& frameView) { | 3123 forAllNonThrottledFrameViews([](FrameView& frameView) { |
3120 frameView.checkDoesNotNeedLayout(); | 3124 frameView.checkDoesNotNeedLayout(); |
3121 frameView.m_allowsLayoutInvalidationAfterLayoutClean = true; | 3125 frameView.m_allowsLayoutInvalidationAfterLayoutClean = true; |
3122 }); | 3126 }); |
3123 } | 3127 } |
3124 | 3128 |
3125 updateViewportIntersectionsForSubtree(targetState); | 3129 updateViewportIntersectionsForSubtree(targetState); |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3244 paintGraphicsLayerRecursively(maskLayer); | 3248 paintGraphicsLayerRecursively(maskLayer); |
3245 if (GraphicsLayer* contentsClippingMaskLayer = | 3249 if (GraphicsLayer* contentsClippingMaskLayer = |
3246 graphicsLayer->contentsClippingMaskLayer()) | 3250 graphicsLayer->contentsClippingMaskLayer()) |
3247 paintGraphicsLayerRecursively(contentsClippingMaskLayer); | 3251 paintGraphicsLayerRecursively(contentsClippingMaskLayer); |
3248 } | 3252 } |
3249 | 3253 |
3250 for (auto& child : graphicsLayer->children()) | 3254 for (auto& child : graphicsLayer->children()) |
3251 paintGraphicsLayerRecursively(child); | 3255 paintGraphicsLayerRecursively(child); |
3252 } | 3256 } |
3253 | 3257 |
3254 void FrameView::pushPaintArtifactToCompositor() { | 3258 void FrameView::pushPaintArtifactToCompositor( |
3259 CompositorElementIdSet& compositedAnimationElementIds) { | |
3255 TRACE_EVENT0("blink", "FrameView::pushPaintArtifactToCompositor"); | 3260 TRACE_EVENT0("blink", "FrameView::pushPaintArtifactToCompositor"); |
3256 | 3261 |
3257 DCHECK(RuntimeEnabledFeatures::slimmingPaintV2Enabled()); | 3262 DCHECK(RuntimeEnabledFeatures::slimmingPaintV2Enabled()); |
3258 | 3263 |
3259 Page* page = frame().page(); | 3264 Page* page = frame().page(); |
3260 if (!page) | 3265 if (!page) |
3261 return; | 3266 return; |
3262 | 3267 |
3263 if (!m_paintArtifactCompositor) { | 3268 if (!m_paintArtifactCompositor) { |
3264 m_paintArtifactCompositor = PaintArtifactCompositor::create(); | 3269 m_paintArtifactCompositor = PaintArtifactCompositor::create(); |
3265 page->chromeClient().attachRootLayer( | 3270 page->chromeClient().attachRootLayer( |
3266 m_paintArtifactCompositor->getWebLayer(), &frame()); | 3271 m_paintArtifactCompositor->getWebLayer(), &frame()); |
3267 } | 3272 } |
3268 | 3273 |
3269 SCOPED_BLINK_UMA_HISTOGRAM_TIMER("Blink.Compositing.UpdateTime"); | 3274 SCOPED_BLINK_UMA_HISTOGRAM_TIMER("Blink.Compositing.UpdateTime"); |
3270 | 3275 |
3271 DCHECK(m_geometryMapper.get()); | 3276 DCHECK(m_geometryMapper.get()); |
3272 m_paintArtifactCompositor->update( | 3277 m_paintArtifactCompositor->update( |
3273 m_paintController->paintArtifact(), | 3278 m_paintController->paintArtifact(), |
3274 m_paintController->paintChunksRasterInvalidationTrackingMap(), | 3279 m_paintController->paintChunksRasterInvalidationTrackingMap(), |
3275 m_isStoringCompositedLayerDebugInfo, *m_geometryMapper); | 3280 m_isStoringCompositedLayerDebugInfo, *m_geometryMapper, |
3281 compositedAnimationElementIds); | |
3276 } | 3282 } |
3277 | 3283 |
3278 std::unique_ptr<JSONObject> FrameView::compositedLayersAsJSON( | 3284 std::unique_ptr<JSONObject> FrameView::compositedLayersAsJSON( |
3279 LayerTreeFlags flags) { | 3285 LayerTreeFlags flags) { |
3280 return frame() | 3286 return frame() |
3281 .localFrameRoot() | 3287 .localFrameRoot() |
3282 ->view() | 3288 ->view() |
3283 ->m_paintArtifactCompositor->layersAsJSON(flags); | 3289 ->m_paintArtifactCompositor->layersAsJSON(flags); |
3284 } | 3290 } |
3285 | 3291 |
(...skipping 1976 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5262 void FrameView::setAnimationHost( | 5268 void FrameView::setAnimationHost( |
5263 std::unique_ptr<CompositorAnimationHost> host) { | 5269 std::unique_ptr<CompositorAnimationHost> host) { |
5264 m_animationHost = std::move(host); | 5270 m_animationHost = std::move(host); |
5265 } | 5271 } |
5266 | 5272 |
5267 LayoutUnit FrameView::caretWidth() const { | 5273 LayoutUnit FrameView::caretWidth() const { |
5268 return LayoutUnit(getHostWindow()->windowToViewportScalar(1)); | 5274 return LayoutUnit(getHostWindow()->windowToViewportScalar(1)); |
5269 } | 5275 } |
5270 | 5276 |
5271 } // namespace blink | 5277 } // namespace blink |
OLD | NEW |