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