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/BlockPainter.h" | 5 #include "core/paint/BlockPainter.h" |
6 | 6 |
7 #include "core/editing/DragCaretController.h" | 7 #include "core/editing/DragCaretController.h" |
8 #include "core/editing/FrameSelection.h" | 8 #include "core/editing/FrameSelection.h" |
9 #include "core/layout/LayoutFlexibleBox.h" | 9 #include "core/layout/LayoutFlexibleBox.h" |
10 #include "core/layout/LayoutInline.h" | 10 #include "core/layout/LayoutInline.h" |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 | 154 |
155 if (paintPhase != PaintPhaseSelfOutlineOnly) { | 155 if (paintPhase != PaintPhaseSelfOutlineOnly) { |
156 Optional<ScopedPaintChunkProperties> m_scopedScrollProperty; | 156 Optional<ScopedPaintChunkProperties> m_scopedScrollProperty; |
157 Optional<ScrollRecorder> scrollRecorder; | 157 Optional<ScrollRecorder> scrollRecorder; |
158 Optional<PaintInfo> scrolledPaintInfo; | 158 Optional<PaintInfo> scrolledPaintInfo; |
159 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { | 159 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
160 const auto* objectProperties = m_layoutBlock.objectPaintProperties()
; | 160 const auto* objectProperties = m_layoutBlock.objectPaintProperties()
; |
161 if (auto* scrollTranslation = objectProperties ? objectProperties->s
crollTranslation() : nullptr) { | 161 if (auto* scrollTranslation = objectProperties ? objectProperties->s
crollTranslation() : nullptr) { |
162 PaintChunkProperties properties(paintInfo.context.getPaintContro
ller().currentPaintChunkProperties()); | 162 PaintChunkProperties properties(paintInfo.context.getPaintContro
ller().currentPaintChunkProperties()); |
163 properties.transform = scrollTranslation; | 163 properties.transform = scrollTranslation; |
164 m_scopedScrollProperty.emplace(paintInfo.context.getPaintControl
ler(), properties); | 164 m_scopedScrollProperty.emplace(paintInfo.context.getPaintControl
ler(), m_layoutBlock, DisplayItem::paintPhaseToDrawingType(paintPhase), properti
es); |
165 scrolledPaintInfo.emplace(paintInfo); | 165 scrolledPaintInfo.emplace(paintInfo); |
166 scrolledPaintInfo->updateCullRect(scrollTranslation->matrix().to
AffineTransform()); | 166 scrolledPaintInfo->updateCullRect(scrollTranslation->matrix().to
AffineTransform()); |
167 } | 167 } |
168 } else if (m_layoutBlock.hasOverflowClip()) { | 168 } else if (m_layoutBlock.hasOverflowClip()) { |
169 IntSize scrollOffset = m_layoutBlock.scrolledContentOffset(); | 169 IntSize scrollOffset = m_layoutBlock.scrolledContentOffset(); |
170 if (m_layoutBlock.layer()->scrollsOverflow() || !scrollOffset.isZero
()) { | 170 if (m_layoutBlock.layer()->scrollsOverflow() || !scrollOffset.isZero
()) { |
171 scrollRecorder.emplace(paintInfo.context, m_layoutBlock, paintPh
ase, scrollOffset); | 171 scrollRecorder.emplace(paintInfo.context, m_layoutBlock, paintPh
ase, scrollOffset); |
172 scrolledPaintInfo.emplace(paintInfo); | 172 scrolledPaintInfo.emplace(paintInfo); |
173 AffineTransform transform; | 173 AffineTransform transform; |
174 transform.translate(-scrollOffset.width(), -scrollOffset.height(
)); | 174 transform.translate(-scrollOffset.width(), -scrollOffset.height(
)); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 } | 244 } |
245 | 245 |
246 void BlockPainter::paintContents(const PaintInfo& paintInfo, const LayoutPoint&
paintOffset) | 246 void BlockPainter::paintContents(const PaintInfo& paintInfo, const LayoutPoint&
paintOffset) |
247 { | 247 { |
248 DCHECK(!m_layoutBlock.childrenInline()); | 248 DCHECK(!m_layoutBlock.childrenInline()); |
249 PaintInfo paintInfoForDescendants = paintInfo.forDescendants(); | 249 PaintInfo paintInfoForDescendants = paintInfo.forDescendants(); |
250 m_layoutBlock.paintChildren(paintInfoForDescendants, paintOffset); | 250 m_layoutBlock.paintChildren(paintInfoForDescendants, paintOffset); |
251 } | 251 } |
252 | 252 |
253 } // namespace blink | 253 } // namespace blink |
OLD | NEW |