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 3063 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3074 // for slimming paint v2. | 3074 // for slimming paint v2. |
3075 if (targetState >= DocumentLifecycle::PrePaintClean) | 3075 if (targetState >= DocumentLifecycle::PrePaintClean) |
3076 prePaint(); | 3076 prePaint(); |
3077 } | 3077 } |
3078 | 3078 |
3079 if (targetState == DocumentLifecycle::PaintClean) { | 3079 if (targetState == DocumentLifecycle::PaintClean) { |
3080 if (!m_frame->document()->printing() || | 3080 if (!m_frame->document()->printing() || |
3081 RuntimeEnabledFeatures::printBrowserEnabled()) | 3081 RuntimeEnabledFeatures::printBrowserEnabled()) |
3082 paintTree(); | 3082 paintTree(); |
3083 | 3083 |
3084 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) | 3084 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
3085 pushPaintArtifactToCompositor(); | 3085 Optional<CompositorElementIdSet> compositedElementIds = |
| 3086 CompositorElementIdSet(); |
| 3087 pushPaintArtifactToCompositor(compositedElementIds.value()); |
| 3088 DocumentAnimations::updateAnimations(layoutView()->document(), |
| 3089 DocumentLifecycle::PaintClean, |
| 3090 compositedElementIds); |
| 3091 } |
3086 | 3092 |
3087 DCHECK(!view.hasPendingSelection()); | 3093 DCHECK(!view.hasPendingSelection()); |
3088 DCHECK((m_frame->document()->printing() && | 3094 DCHECK((m_frame->document()->printing() && |
3089 lifecycle().state() == DocumentLifecycle::PrePaintClean) || | 3095 lifecycle().state() == DocumentLifecycle::PrePaintClean) || |
3090 lifecycle().state() == DocumentLifecycle::PaintClean); | 3096 lifecycle().state() == DocumentLifecycle::PaintClean); |
3091 | |
3092 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { | |
3093 DocumentAnimations::updateAnimations(layoutView()->document(), | |
3094 DocumentLifecycle::PaintClean); | |
3095 } | |
3096 } | 3097 } |
3097 | 3098 |
3098 forAllNonThrottledFrameViews([](FrameView& frameView) { | 3099 forAllNonThrottledFrameViews([](FrameView& frameView) { |
3099 frameView.checkDoesNotNeedLayout(); | 3100 frameView.checkDoesNotNeedLayout(); |
3100 frameView.m_allowsLayoutInvalidationAfterLayoutClean = true; | 3101 frameView.m_allowsLayoutInvalidationAfterLayoutClean = true; |
3101 }); | 3102 }); |
3102 } | 3103 } |
3103 | 3104 |
3104 updateViewportIntersectionsForSubtree(targetState); | 3105 updateViewportIntersectionsForSubtree(targetState); |
3105 } | 3106 } |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3224 if (GraphicsLayer* maskLayer = graphicsLayer->maskLayer()) | 3225 if (GraphicsLayer* maskLayer = graphicsLayer->maskLayer()) |
3225 paintGraphicsLayerRecursively(maskLayer); | 3226 paintGraphicsLayerRecursively(maskLayer); |
3226 if (GraphicsLayer* contentsClippingMaskLayer = | 3227 if (GraphicsLayer* contentsClippingMaskLayer = |
3227 graphicsLayer->contentsClippingMaskLayer()) | 3228 graphicsLayer->contentsClippingMaskLayer()) |
3228 paintGraphicsLayerRecursively(contentsClippingMaskLayer); | 3229 paintGraphicsLayerRecursively(contentsClippingMaskLayer); |
3229 | 3230 |
3230 for (auto& child : graphicsLayer->children()) | 3231 for (auto& child : graphicsLayer->children()) |
3231 paintGraphicsLayerRecursively(child); | 3232 paintGraphicsLayerRecursively(child); |
3232 } | 3233 } |
3233 | 3234 |
3234 void FrameView::pushPaintArtifactToCompositor() { | 3235 void FrameView::pushPaintArtifactToCompositor( |
| 3236 CompositorElementIdSet& compositedElementIds) { |
3235 TRACE_EVENT0("blink", "FrameView::pushPaintArtifactToCompositor"); | 3237 TRACE_EVENT0("blink", "FrameView::pushPaintArtifactToCompositor"); |
3236 | 3238 |
3237 DCHECK(RuntimeEnabledFeatures::slimmingPaintV2Enabled()); | 3239 DCHECK(RuntimeEnabledFeatures::slimmingPaintV2Enabled()); |
3238 | 3240 |
3239 Page* page = frame().page(); | 3241 Page* page = frame().page(); |
3240 if (!page) | 3242 if (!page) |
3241 return; | 3243 return; |
3242 | 3244 |
3243 if (!m_paintArtifactCompositor) { | 3245 if (!m_paintArtifactCompositor) { |
3244 m_paintArtifactCompositor = PaintArtifactCompositor::create(); | 3246 m_paintArtifactCompositor = PaintArtifactCompositor::create(); |
3245 page->chromeClient().attachRootLayer( | 3247 page->chromeClient().attachRootLayer( |
3246 m_paintArtifactCompositor->getWebLayer(), &frame()); | 3248 m_paintArtifactCompositor->getWebLayer(), &frame()); |
3247 } | 3249 } |
3248 | 3250 |
3249 SCOPED_BLINK_UMA_HISTOGRAM_TIMER("Blink.Compositing.UpdateTime"); | 3251 SCOPED_BLINK_UMA_HISTOGRAM_TIMER("Blink.Compositing.UpdateTime"); |
3250 | 3252 |
3251 m_paintArtifactCompositor->update( | 3253 m_paintArtifactCompositor->update( |
3252 m_paintController->paintArtifact(), | 3254 m_paintController->paintArtifact(), |
3253 m_paintController->paintChunksRasterInvalidationTrackingMap(), | 3255 m_paintController->paintChunksRasterInvalidationTrackingMap(), |
3254 m_isStoringCompositedLayerDebugInfo); | 3256 m_isStoringCompositedLayerDebugInfo, compositedElementIds); |
3255 } | 3257 } |
3256 | 3258 |
3257 std::unique_ptr<JSONObject> FrameView::compositedLayersAsJSON( | 3259 std::unique_ptr<JSONObject> FrameView::compositedLayersAsJSON( |
3258 LayerTreeFlags flags) { | 3260 LayerTreeFlags flags) { |
3259 return frame() | 3261 return frame() |
3260 .localFrameRoot() | 3262 .localFrameRoot() |
3261 ->view() | 3263 ->view() |
3262 ->m_paintArtifactCompositor->layersAsJSON(flags); | 3264 ->m_paintArtifactCompositor->layersAsJSON(flags); |
3263 } | 3265 } |
3264 | 3266 |
(...skipping 2002 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5267 void FrameView::setAnimationHost( | 5269 void FrameView::setAnimationHost( |
5268 std::unique_ptr<CompositorAnimationHost> host) { | 5270 std::unique_ptr<CompositorAnimationHost> host) { |
5269 m_animationHost = std::move(host); | 5271 m_animationHost = std::move(host); |
5270 } | 5272 } |
5271 | 5273 |
5272 LayoutUnit FrameView::caretWidth() const { | 5274 LayoutUnit FrameView::caretWidth() const { |
5273 return LayoutUnit(getHostWindow()->windowToViewportScalar(1)); | 5275 return LayoutUnit(getHostWindow()->windowToViewportScalar(1)); |
5274 } | 5276 } |
5275 | 5277 |
5276 } // namespace blink | 5278 } // namespace blink |
OLD | NEW |