OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/paint/FramePainter.h" | 5 #include "core/paint/FramePainter.h" |
6 | 6 |
7 #include "core/editing/markers/DocumentMarkerController.h" | 7 #include "core/editing/markers/DocumentMarkerController.h" |
8 #include "core/frame/FrameView.h" | 8 #include "core/frame/FrameView.h" |
9 #include "core/inspector/InspectorTraceEvents.h" | 9 #include "core/inspector/InspectorTraceEvents.h" |
10 #include "core/layout/LayoutView.h" | 10 #include "core/layout/LayoutView.h" |
11 #include "core/page/Page.h" | 11 #include "core/page/Page.h" |
| 12 #include "core/paint/FramePaintTiming.h" |
12 #include "core/paint/LayoutObjectDrawingRecorder.h" | 13 #include "core/paint/LayoutObjectDrawingRecorder.h" |
13 #include "core/paint/PaintInfo.h" | 14 #include "core/paint/PaintInfo.h" |
14 #include "core/paint/PaintLayer.h" | 15 #include "core/paint/PaintLayer.h" |
15 #include "core/paint/PaintLayerPainter.h" | 16 #include "core/paint/PaintLayerPainter.h" |
16 #include "core/paint/ScrollbarPainter.h" | 17 #include "core/paint/ScrollbarPainter.h" |
17 #include "core/paint/TransformRecorder.h" | 18 #include "core/paint/TransformRecorder.h" |
18 #include "core/probe/CoreProbes.h" | 19 #include "core/probe/CoreProbes.h" |
19 #include "platform/fonts/FontCache.h" | 20 #include "platform/fonts/FontCache.h" |
20 #include "platform/graphics/GraphicsContext.h" | 21 #include "platform/graphics/GraphicsContext.h" |
21 #include "platform/graphics/paint/ClipRecorder.h" | 22 #include "platform/graphics/paint/ClipRecorder.h" |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 // TODO(crbug.com/590856): It's still broken when we choose not to crash when | 141 // TODO(crbug.com/590856): It's still broken when we choose not to crash when |
141 // the check fails. | 142 // the check fails. |
142 if (!GetFrameView().CheckDoesNotNeedLayout()) | 143 if (!GetFrameView().CheckDoesNotNeedLayout()) |
143 return; | 144 return; |
144 | 145 |
145 // TODO(wangxianzhu): The following check should be stricter, but currently | 146 // TODO(wangxianzhu): The following check should be stricter, but currently |
146 // this is blocked by the svg root issue (crbug.com/442939). | 147 // this is blocked by the svg root issue (crbug.com/442939). |
147 DCHECK(document->Lifecycle().GetState() >= | 148 DCHECK(document->Lifecycle().GetState() >= |
148 DocumentLifecycle::kCompositingClean); | 149 DocumentLifecycle::kCompositingClean); |
149 | 150 |
| 151 FramePaintTiming frame_paint_timing(context, &GetFrameView().GetFrame()); |
150 TRACE_EVENT1("devtools.timeline,rail", "Paint", "data", | 152 TRACE_EVENT1("devtools.timeline,rail", "Paint", "data", |
151 InspectorPaintEvent::Data(layout_view, LayoutRect(rect), 0)); | 153 InspectorPaintEvent::Data(layout_view, LayoutRect(rect), 0)); |
152 | 154 |
153 bool is_top_level_painter = !in_paint_contents_; | 155 bool is_top_level_painter = !in_paint_contents_; |
154 in_paint_contents_ = true; | 156 in_paint_contents_ = true; |
155 | 157 |
156 FontCachePurgePreventer font_cache_purge_preventer; | 158 FontCachePurgePreventer font_cache_purge_preventer; |
157 | 159 |
158 // TODO(jchaffraix): GlobalPaintFlags should be const during a paint | 160 // TODO(jchaffraix): GlobalPaintFlags should be const during a paint |
159 // phase. Thus we should set this flag upfront (crbug.com/510280). | 161 // phase. Thus we should set this flag upfront (crbug.com/510280). |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 | 262 |
261 bar.Paint(context, CullRect(rect)); | 263 bar.Paint(context, CullRect(rect)); |
262 } | 264 } |
263 | 265 |
264 const FrameView& FramePainter::GetFrameView() { | 266 const FrameView& FramePainter::GetFrameView() { |
265 DCHECK(frame_view_); | 267 DCHECK(frame_view_); |
266 return *frame_view_; | 268 return *frame_view_; |
267 } | 269 } |
268 | 270 |
269 } // namespace blink | 271 } // namespace blink |
OLD | NEW |