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 28 matching lines...) Expand all Loading... |
39 bool shouldPaintScrollbars = !frameView().scrollbarsSuppressed() && (frameVi
ew().horizontalScrollbar() || frameView().verticalScrollbar()); | 39 bool shouldPaintScrollbars = !frameView().scrollbarsSuppressed() && (frameVi
ew().horizontalScrollbar() || frameView().verticalScrollbar()); |
40 if (!shouldPaintContents && !shouldPaintScrollbars) | 40 if (!shouldPaintContents && !shouldPaintScrollbars) |
41 return; | 41 return; |
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 if (const PropertyTreeState* contentsState = m_frameView->totalPrope
rtyTreeStateForContents()) { |
50 ClipPaintPropertyNode* clip = m_frameView->contentClip(); | 50 PaintChunkProperties properties(context.getPaintController().cur
rentPaintChunkProperties()); |
51 ScrollPaintPropertyNode* scroll = m_frameView->scroll(); | 51 properties.transform = contentsState->transform; |
52 PaintChunkProperties properties(context.getPaintController().current
PaintChunkProperties()); | 52 properties.clip = contentsState->clip; |
53 if (frameView().frame().isLocalRoot()) { | 53 properties.effect = contentsState->effect; |
54 properties.transform = frameView().rootTransform(); | 54 properties.scroll = contentsState->scroll; |
55 properties.clip = frameView().rootClip(); | |
56 properties.effect = frameView().rootEffect(); | |
57 } | |
58 if (transform || clip || scroll) { | |
59 if (transform) | |
60 properties.transform = transform; | |
61 if (scroll) | |
62 properties.scroll = scroll; | |
63 if (clip) | |
64 properties.clip = clip; | |
65 scopedPaintChunkProperties.emplace(context.getPaintController(),
*frameView().layoutView(), properties); | 55 scopedPaintChunkProperties.emplace(context.getPaintController(),
*frameView().layoutView(), properties); |
66 } | 56 } |
67 } | 57 } |
68 | 58 |
69 TransformRecorder transformRecorder(context, *frameView().layoutView(), | 59 TransformRecorder transformRecorder(context, *frameView().layoutView(), |
70 AffineTransform::translation(frameView().x() - frameView().scrollX()
, frameView().y() - frameView().scrollY())); | 60 AffineTransform::translation(frameView().x() - frameView().scrollX()
, frameView().y() - frameView().scrollY())); |
71 | 61 |
72 ClipRecorder recorder(context, *frameView().layoutView(), DisplayItem::k
ClipFrameToVisibleContentRect, frameView().visibleContentRect()); | 62 ClipRecorder recorder(context, *frameView().layoutView(), DisplayItem::k
ClipFrameToVisibleContentRect, frameView().visibleContentRect()); |
73 | 63 |
74 documentDirtyRect.moveBy(-frameView().location() + frameView().scrollPos
ition()); | 64 documentDirtyRect.moveBy(-frameView().location() + frameView().scrollPos
ition()); |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 bar.paint(context, CullRect(rect)); | 195 bar.paint(context, CullRect(rect)); |
206 } | 196 } |
207 | 197 |
208 const FrameView& FramePainter::frameView() | 198 const FrameView& FramePainter::frameView() |
209 { | 199 { |
210 ASSERT(m_frameView); | 200 ASSERT(m_frameView); |
211 return *m_frameView; | 201 return *m_frameView; |
212 } | 202 } |
213 | 203 |
214 } // namespace blink | 204 } // namespace blink |
OLD | NEW |