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/fetch/MemoryCache.h" | 8 #include "core/fetch/MemoryCache.h" |
9 #include "core/frame/FrameView.h" | 9 #include "core/frame/FrameView.h" |
10 #include "core/inspector/InspectorInstrumentation.h" | 10 #include "core/inspector/InspectorInstrumentation.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 | 42 |
43 if (shouldPaintContents) { | 43 if (shouldPaintContents) { |
44 // TODO(pdr): Creating frame paint properties here will not be needed on
ce | 44 // TODO(pdr): Creating frame paint properties here will not be needed on
ce |
45 // settings()->rootLayerScrolls() is enabled. | 45 // settings()->rootLayerScrolls() is enabled. |
46 // TODO(pdr): Make this conditional on the rootLayerScrolls setting. | 46 // TODO(pdr): Make this conditional on the rootLayerScrolls setting. |
47 Optional<ScopedPaintChunkProperties> scopedPaintChunkProperties; | 47 Optional<ScopedPaintChunkProperties> scopedPaintChunkProperties; |
48 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { | 48 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
49 TransformPaintPropertyNode* transform = m_frameView->scrollTranslati
on() ? m_frameView->scrollTranslation() : m_frameView->preTranslation(); | 49 TransformPaintPropertyNode* transform = m_frameView->scrollTranslati
on() ? m_frameView->scrollTranslation() : m_frameView->preTranslation(); |
50 ClipPaintPropertyNode* clip = m_frameView->contentClip(); | 50 ClipPaintPropertyNode* clip = m_frameView->contentClip(); |
51 ScrollPaintPropertyNode* scroll = m_frameView->scroll(); | 51 ScrollPaintPropertyNode* scroll = m_frameView->scroll(); |
| 52 PaintChunkProperties properties(context.getPaintController().current
PaintChunkProperties()); |
| 53 if (frameView().frame().isLocalRoot()) { |
| 54 properties.transform = frameView().rootTransform(); |
| 55 properties.clip = frameView().rootClip(); |
| 56 properties.effect = frameView().rootEffect(); |
| 57 } |
52 if (transform || clip || scroll) { | 58 if (transform || clip || scroll) { |
53 PaintChunkProperties properties(context.getPaintController().cur
rentPaintChunkProperties()); | |
54 if (transform) | 59 if (transform) |
55 properties.transform = transform; | 60 properties.transform = transform; |
56 if (scroll) | 61 if (scroll) |
57 properties.scroll = scroll; | 62 properties.scroll = scroll; |
58 if (clip) | 63 if (clip) |
59 properties.clip = clip; | 64 properties.clip = clip; |
60 scopedPaintChunkProperties.emplace(context.getPaintController(),
*frameView().layoutView(), properties); | 65 scopedPaintChunkProperties.emplace(context.getPaintController(),
*frameView().layoutView(), properties); |
61 } | 66 } |
62 } | 67 } |
63 | 68 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 DLOG(ERROR) << "called FramePainter::paint with nil layoutObject"; | 111 DLOG(ERROR) << "called FramePainter::paint with nil layoutObject"; |
107 return; | 112 return; |
108 } | 113 } |
109 | 114 |
110 // TODO(crbug.com/590856): It's still broken when we choose not to crash whe
n the check fails. | 115 // TODO(crbug.com/590856): It's still broken when we choose not to crash whe
n the check fails. |
111 if (!frameView().checkDoesNotNeedLayout()) | 116 if (!frameView().checkDoesNotNeedLayout()) |
112 return; | 117 return; |
113 | 118 |
114 // TODO(wangxianzhu): The following check should be stricter, but currently
this is blocked | 119 // TODO(wangxianzhu): The following check should be stricter, but currently
this is blocked |
115 // by the svg root issue (crbug.com/442939). | 120 // by the svg root issue (crbug.com/442939). |
116 ASSERT(document->lifecycle().state() >= DocumentLifecycle::CompositingClean)
; | 121 DCHECK(document->lifecycle().state() >= DocumentLifecycle::PrePaintClean); |
117 | 122 |
118 TRACE_EVENT1("devtools.timeline,rail", "Paint", "data", InspectorPaintEvent:
:data(layoutView, LayoutRect(rect), 0)); | 123 TRACE_EVENT1("devtools.timeline,rail", "Paint", "data", InspectorPaintEvent:
:data(layoutView, LayoutRect(rect), 0)); |
119 | 124 |
120 bool isTopLevelPainter = !s_inPaintContents; | 125 bool isTopLevelPainter = !s_inPaintContents; |
121 s_inPaintContents = true; | 126 s_inPaintContents = true; |
122 | 127 |
123 FontCachePurgePreventer fontCachePurgePreventer; | 128 FontCachePurgePreventer fontCachePurgePreventer; |
124 | 129 |
125 // TODO(jchaffraix): GlobalPaintFlags should be const during a paint | 130 // TODO(jchaffraix): GlobalPaintFlags should be const during a paint |
126 // phase. Thus we should set this flag upfront (crbug.com/510280). | 131 // phase. Thus we should set this flag upfront (crbug.com/510280). |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 bar.paint(context, CullRect(rect)); | 205 bar.paint(context, CullRect(rect)); |
201 } | 206 } |
202 | 207 |
203 const FrameView& FramePainter::frameView() | 208 const FrameView& FramePainter::frameView() |
204 { | 209 { |
205 ASSERT(m_frameView); | 210 ASSERT(m_frameView); |
206 return *m_frameView; | 211 return *m_frameView; |
207 } | 212 } |
208 | 213 |
209 } // namespace blink | 214 } // namespace blink |
OLD | NEW |