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/frame/Settings.h" | 9 #include "core/frame/Settings.h" |
10 #include "core/layout/LayoutBlockFlow.h" | 10 #include "core/layout/LayoutBlockFlow.h" |
11 #include "core/layout/LayoutFlexibleBox.h" | 11 #include "core/layout/LayoutFlexibleBox.h" |
12 #include "core/layout/LayoutInline.h" | 12 #include "core/layout/LayoutInline.h" |
13 #include "core/layout/api/LineLayoutAPIShim.h" | 13 #include "core/layout/api/LineLayoutAPIShim.h" |
14 #include "core/layout/api/LineLayoutBox.h" | 14 #include "core/layout/api/LineLayoutBox.h" |
15 #include "core/page/Page.h" | 15 #include "core/page/Page.h" |
16 #include "core/paint/BoxClipper.h" | 16 #include "core/paint/BoxClipper.h" |
17 #include "core/paint/BoxPainter.h" | 17 #include "core/paint/BoxPainter.h" |
18 #include "core/paint/InlinePainter.h" | 18 #include "core/paint/InlinePainter.h" |
19 #include "core/paint/LayoutObjectDrawingRecorder.h" | 19 #include "core/paint/LayoutObjectDrawingRecorder.h" |
20 #include "core/paint/LineBoxListPainter.h" | 20 #include "core/paint/LineBoxListPainter.h" |
21 #include "core/paint/ObjectPaintProperties.h" | |
21 #include "core/paint/PaintInfo.h" | 22 #include "core/paint/PaintInfo.h" |
22 #include "core/paint/PaintLayer.h" | 23 #include "core/paint/PaintLayer.h" |
23 #include "core/paint/ScopeRecorder.h" | 24 #include "core/paint/ScopeRecorder.h" |
24 #include "core/paint/ScrollRecorder.h" | 25 #include "core/paint/ScrollRecorder.h" |
25 #include "core/paint/ScrollableAreaPainter.h" | 26 #include "core/paint/ScrollableAreaPainter.h" |
26 #include "platform/graphics/paint/ClipRecorder.h" | 27 #include "platform/graphics/paint/ClipRecorder.h" |
27 #include "wtf/Optional.h" | 28 #include "wtf/Optional.h" |
28 | 29 |
29 namespace blink { | 30 namespace blink { |
30 | 31 |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
159 | 160 |
160 if (paintPhase == PaintPhaseClippingMask && m_layoutBlock.style()->visibilit y() == VISIBLE) { | 161 if (paintPhase == PaintPhaseClippingMask && m_layoutBlock.style()->visibilit y() == VISIBLE) { |
161 BoxPainter(m_layoutBlock).paintClippingMask(paintInfo, paintOffset); | 162 BoxPainter(m_layoutBlock).paintClippingMask(paintInfo, paintOffset); |
162 return; | 163 return; |
163 } | 164 } |
164 | 165 |
165 if (paintPhase == PaintPhaseForeground && paintInfo.isPrinting()) | 166 if (paintPhase == PaintPhaseForeground && paintInfo.isPrinting()) |
166 ObjectPainter(m_layoutBlock).addPDFURLRectIfNeeded(paintInfo, paintOffse t); | 167 ObjectPainter(m_layoutBlock).addPDFURLRectIfNeeded(paintInfo, paintOffse t); |
167 | 168 |
168 if (paintPhase != PaintPhaseSelfOutlineOnly) { | 169 if (paintPhase != PaintPhaseSelfOutlineOnly) { |
170 Optional<ScopedPaintChunkProperties> m_scopedScrollProperty; | |
169 Optional<ScrollRecorder> scrollRecorder; | 171 Optional<ScrollRecorder> scrollRecorder; |
170 Optional<PaintInfo> scrolledPaintInfo; | 172 Optional<PaintInfo> scrolledPaintInfo; |
171 if (m_layoutBlock.hasOverflowClip()) { | 173 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
174 const auto* objectProperties = m_layoutBlock.objectPaintProperties() ; | |
175 if (auto* scrollTranslation = objectProperties ? objectProperties->s crollTranslation() : nullptr) { | |
176 PaintChunkProperties properties(paintInfo.context.paintControlle r().currentPaintChunkProperties()); | |
177 properties.transform = scrollTranslation; | |
178 m_scopedScrollProperty.emplace(paintInfo.context.paintController (), properties); | |
179 scrolledPaintInfo.emplace(paintInfo); | |
180 scrolledPaintInfo->updateCullRect(scrollTranslation->matrix().to AffineTransform()); | |
jbroman
2016/02/25 15:49:09
It's a little unfortunate to be down matrix math h
| |
181 } | |
182 } else if (m_layoutBlock.hasOverflowClip()) { | |
172 IntSize scrollOffset = m_layoutBlock.scrolledContentOffset(); | 183 IntSize scrollOffset = m_layoutBlock.scrolledContentOffset(); |
173 if (m_layoutBlock.layer()->scrollsOverflow() || !scrollOffset.isZero ()) { | 184 if (m_layoutBlock.layer()->scrollsOverflow() || !scrollOffset.isZero ()) { |
174 scrollRecorder.emplace(paintInfo.context, m_layoutBlock, paintPh ase, scrollOffset); | 185 scrollRecorder.emplace(paintInfo.context, m_layoutBlock, paintPh ase, scrollOffset); |
175 scrolledPaintInfo.emplace(paintInfo); | 186 scrolledPaintInfo.emplace(paintInfo); |
176 AffineTransform transform; | 187 AffineTransform transform; |
177 transform.translate(-scrollOffset.width(), -scrollOffset.height( )); | 188 transform.translate(-scrollOffset.width(), -scrollOffset.height( )); |
178 scrolledPaintInfo->updateCullRect(transform); | 189 scrolledPaintInfo->updateCullRect(transform); |
179 } | 190 } |
180 } | 191 } |
181 | 192 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
251 ObjectPainter(m_layoutBlock).paintInlineChildrenOutlines(paintInfo, paintOffset); | 262 ObjectPainter(m_layoutBlock).paintInlineChildrenOutlines(paintInfo, paintOffset); |
252 else | 263 else |
253 LineBoxListPainter(m_layoutBlock.lineBoxes()).paint(m_layoutBlock, p aintInfo, paintOffset); | 264 LineBoxListPainter(m_layoutBlock.lineBoxes()).paint(m_layoutBlock, p aintInfo, paintOffset); |
254 } else { | 265 } else { |
255 PaintInfo paintInfoForDescendants = paintInfo.forDescendants(); | 266 PaintInfo paintInfoForDescendants = paintInfo.forDescendants(); |
256 m_layoutBlock.paintChildren(paintInfoForDescendants, paintOffset); | 267 m_layoutBlock.paintChildren(paintInfoForDescendants, paintOffset); |
257 } | 268 } |
258 } | 269 } |
259 | 270 |
260 } // namespace blink | 271 } // namespace blink |
OLD | NEW |