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 3218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3229 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) { | 3229 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) { |
3230 SCOPED_BLINK_UMA_HISTOGRAM_TIMER("Blink.PrePaint.UpdateTime"); | 3230 SCOPED_BLINK_UMA_HISTOGRAM_TIMER("Blink.PrePaint.UpdateTime"); |
3231 PrePaintTreeWalk().Walk(*this); | 3231 PrePaintTreeWalk().Walk(*this); |
3232 } | 3232 } |
3233 | 3233 |
3234 ForAllNonThrottledFrameViews([](FrameView& frame_view) { | 3234 ForAllNonThrottledFrameViews([](FrameView& frame_view) { |
3235 frame_view.Lifecycle().AdvanceTo(DocumentLifecycle::kPrePaintClean); | 3235 frame_view.Lifecycle().AdvanceTo(DocumentLifecycle::kPrePaintClean); |
3236 }); | 3236 }); |
3237 } | 3237 } |
3238 | 3238 |
| 3239 void FrameView::NotifyPaint(const PaintController& paint_controller) const { |
| 3240 DCHECK(frame_->GetDocument()); |
| 3241 PaintTiming::From(*frame_->GetDocument()) |
| 3242 .NotifyPaint(paint_controller.FirstPainted(), |
| 3243 paint_controller.TextPainted(), |
| 3244 paint_controller.ImagePainted()); |
| 3245 } |
| 3246 |
3239 void FrameView::PaintTree() { | 3247 void FrameView::PaintTree() { |
3240 TRACE_EVENT0("blink", "FrameView::paintTree"); | 3248 TRACE_EVENT0("blink", "FrameView::paintTree"); |
3241 SCOPED_BLINK_UMA_HISTOGRAM_TIMER("Blink.Paint.UpdateTime"); | 3249 SCOPED_BLINK_UMA_HISTOGRAM_TIMER("Blink.Paint.UpdateTime"); |
3242 | 3250 |
3243 ASSERT(GetFrame() == GetPage()->MainFrame() || | 3251 ASSERT(GetFrame() == GetPage()->MainFrame() || |
3244 (!GetFrame().Tree().Parent()->IsLocalFrame())); | 3252 (!GetFrame().Tree().Parent()->IsLocalFrame())); |
3245 | 3253 |
3246 LayoutViewItem view = GetLayoutViewItem(); | 3254 LayoutViewItem view = GetLayoutViewItem(); |
3247 DCHECK(!view.IsNull()); | 3255 DCHECK(!view.IsNull()); |
3248 ForAllNonThrottledFrameViews([](FrameView& frame_view) { | 3256 ForAllNonThrottledFrameViews([](FrameView& frame_view) { |
3249 frame_view.Lifecycle().AdvanceTo(DocumentLifecycle::kInPaint); | 3257 frame_view.Lifecycle().AdvanceTo(DocumentLifecycle::kInPaint); |
3250 }); | 3258 }); |
3251 | 3259 |
3252 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { | 3260 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
3253 if (GetLayoutView()->Layer()->NeedsRepaint()) { | 3261 if (GetLayoutView()->Layer()->NeedsRepaint()) { |
3254 GraphicsContext graphics_context(*paint_controller_); | 3262 GraphicsContext graphics_context(*paint_controller_); |
3255 if (RuntimeEnabledFeatures::printBrowserEnabled()) | 3263 if (RuntimeEnabledFeatures::printBrowserEnabled()) |
3256 graphics_context.SetPrinting(true); | 3264 graphics_context.SetPrinting(true); |
3257 Paint(graphics_context, CullRect(LayoutRect::InfiniteIntRect())); | 3265 Paint(graphics_context, CullRect(LayoutRect::InfiniteIntRect())); |
3258 paint_controller_->CommitNewDisplayItems(LayoutSize()); | 3266 paint_controller_->CommitNewDisplayItems(LayoutSize()); |
| 3267 NotifyPaint(*paint_controller_); |
3259 } | 3268 } |
3260 } else { | 3269 } else { |
3261 // A null graphics layer can occur for painting of SVG images that are not | 3270 // A null graphics layer can occur for painting of SVG images that are not |
3262 // parented into the main frame tree, or when the FrameView is the main | 3271 // parented into the main frame tree, or when the FrameView is the main |
3263 // frame view of a page overlay. The page overlay is in the layer tree of | 3272 // frame view of a page overlay. The page overlay is in the layer tree of |
3264 // the host page and will be painted during painting of the host page. | 3273 // the host page and will be painted during painting of the host page. |
3265 if (GraphicsLayer* root_graphics_layer = | 3274 if (GraphicsLayer* root_graphics_layer = |
3266 view.Compositor()->RootGraphicsLayer()) { | 3275 view.Compositor()->RootGraphicsLayer()) { |
3267 PaintGraphicsLayerRecursively(root_graphics_layer); | 3276 PaintGraphicsLayerRecursively(root_graphics_layer); |
3268 } | 3277 } |
(...skipping 21 matching lines...) Expand all Loading... |
3290 LayoutViewItem layout_view_item = frame_view.GetLayoutViewItem(); | 3299 LayoutViewItem layout_view_item = frame_view.GetLayoutViewItem(); |
3291 if (!layout_view_item.IsNull()) | 3300 if (!layout_view_item.IsNull()) |
3292 layout_view_item.Layer()->ClearNeedsRepaintRecursively(); | 3301 layout_view_item.Layer()->ClearNeedsRepaintRecursively(); |
3293 }); | 3302 }); |
3294 } | 3303 } |
3295 | 3304 |
3296 void FrameView::PaintGraphicsLayerRecursively(GraphicsLayer* graphics_layer) { | 3305 void FrameView::PaintGraphicsLayerRecursively(GraphicsLayer* graphics_layer) { |
3297 DCHECK(!RuntimeEnabledFeatures::slimmingPaintV2Enabled()); | 3306 DCHECK(!RuntimeEnabledFeatures::slimmingPaintV2Enabled()); |
3298 if (graphics_layer->DrawsContent()) { | 3307 if (graphics_layer->DrawsContent()) { |
3299 graphics_layer->Paint(nullptr); | 3308 graphics_layer->Paint(nullptr); |
| 3309 NotifyPaint(graphics_layer->GetPaintController()); |
3300 } | 3310 } |
3301 | 3311 |
3302 if (GraphicsLayer* mask_layer = graphics_layer->MaskLayer()) | 3312 if (GraphicsLayer* mask_layer = graphics_layer->MaskLayer()) |
3303 PaintGraphicsLayerRecursively(mask_layer); | 3313 PaintGraphicsLayerRecursively(mask_layer); |
3304 if (GraphicsLayer* contents_clipping_mask_layer = | 3314 if (GraphicsLayer* contents_clipping_mask_layer = |
3305 graphics_layer->ContentsClippingMaskLayer()) | 3315 graphics_layer->ContentsClippingMaskLayer()) |
3306 PaintGraphicsLayerRecursively(contents_clipping_mask_layer); | 3316 PaintGraphicsLayerRecursively(contents_clipping_mask_layer); |
3307 | 3317 |
3308 for (auto& child : graphics_layer->Children()) | 3318 for (auto& child : graphics_layer->Children()) |
3309 PaintGraphicsLayerRecursively(child); | 3319 PaintGraphicsLayerRecursively(child); |
(...skipping 2079 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5389 void FrameView::SetAnimationHost( | 5399 void FrameView::SetAnimationHost( |
5390 std::unique_ptr<CompositorAnimationHost> host) { | 5400 std::unique_ptr<CompositorAnimationHost> host) { |
5391 animation_host_ = std::move(host); | 5401 animation_host_ = std::move(host); |
5392 } | 5402 } |
5393 | 5403 |
5394 LayoutUnit FrameView::CaretWidth() const { | 5404 LayoutUnit FrameView::CaretWidth() const { |
5395 return LayoutUnit(GetChromeClient()->WindowToViewportScalar(1)); | 5405 return LayoutUnit(GetChromeClient()->WindowToViewportScalar(1)); |
5396 } | 5406 } |
5397 | 5407 |
5398 } // namespace blink | 5408 } // namespace blink |
OLD | NEW |