OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/PaintInvalidator.h" | 5 #include "core/paint/PaintInvalidator.h" |
6 | 6 |
7 #include "core/editing/FrameSelection.h" | 7 #include "core/editing/FrameSelection.h" |
8 #include "core/frame/FrameView.h" | 8 #include "core/frame/FrameView.h" |
9 #include "core/frame/LocalFrame.h" | 9 #include "core/frame/LocalFrame.h" |
10 #include "core/frame/Settings.h" | 10 #include "core/frame/Settings.h" |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 ->contentsProperties(); | 106 ->contentsProperties(); |
107 if (context.treeBuilderContext.current.transform == | 107 if (context.treeBuilderContext.current.transform == |
108 containerContentsProperties->transform() && | 108 containerContentsProperties->transform() && |
109 context.treeBuilderContext.current.clip == | 109 context.treeBuilderContext.current.clip == |
110 containerContentsProperties->clip()) { | 110 containerContentsProperties->clip()) { |
111 result = LayoutRect(rect); | 111 result = LayoutRect(rect); |
112 } else { | 112 } else { |
113 PropertyTreeState currentTreeState( | 113 PropertyTreeState currentTreeState( |
114 context.treeBuilderContext.current.transform, | 114 context.treeBuilderContext.current.transform, |
115 context.treeBuilderContext.current.clip, nullptr, nullptr); | 115 context.treeBuilderContext.current.clip, nullptr, nullptr); |
116 bool success = false; | |
117 result = LayoutRect(geometryMapper.sourceToDestinationVisualRect( | 116 result = LayoutRect(geometryMapper.sourceToDestinationVisualRect( |
118 rect, currentTreeState, *containerContentsProperties, success)); | 117 rect, currentTreeState, *containerContentsProperties)); |
119 DCHECK(success); | |
120 } | 118 } |
121 | 119 |
122 // Convert the result to the container's contents space. | 120 // Convert the result to the container's contents space. |
123 result.moveBy(-context.paintInvalidationContainer->paintOffset()); | 121 result.moveBy(-context.paintInvalidationContainer->paintOffset()); |
124 } | 122 } |
125 | 123 |
126 object.adjustVisualRectForRasterEffects(result); | 124 object.adjustVisualRectForRasterEffects(result); |
127 | 125 |
128 PaintLayer::mapRectInPaintInvalidationContainerToBacking( | 126 PaintLayer::mapRectInPaintInvalidationContainerToBacking( |
129 *context.paintInvalidationContainer, result); | 127 *context.paintInvalidationContainer, result); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 | 167 |
170 LayoutPoint point; | 168 LayoutPoint point; |
171 if (object != context.paintInvalidationContainer) { | 169 if (object != context.paintInvalidationContainer) { |
172 point.moveBy(object.paintOffset()); | 170 point.moveBy(object.paintOffset()); |
173 | 171 |
174 const auto* containerTransform = | 172 const auto* containerTransform = |
175 context.paintInvalidationContainer->paintProperties() | 173 context.paintInvalidationContainer->paintProperties() |
176 ->contentsProperties() | 174 ->contentsProperties() |
177 ->transform(); | 175 ->transform(); |
178 if (context.treeBuilderContext.current.transform != containerTransform) { | 176 if (context.treeBuilderContext.current.transform != containerTransform) { |
179 bool success = false; | |
180 point = LayoutPoint(m_geometryMapper | 177 point = LayoutPoint(m_geometryMapper |
181 .sourceToDestinationRect( | 178 .sourceToDestinationRect( |
182 FloatRect(FloatPoint(point), FloatSize()), | 179 FloatRect(FloatPoint(point), FloatSize()), |
183 context.treeBuilderContext.current.transform, | 180 context.treeBuilderContext.current.transform, |
184 containerTransform, success) | 181 containerTransform) |
185 .location()); | 182 .location()); |
186 DCHECK(success); | |
187 } | 183 } |
188 | 184 |
189 // Convert the result to the container's contents space. | 185 // Convert the result to the container's contents space. |
190 point.moveBy(-context.paintInvalidationContainer->paintOffset()); | 186 point.moveBy(-context.paintInvalidationContainer->paintOffset()); |
191 } | 187 } |
192 | 188 |
193 if (context.paintInvalidationContainer->layer()->groupedMapping()) { | 189 if (context.paintInvalidationContainer->layer()->groupedMapping()) { |
194 FloatPoint floatPoint(point); | 190 FloatPoint floatPoint(point); |
195 PaintLayer::mapPointInPaintInvalidationContainerToBacking( | 191 PaintLayer::mapPointInPaintInvalidationContainerToBacking( |
196 *context.paintInvalidationContainer, floatPoint); | 192 *context.paintInvalidationContainer, floatPoint); |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
456 PaintInvalidatorContext::ForcedSubtreeInvalidationRectUpdate; | 452 PaintInvalidatorContext::ForcedSubtreeInvalidationRectUpdate; |
457 } | 453 } |
458 | 454 |
459 void PaintInvalidator::processPendingDelayedPaintInvalidations() { | 455 void PaintInvalidator::processPendingDelayedPaintInvalidations() { |
460 for (auto target : m_pendingDelayedPaintInvalidations) | 456 for (auto target : m_pendingDelayedPaintInvalidations) |
461 target->getMutableForPainting().setShouldDoFullPaintInvalidation( | 457 target->getMutableForPainting().setShouldDoFullPaintInvalidation( |
462 PaintInvalidationDelayedFull); | 458 PaintInvalidationDelayedFull); |
463 } | 459 } |
464 | 460 |
465 } // namespace blink | 461 } // namespace blink |
OLD | NEW |