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