Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Side by Side Diff: third_party/WebKit/Source/core/paint/BlockPainter.cpp

Issue 2657863004: Move scroll paint property nodes to be owned by the transform tree (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 } 300 }
303 301
304 void BlockPainter::paintContents(const PaintInfo& paintInfo, 302 void BlockPainter::paintContents(const PaintInfo& paintInfo,
305 const LayoutPoint& paintOffset) { 303 const LayoutPoint& paintOffset) {
306 DCHECK(!m_layoutBlock.childrenInline()); 304 DCHECK(!m_layoutBlock.childrenInline());
307 PaintInfo paintInfoForDescendants = paintInfo.forDescendants(); 305 PaintInfo paintInfoForDescendants = paintInfo.forDescendants();
308 m_layoutBlock.paintChildren(paintInfoForDescendants, paintOffset); 306 m_layoutBlock.paintChildren(paintInfoForDescendants, paintOffset);
309 } 307 }
310 308
311 } // namespace blink 309 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698