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

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

Issue 2299533002: WIP: Construct SPV2's scroll paint property tree (Closed)
Patch Set: Add more paint property builder tests, update comments/documentation" Created 4 years, 3 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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 152
153 if (paintPhase == PaintPhaseForeground && paintInfo.isPrinting()) 153 if (paintPhase == PaintPhaseForeground && paintInfo.isPrinting())
154 ObjectPainter(m_layoutBlock).addPDFURLRectIfNeeded(paintInfo, paintOffse t); 154 ObjectPainter(m_layoutBlock).addPDFURLRectIfNeeded(paintInfo, paintOffse t);
155 155
156 if (paintPhase != PaintPhaseSelfOutlineOnly) { 156 if (paintPhase != PaintPhaseSelfOutlineOnly) {
157 Optional<ScopedPaintChunkProperties> m_scopedScrollProperty; 157 Optional<ScopedPaintChunkProperties> m_scopedScrollProperty;
158 Optional<ScrollRecorder> scrollRecorder; 158 Optional<ScrollRecorder> scrollRecorder;
159 Optional<PaintInfo> scrolledPaintInfo; 159 Optional<PaintInfo> scrolledPaintInfo;
160 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { 160 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
161 const auto* objectProperties = m_layoutBlock.objectPaintProperties() ; 161 const auto* objectProperties = m_layoutBlock.objectPaintProperties() ;
162 if (auto* scrollTranslation = objectProperties ? objectProperties->s crollTranslation() : nullptr) { 162 if (auto* scroll = objectProperties ? objectProperties->scroll() : n ullptr) {
163 PaintChunkProperties properties(paintInfo.context.getPaintContro ller().currentPaintChunkProperties()); 163 PaintChunkProperties properties(paintInfo.context.getPaintContro ller().currentPaintChunkProperties());
164 auto* scrollTranslation = objectProperties->scrollTranslation();
165 DCHECK(scrollTranslation);
164 properties.transform = scrollTranslation; 166 properties.transform = scrollTranslation;
167 properties.scroll = scroll;
165 m_scopedScrollProperty.emplace(paintInfo.context.getPaintControl ler(), m_layoutBlock, DisplayItem::paintPhaseToDrawingType(paintPhase), properti es); 168 m_scopedScrollProperty.emplace(paintInfo.context.getPaintControl ler(), m_layoutBlock, DisplayItem::paintPhaseToDrawingType(paintPhase), properti es);
166 scrolledPaintInfo.emplace(paintInfo); 169 scrolledPaintInfo.emplace(paintInfo);
167 scrolledPaintInfo->updateCullRect(scrollTranslation->matrix().to AffineTransform()); 170 scrolledPaintInfo->updateCullRect(scrollTranslation->matrix().to AffineTransform());
168 } 171 }
169 } else if (m_layoutBlock.hasOverflowClip()) { 172 } else if (m_layoutBlock.hasOverflowClip()) {
170 IntSize scrollOffset = m_layoutBlock.scrolledContentOffset(); 173 IntSize scrollOffset = m_layoutBlock.scrolledContentOffset();
171 if (m_layoutBlock.layer()->scrollsOverflow() || !scrollOffset.isZero ()) { 174 if (m_layoutBlock.layer()->scrollsOverflow() || !scrollOffset.isZero ()) {
172 scrollRecorder.emplace(paintInfo.context, m_layoutBlock, paintPh ase, scrollOffset); 175 scrollRecorder.emplace(paintInfo.context, m_layoutBlock, paintPh ase, scrollOffset);
173 scrolledPaintInfo.emplace(paintInfo); 176 scrolledPaintInfo.emplace(paintInfo);
174 AffineTransform transform; 177 AffineTransform transform;
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 } 244 }
242 245
243 void BlockPainter::paintContents(const PaintInfo& paintInfo, const LayoutPoint& paintOffset) 246 void BlockPainter::paintContents(const PaintInfo& paintInfo, const LayoutPoint& paintOffset)
244 { 247 {
245 DCHECK(!m_layoutBlock.childrenInline()); 248 DCHECK(!m_layoutBlock.childrenInline());
246 PaintInfo paintInfoForDescendants = paintInfo.forDescendants(); 249 PaintInfo paintInfoForDescendants = paintInfo.forDescendants();
247 m_layoutBlock.paintChildren(paintInfoForDescendants, paintOffset); 250 m_layoutBlock.paintChildren(paintInfoForDescendants, paintOffset);
248 } 251 }
249 252
250 } // namespace blink 253 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.cpp ('k') | third_party/WebKit/Source/core/paint/FramePainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698