| 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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 Optional<ScrollRecorder> scrollRecorder; | 201 Optional<ScrollRecorder> scrollRecorder; |
| 202 Optional<PaintInfo> scrolledPaintInfo; | 202 Optional<PaintInfo> scrolledPaintInfo; |
| 203 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { | 203 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
| 204 const auto* objectProperties = m_layoutBlock.paintProperties(); | 204 const auto* objectProperties = m_layoutBlock.paintProperties(); |
| 205 if (auto* scroll = | 205 if (auto* scroll = |
| 206 objectProperties ? objectProperties->scroll() : nullptr) { | 206 objectProperties ? objectProperties->scroll() : nullptr) { |
| 207 PaintChunkProperties properties(paintInfo.context.getPaintController() | 207 PaintChunkProperties properties(paintInfo.context.getPaintController() |
| 208 .currentPaintChunkProperties()); | 208 .currentPaintChunkProperties()); |
| 209 auto* scrollTranslation = objectProperties->scrollTranslation(); | 209 auto* scrollTranslation = objectProperties->scrollTranslation(); |
| 210 DCHECK(scrollTranslation); | 210 DCHECK(scrollTranslation); |
| 211 properties.transform = scrollTranslation; | 211 properties.propertyTreeState.setTransform(scrollTranslation); |
| 212 properties.scroll = scroll; | 212 properties.propertyTreeState.setScroll(scroll); |
| 213 m_scopedScrollProperty.emplace( | 213 m_scopedScrollProperty.emplace( |
| 214 paintInfo.context.getPaintController(), m_layoutBlock, | 214 paintInfo.context.getPaintController(), m_layoutBlock, |
| 215 DisplayItem::paintPhaseToDrawingType(paintPhase), properties); | 215 DisplayItem::paintPhaseToDrawingType(paintPhase), properties); |
| 216 scrolledPaintInfo.emplace(paintInfo); | 216 scrolledPaintInfo.emplace(paintInfo); |
| 217 scrolledPaintInfo->updateCullRect( | 217 scrolledPaintInfo->updateCullRect( |
| 218 scrollTranslation->matrix().toAffineTransform()); | 218 scrollTranslation->matrix().toAffineTransform()); |
| 219 } | 219 } |
| 220 } else if (m_layoutBlock.hasOverflowClip()) { | 220 } else if (m_layoutBlock.hasOverflowClip()) { |
| 221 IntSize scrollOffset = m_layoutBlock.scrolledContentOffset(); | 221 IntSize scrollOffset = m_layoutBlock.scrolledContentOffset(); |
| 222 if (m_layoutBlock.layer()->scrollsOverflow() || !scrollOffset.isZero()) { | 222 if (m_layoutBlock.layer()->scrollsOverflow() || !scrollOffset.isZero()) { |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 } | 302 } |
| 303 | 303 |
| 304 void BlockPainter::paintContents(const PaintInfo& paintInfo, | 304 void BlockPainter::paintContents(const PaintInfo& paintInfo, |
| 305 const LayoutPoint& paintOffset) { | 305 const LayoutPoint& paintOffset) { |
| 306 DCHECK(!m_layoutBlock.childrenInline()); | 306 DCHECK(!m_layoutBlock.childrenInline()); |
| 307 PaintInfo paintInfoForDescendants = paintInfo.forDescendants(); | 307 PaintInfo paintInfoForDescendants = paintInfo.forDescendants(); |
| 308 m_layoutBlock.paintChildren(paintInfoForDescendants, paintOffset); | 308 m_layoutBlock.paintChildren(paintInfoForDescendants, paintOffset); |
| 309 } | 309 } |
| 310 | 310 |
| 311 } // namespace blink | 311 } // namespace blink |
| OLD | NEW |