| 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/DragCaret.h" | 7 #include "core/editing/DragCaret.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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 | 195 |
| 196 if (paintPhase == PaintPhaseForeground && paintInfo.isPrinting()) | 196 if (paintPhase == PaintPhaseForeground && paintInfo.isPrinting()) |
| 197 ObjectPainter(m_layoutBlock).addPDFURLRectIfNeeded(paintInfo, paintOffset); | 197 ObjectPainter(m_layoutBlock).addPDFURLRectIfNeeded(paintInfo, paintOffset); |
| 198 | 198 |
| 199 if (paintPhase != PaintPhaseSelfOutlineOnly) { | 199 if (paintPhase != PaintPhaseSelfOutlineOnly) { |
| 200 Optional<ScopedPaintChunkProperties> m_scopedScrollProperty; | 200 Optional<ScopedPaintChunkProperties> m_scopedScrollProperty; |
| 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 auto* scrollTranslation = |
| 206 objectProperties ? objectProperties->scroll() : nullptr) { | 206 objectProperties ? objectProperties->scrollTranslation() : nullptr; |
| 207 if (scrollTranslation) { |
| 207 PaintChunkProperties properties(paintInfo.context.getPaintController() | 208 PaintChunkProperties properties(paintInfo.context.getPaintController() |
| 208 .currentPaintChunkProperties()); | 209 .currentPaintChunkProperties()); |
| 209 auto* scrollTranslation = objectProperties->scrollTranslation(); | |
| 210 DCHECK(scrollTranslation); | |
| 211 properties.propertyTreeState.setTransform(scrollTranslation); | 210 properties.propertyTreeState.setTransform(scrollTranslation); |
| 212 properties.propertyTreeState.setScroll(scroll); | |
| 213 m_scopedScrollProperty.emplace( | 211 m_scopedScrollProperty.emplace( |
| 214 paintInfo.context.getPaintController(), m_layoutBlock, | 212 paintInfo.context.getPaintController(), m_layoutBlock, |
| 215 DisplayItem::paintPhaseToDrawingType(paintPhase), properties); | 213 DisplayItem::paintPhaseToDrawingType(paintPhase), properties); |
| 216 scrolledPaintInfo.emplace(paintInfo); | 214 scrolledPaintInfo.emplace(paintInfo); |
| 217 scrolledPaintInfo->updateCullRect( | 215 scrolledPaintInfo->updateCullRect( |
| 218 scrollTranslation->matrix().toAffineTransform()); | 216 scrollTranslation->matrix().toAffineTransform()); |
| 219 } | 217 } |
| 220 } else if (m_layoutBlock.hasOverflowClip()) { | 218 } else if (m_layoutBlock.hasOverflowClip()) { |
| 221 IntSize scrollOffset = m_layoutBlock.scrolledContentOffset(); | 219 IntSize scrollOffset = m_layoutBlock.scrolledContentOffset(); |
| 222 if (m_layoutBlock.layer()->scrollsOverflow() || !scrollOffset.isZero()) { | 220 if (m_layoutBlock.layer()->scrollsOverflow() || !scrollOffset.isZero()) { |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 } | 301 } |
| 304 | 302 |
| 305 void BlockPainter::paintContents(const PaintInfo& paintInfo, | 303 void BlockPainter::paintContents(const PaintInfo& paintInfo, |
| 306 const LayoutPoint& paintOffset) { | 304 const LayoutPoint& paintOffset) { |
| 307 DCHECK(!m_layoutBlock.childrenInline()); | 305 DCHECK(!m_layoutBlock.childrenInline()); |
| 308 PaintInfo paintInfoForDescendants = paintInfo.forDescendants(); | 306 PaintInfo paintInfoForDescendants = paintInfo.forDescendants(); |
| 309 m_layoutBlock.paintChildren(paintInfoForDescendants, paintOffset); | 307 m_layoutBlock.paintChildren(paintInfoForDescendants, paintOffset); |
| 310 } | 308 } |
| 311 | 309 |
| 312 } // namespace blink | 310 } // namespace blink |
| OLD | NEW |