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 if (transform || clip) { | 51 if (transform || clip) { |
52 PaintChunkProperties properties(context.paintController().curren
tPaintChunkProperties()); | 52 PaintChunkProperties properties(context.getPaintController().cur
rentPaintChunkProperties()); |
53 if (transform) | 53 if (transform) |
54 properties.transform = transform; | 54 properties.transform = transform; |
55 if (clip) | 55 if (clip) |
56 properties.clip = clip; | 56 properties.clip = clip; |
57 scopedPaintChunkProperties.emplace(context.paintController(), pr
operties); | 57 scopedPaintChunkProperties.emplace(context.getPaintController(),
properties); |
58 } | 58 } |
59 } | 59 } |
60 | 60 |
61 TransformRecorder transformRecorder(context, *frameView().layoutView(), | 61 TransformRecorder transformRecorder(context, *frameView().layoutView(), |
62 AffineTransform::translation(frameView().x() - frameView().scrollX()
, frameView().y() - frameView().scrollY())); | 62 AffineTransform::translation(frameView().x() - frameView().scrollX()
, frameView().y() - frameView().scrollY())); |
63 | 63 |
64 ClipRecorder recorder(context, *frameView().layoutView(), DisplayItem::C
lipFrameToVisibleContentRect, LayoutRect(frameView().visibleContentRect())); | 64 ClipRecorder recorder(context, *frameView().layoutView(), DisplayItem::C
lipFrameToVisibleContentRect, LayoutRect(frameView().visibleContentRect())); |
65 | 65 |
66 documentDirtyRect.moveBy(-frameView().location() + frameView().scrollPos
ition()); | 66 documentDirtyRect.moveBy(-frameView().location() + frameView().scrollPos
ition()); |
67 paintContents(context, globalPaintFlags, documentDirtyRect); | 67 paintContents(context, globalPaintFlags, documentDirtyRect); |
68 } | 68 } |
69 | 69 |
70 if (shouldPaintScrollbars) { | 70 if (shouldPaintScrollbars) { |
71 IntRect scrollViewDirtyRect = rect.m_rect; | 71 IntRect scrollViewDirtyRect = rect.m_rect; |
72 IntRect visibleAreaWithScrollbars(frameView().location(), frameView().vi
sibleContentRect(IncludeScrollbars).size()); | 72 IntRect visibleAreaWithScrollbars(frameView().location(), frameView().vi
sibleContentRect(IncludeScrollbars).size()); |
73 scrollViewDirtyRect.intersect(visibleAreaWithScrollbars); | 73 scrollViewDirtyRect.intersect(visibleAreaWithScrollbars); |
74 scrollViewDirtyRect.moveBy(-frameView().location()); | 74 scrollViewDirtyRect.moveBy(-frameView().location()); |
75 | 75 |
76 Optional<ScopedPaintChunkProperties> scopedPaintChunkProperties; | 76 Optional<ScopedPaintChunkProperties> scopedPaintChunkProperties; |
77 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { | 77 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
78 if (TransformPaintPropertyNode* transform = m_frameView->preTranslat
ion()) { | 78 if (TransformPaintPropertyNode* transform = m_frameView->preTranslat
ion()) { |
79 PaintChunkProperties properties(context.paintController().curren
tPaintChunkProperties()); | 79 PaintChunkProperties properties(context.getPaintController().cur
rentPaintChunkProperties()); |
80 properties.transform = transform; | 80 properties.transform = transform; |
81 scopedPaintChunkProperties.emplace(context.paintController(), pr
operties); | 81 scopedPaintChunkProperties.emplace(context.getPaintController(),
properties); |
82 } | 82 } |
83 } | 83 } |
84 | 84 |
85 TransformRecorder transformRecorder(context, *frameView().layoutView(), | 85 TransformRecorder transformRecorder(context, *frameView().layoutView(), |
86 AffineTransform::translation(frameView().x(), frameView().y())); | 86 AffineTransform::translation(frameView().x(), frameView().y())); |
87 | 87 |
88 ClipRecorder recorder(context, *frameView().layoutView(), DisplayItem::C
lipFrameScrollbars, LayoutRect(IntPoint(), visibleAreaWithScrollbars.size())); | 88 ClipRecorder recorder(context, *frameView().layoutView(), DisplayItem::C
lipFrameScrollbars, LayoutRect(IntPoint(), visibleAreaWithScrollbars.size())); |
89 | 89 |
90 paintScrollbars(context, scrollViewDirtyRect); | 90 paintScrollbars(context, scrollViewDirtyRect); |
91 } | 91 } |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 bar.paint(context, CullRect(rect)); | 216 bar.paint(context, CullRect(rect)); |
217 } | 217 } |
218 | 218 |
219 const FrameView& FramePainter::frameView() | 219 const FrameView& FramePainter::frameView() |
220 { | 220 { |
221 ASSERT(m_frameView); | 221 ASSERT(m_frameView); |
222 return *m_frameView; | 222 return *m_frameView; |
223 } | 223 } |
224 | 224 |
225 } // namespace blink | 225 } // namespace blink |
OLD | NEW |