| 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 // enclosingIntRect is applied in the last step of paint invalidation | 120 // enclosingIntRect is applied in the last step of paint invalidation |
| 121 // (see CompositedLayerMapping::setContentsNeedDisplayInRect()). | 121 // (see CompositedLayerMapping::setContentsNeedDisplayInRect()). |
| 122 if (!isSVGChild && | 122 if (!isSVGChild && |
| 123 context.treeBuilderContext.current.transform != | 123 context.treeBuilderContext.current.transform != |
| 124 containerContentsProperties->transform()) | 124 containerContentsProperties->transform()) |
| 125 rect = Rect(enclosingIntRect(rect)); | 125 rect = Rect(enclosingIntRect(rect)); |
| 126 | 126 |
| 127 PropertyTreeState currentTreeState( | 127 PropertyTreeState currentTreeState( |
| 128 context.treeBuilderContext.current.transform, | 128 context.treeBuilderContext.current.transform, |
| 129 context.treeBuilderContext.current.clip, nullptr); | 129 context.treeBuilderContext.current.clip, nullptr); |
| 130 | 130 result = LayoutRect( |
| 131 FloatRect floatRect(rect); | 131 geometryMapper |
| 132 geometryMapper.sourceToDestinationVisualRect( | 132 .sourceToDestinationVisualRect(FloatRect(rect), currentTreeState, |
| 133 currentTreeState, *containerContentsProperties, floatRect); | 133 *containerContentsProperties) |
| 134 result = LayoutRect(floatRect); | 134 .rect()); |
| 135 } | 135 } |
| 136 | 136 |
| 137 // Convert the result to the container's contents space. | 137 // Convert the result to the container's contents space. |
| 138 result.moveBy(-context.paintInvalidationContainer->paintOffset()); | 138 result.moveBy(-context.paintInvalidationContainer->paintOffset()); |
| 139 } | 139 } |
| 140 | 140 |
| 141 object.adjustVisualRectForRasterEffects(result); | 141 object.adjustVisualRectForRasterEffects(result); |
| 142 | 142 |
| 143 PaintLayer::mapRectInPaintInvalidationContainerToBacking( | 143 PaintLayer::mapRectInPaintInvalidationContainerToBacking( |
| 144 *context.paintInvalidationContainer, result); | 144 *context.paintInvalidationContainer, result); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 175 | 175 |
| 176 LayoutPoint point; | 176 LayoutPoint point; |
| 177 if (object != context.paintInvalidationContainer) { | 177 if (object != context.paintInvalidationContainer) { |
| 178 point.moveBy(object.paintOffset()); | 178 point.moveBy(object.paintOffset()); |
| 179 | 179 |
| 180 const auto* containerTransform = | 180 const auto* containerTransform = |
| 181 context.paintInvalidationContainer->paintProperties() | 181 context.paintInvalidationContainer->paintProperties() |
| 182 ->contentsProperties() | 182 ->contentsProperties() |
| 183 ->transform(); | 183 ->transform(); |
| 184 if (context.treeBuilderContext.current.transform != containerTransform) { | 184 if (context.treeBuilderContext.current.transform != containerTransform) { |
| 185 FloatRect rect = FloatRect(FloatPoint(point), FloatSize()); | 185 point = LayoutPoint(m_geometryMapper |
| 186 m_geometryMapper.sourceToDestinationRect( | 186 .sourceToDestinationRect( |
| 187 context.treeBuilderContext.current.transform, containerTransform, | 187 FloatRect(FloatPoint(point), FloatSize()), |
| 188 rect); | 188 context.treeBuilderContext.current.transform, |
| 189 point = LayoutPoint(rect.location()); | 189 containerTransform) |
| 190 .location()); |
| 190 } | 191 } |
| 191 | 192 |
| 192 // Convert the result to the container's contents space. | 193 // Convert the result to the container's contents space. |
| 193 point.moveBy(-context.paintInvalidationContainer->paintOffset()); | 194 point.moveBy(-context.paintInvalidationContainer->paintOffset()); |
| 194 } | 195 } |
| 195 | 196 |
| 196 if (context.paintInvalidationContainer->layer()->groupedMapping()) { | 197 if (context.paintInvalidationContainer->layer()->groupedMapping()) { |
| 197 FloatPoint floatPoint(point); | 198 FloatPoint floatPoint(point); |
| 198 PaintLayer::mapPointInPaintInvalidationContainerToBacking( | 199 PaintLayer::mapPointInPaintInvalidationContainerToBacking( |
| 199 *context.paintInvalidationContainer, floatPoint); | 200 *context.paintInvalidationContainer, floatPoint); |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 490 } | 491 } |
| 491 } | 492 } |
| 492 | 493 |
| 493 void PaintInvalidator::processPendingDelayedPaintInvalidations() { | 494 void PaintInvalidator::processPendingDelayedPaintInvalidations() { |
| 494 for (auto target : m_pendingDelayedPaintInvalidations) | 495 for (auto target : m_pendingDelayedPaintInvalidations) |
| 495 target->getMutableForPainting().setShouldDoFullPaintInvalidation( | 496 target->getMutableForPainting().setShouldDoFullPaintInvalidation( |
| 496 PaintInvalidationDelayedFull); | 497 PaintInvalidationDelayedFull); |
| 497 } | 498 } |
| 498 | 499 |
| 499 } // namespace blink | 500 } // namespace blink |
| OLD | NEW |