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 3226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3237 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) { | 3237 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) { |
3238 SCOPED_BLINK_UMA_HISTOGRAM_TIMER("Blink.PrePaint.UpdateTime"); | 3238 SCOPED_BLINK_UMA_HISTOGRAM_TIMER("Blink.PrePaint.UpdateTime"); |
3239 PrePaintTreeWalk().Walk(*this); | 3239 PrePaintTreeWalk().Walk(*this); |
3240 } | 3240 } |
3241 | 3241 |
3242 ForAllNonThrottledFrameViews([](FrameView& frame_view) { | 3242 ForAllNonThrottledFrameViews([](FrameView& frame_view) { |
3243 frame_view.Lifecycle().AdvanceTo(DocumentLifecycle::kPrePaintClean); | 3243 frame_view.Lifecycle().AdvanceTo(DocumentLifecycle::kPrePaintClean); |
3244 }); | 3244 }); |
3245 } | 3245 } |
3246 | 3246 |
3247 void FrameView::NotifyPaint(const PaintController& paint_controller) const { | |
3248 DCHECK(frame_->GetDocument()); | |
3249 PaintTiming::From(*frame_->GetDocument()) | |
3250 .NotifyPaint(paint_controller.FirstPainted(), | |
3251 paint_controller.TextPainted(), | |
3252 paint_controller.ImagePainted()); | |
3253 } | |
3254 | |
3255 void FrameView::PaintTree() { | 3247 void FrameView::PaintTree() { |
3256 TRACE_EVENT0("blink", "FrameView::paintTree"); | 3248 TRACE_EVENT0("blink", "FrameView::paintTree"); |
3257 SCOPED_BLINK_UMA_HISTOGRAM_TIMER("Blink.Paint.UpdateTime"); | 3249 SCOPED_BLINK_UMA_HISTOGRAM_TIMER("Blink.Paint.UpdateTime"); |
3258 | 3250 |
3259 ASSERT(GetFrame() == GetPage()->MainFrame() || | 3251 ASSERT(GetFrame() == GetPage()->MainFrame() || |
3260 (!GetFrame().Tree().Parent()->IsLocalFrame())); | 3252 (!GetFrame().Tree().Parent()->IsLocalFrame())); |
3261 | 3253 |
3262 LayoutViewItem view = GetLayoutViewItem(); | 3254 LayoutViewItem view = GetLayoutViewItem(); |
3263 DCHECK(!view.IsNull()); | 3255 DCHECK(!view.IsNull()); |
3264 ForAllNonThrottledFrameViews([](FrameView& frame_view) { | 3256 ForAllNonThrottledFrameViews([](FrameView& frame_view) { |
3265 frame_view.Lifecycle().AdvanceTo(DocumentLifecycle::kInPaint); | 3257 frame_view.Lifecycle().AdvanceTo(DocumentLifecycle::kInPaint); |
3266 }); | 3258 }); |
3267 | 3259 |
3268 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { | 3260 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
3269 if (GetLayoutView()->Layer()->NeedsRepaint()) { | 3261 if (GetLayoutView()->Layer()->NeedsRepaint()) { |
3270 GraphicsContext graphics_context(*paint_controller_); | 3262 GraphicsContext graphics_context(*paint_controller_); |
3271 if (RuntimeEnabledFeatures::printBrowserEnabled()) | 3263 if (RuntimeEnabledFeatures::printBrowserEnabled()) |
3272 graphics_context.SetPrinting(true); | 3264 graphics_context.SetPrinting(true); |
3273 Paint(graphics_context, CullRect(LayoutRect::InfiniteIntRect())); | 3265 Paint(graphics_context, CullRect(LayoutRect::InfiniteIntRect())); |
3274 paint_controller_->CommitNewDisplayItems(LayoutSize()); | 3266 paint_controller_->CommitNewDisplayItems(LayoutSize()); |
3275 NotifyPaint(*paint_controller_); | |
3276 } | 3267 } |
3277 } else { | 3268 } else { |
3278 // A null graphics layer can occur for painting of SVG images that are not | 3269 // A null graphics layer can occur for painting of SVG images that are not |
3279 // parented into the main frame tree, or when the FrameView is the main | 3270 // parented into the main frame tree, or when the FrameView is the main |
3280 // frame view of a page overlay. The page overlay is in the layer tree of | 3271 // frame view of a page overlay. The page overlay is in the layer tree of |
3281 // the host page and will be painted during painting of the host page. | 3272 // the host page and will be painted during painting of the host page. |
3282 if (GraphicsLayer* root_graphics_layer = | 3273 if (GraphicsLayer* root_graphics_layer = |
3283 view.Compositor()->RootGraphicsLayer()) { | 3274 view.Compositor()->RootGraphicsLayer()) { |
3284 PaintGraphicsLayerRecursively(root_graphics_layer); | 3275 PaintGraphicsLayerRecursively(root_graphics_layer); |
3285 } | 3276 } |
(...skipping 21 matching lines...) Expand all Loading... |
3307 LayoutViewItem layout_view_item = frame_view.GetLayoutViewItem(); | 3298 LayoutViewItem layout_view_item = frame_view.GetLayoutViewItem(); |
3308 if (!layout_view_item.IsNull()) | 3299 if (!layout_view_item.IsNull()) |
3309 layout_view_item.Layer()->ClearNeedsRepaintRecursively(); | 3300 layout_view_item.Layer()->ClearNeedsRepaintRecursively(); |
3310 }); | 3301 }); |
3311 } | 3302 } |
3312 | 3303 |
3313 void FrameView::PaintGraphicsLayerRecursively(GraphicsLayer* graphics_layer) { | 3304 void FrameView::PaintGraphicsLayerRecursively(GraphicsLayer* graphics_layer) { |
3314 DCHECK(!RuntimeEnabledFeatures::slimmingPaintV2Enabled()); | 3305 DCHECK(!RuntimeEnabledFeatures::slimmingPaintV2Enabled()); |
3315 if (graphics_layer->DrawsContent()) { | 3306 if (graphics_layer->DrawsContent()) { |
3316 graphics_layer->Paint(nullptr); | 3307 graphics_layer->Paint(nullptr); |
3317 NotifyPaint(graphics_layer->GetPaintController()); | |
3318 } | 3308 } |
3319 | 3309 |
3320 if (GraphicsLayer* mask_layer = graphics_layer->MaskLayer()) | 3310 if (GraphicsLayer* mask_layer = graphics_layer->MaskLayer()) |
3321 PaintGraphicsLayerRecursively(mask_layer); | 3311 PaintGraphicsLayerRecursively(mask_layer); |
3322 if (GraphicsLayer* contents_clipping_mask_layer = | 3312 if (GraphicsLayer* contents_clipping_mask_layer = |
3323 graphics_layer->ContentsClippingMaskLayer()) | 3313 graphics_layer->ContentsClippingMaskLayer()) |
3324 PaintGraphicsLayerRecursively(contents_clipping_mask_layer); | 3314 PaintGraphicsLayerRecursively(contents_clipping_mask_layer); |
3325 | 3315 |
3326 for (auto& child : graphics_layer->Children()) | 3316 for (auto& child : graphics_layer->Children()) |
3327 PaintGraphicsLayerRecursively(child); | 3317 PaintGraphicsLayerRecursively(child); |
(...skipping 1363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4691 } | 4681 } |
4692 | 4682 |
4693 void FrameView::Paint(GraphicsContext& context, | 4683 void FrameView::Paint(GraphicsContext& context, |
4694 const CullRect& cull_rect) const { | 4684 const CullRect& cull_rect) const { |
4695 Paint(context, kGlobalPaintNormalPhase, cull_rect); | 4685 Paint(context, kGlobalPaintNormalPhase, cull_rect); |
4696 } | 4686 } |
4697 | 4687 |
4698 void FrameView::Paint(GraphicsContext& context, | 4688 void FrameView::Paint(GraphicsContext& context, |
4699 const GlobalPaintFlags global_paint_flags, | 4689 const GlobalPaintFlags global_paint_flags, |
4700 const CullRect& cull_rect) const { | 4690 const CullRect& cull_rect) const { |
4701 FramePainter(*this).Paint(context, global_paint_flags, cull_rect); | 4691 FramePainter(context, *this).Paint(global_paint_flags, cull_rect); |
4702 } | 4692 } |
4703 | 4693 |
4704 void FrameView::PaintContents(GraphicsContext& context, | 4694 void FrameView::PaintContents(GraphicsContext& context, |
4705 const GlobalPaintFlags global_paint_flags, | 4695 const GlobalPaintFlags global_paint_flags, |
4706 const IntRect& damage_rect) const { | 4696 const IntRect& damage_rect) const { |
4707 FramePainter(*this).PaintContents(context, global_paint_flags, damage_rect); | 4697 FramePainter(context, *this).PaintContents(global_paint_flags, damage_rect); |
4708 } | 4698 } |
4709 | 4699 |
4710 bool FrameView::IsPointInScrollbarCorner(const IntPoint& point_in_root_frame) { | 4700 bool FrameView::IsPointInScrollbarCorner(const IntPoint& point_in_root_frame) { |
4711 if (!ScrollbarCornerPresent()) | 4701 if (!ScrollbarCornerPresent()) |
4712 return false; | 4702 return false; |
4713 | 4703 |
4714 IntPoint frame_point = ConvertFromRootFrame(point_in_root_frame); | 4704 IntPoint frame_point = ConvertFromRootFrame(point_in_root_frame); |
4715 | 4705 |
4716 if (HorizontalScrollbar()) { | 4706 if (HorizontalScrollbar()) { |
4717 int horizontal_scrollbar_y_min = HorizontalScrollbar()->FrameRect().Y(); | 4707 int horizontal_scrollbar_y_min = HorizontalScrollbar()->FrameRect().Y(); |
(...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5388 void FrameView::SetAnimationHost( | 5378 void FrameView::SetAnimationHost( |
5389 std::unique_ptr<CompositorAnimationHost> host) { | 5379 std::unique_ptr<CompositorAnimationHost> host) { |
5390 animation_host_ = std::move(host); | 5380 animation_host_ = std::move(host); |
5391 } | 5381 } |
5392 | 5382 |
5393 LayoutUnit FrameView::CaretWidth() const { | 5383 LayoutUnit FrameView::CaretWidth() const { |
5394 return LayoutUnit(GetChromeClient()->WindowToViewportScalar(1)); | 5384 return LayoutUnit(GetChromeClient()->WindowToViewportScalar(1)); |
5395 } | 5385 } |
5396 | 5386 |
5397 } // namespace blink | 5387 } // namespace blink |
OLD | NEW |