| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 object, *context.paintInvalidationContainer, rect); | 98 object, *context.paintInvalidationContainer, rect); |
| 99 } else if (object == context.paintInvalidationContainer) { | 99 } else if (object == context.paintInvalidationContainer) { |
| 100 result = LayoutRect(rect); | 100 result = LayoutRect(rect); |
| 101 } else { | 101 } else { |
| 102 // For non-root SVG, the input rect is in local SVG coordinates in which | 102 // For non-root SVG, the input rect is in local SVG coordinates in which |
| 103 // paint offset doesn't apply. | 103 // paint offset doesn't apply. |
| 104 if (!isSVGChild) | 104 if (!isSVGChild) |
| 105 rect.moveBy(Point(object.paintOffset())); | 105 rect.moveBy(Point(object.paintOffset())); |
| 106 | 106 |
| 107 const auto* containerContentsProperties = | 107 const auto* containerContentsProperties = |
| 108 context.paintInvalidationContainer->paintProperties() | 108 context.paintInvalidationContainer->contentsProperties(); |
| 109 ->contentsProperties(); | |
| 110 | 109 |
| 111 if (context.m_treeBuilderContext.current.transform == | 110 if (context.m_treeBuilderContext.current.transform == |
| 112 containerContentsProperties->transform() && | 111 containerContentsProperties->transform() && |
| 113 context.m_treeBuilderContext.current.clip == | 112 context.m_treeBuilderContext.current.clip == |
| 114 containerContentsProperties->clip()) { | 113 containerContentsProperties->clip()) { |
| 115 result = LayoutRect(rect); | 114 result = LayoutRect(rect); |
| 116 } else { | 115 } else { |
| 117 // Use enclosingIntRect to ensure the final visual rect will cover the | 116 // Use enclosingIntRect to ensure the final visual rect will cover the |
| 118 // rect in source coordinates no matter if the painting will use pixel | 117 // rect in source coordinates no matter if the painting will use pixel |
| 119 // snapping, when transforms are applied. If there is no transform, | 118 // snapping, when transforms are applied. If there is no transform, |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 const PaintInvalidatorContext& context) { | 172 const PaintInvalidatorContext& context) { |
| 174 // In SPv2, locationInBacking is in the space of their local transform node. | 173 // In SPv2, locationInBacking is in the space of their local transform node. |
| 175 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) | 174 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) |
| 176 return object.paintOffset(); | 175 return object.paintOffset(); |
| 177 | 176 |
| 178 LayoutPoint point; | 177 LayoutPoint point; |
| 179 if (object != context.paintInvalidationContainer) { | 178 if (object != context.paintInvalidationContainer) { |
| 180 point.moveBy(object.paintOffset()); | 179 point.moveBy(object.paintOffset()); |
| 181 | 180 |
| 182 const auto* containerTransform = | 181 const auto* containerTransform = |
| 183 context.paintInvalidationContainer->paintProperties() | 182 context.paintInvalidationContainer->contentsProperties()->transform(); |
| 184 ->contentsProperties() | |
| 185 ->transform(); | |
| 186 if (context.m_treeBuilderContext.current.transform != containerTransform) { | 183 if (context.m_treeBuilderContext.current.transform != containerTransform) { |
| 187 FloatRect rect = FloatRect(FloatPoint(point), FloatSize()); | 184 FloatRect rect = FloatRect(FloatPoint(point), FloatSize()); |
| 188 context.m_geometryMapper.sourceToDestinationRect( | 185 context.m_geometryMapper.sourceToDestinationRect( |
| 189 context.m_treeBuilderContext.current.transform, containerTransform, | 186 context.m_treeBuilderContext.current.transform, containerTransform, |
| 190 rect); | 187 rect); |
| 191 point = LayoutPoint(rect.location()); | 188 point = LayoutPoint(rect.location()); |
| 192 } | 189 } |
| 193 | 190 |
| 194 // Convert the result to the container's contents space. | 191 // Convert the result to the container's contents space. |
| 195 point.moveBy(-context.paintInvalidationContainer->paintOffset()); | 192 point.moveBy(-context.paintInvalidationContainer->paintOffset()); |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 496 } | 493 } |
| 497 } | 494 } |
| 498 | 495 |
| 499 void PaintInvalidator::processPendingDelayedPaintInvalidations() { | 496 void PaintInvalidator::processPendingDelayedPaintInvalidations() { |
| 500 for (auto target : m_pendingDelayedPaintInvalidations) | 497 for (auto target : m_pendingDelayedPaintInvalidations) |
| 501 target->getMutableForPainting().setShouldDoFullPaintInvalidation( | 498 target->getMutableForPainting().setShouldDoFullPaintInvalidation( |
| 502 PaintInvalidationDelayedFull); | 499 PaintInvalidationDelayedFull); |
| 503 } | 500 } |
| 504 | 501 |
| 505 } // namespace blink | 502 } // namespace blink |
| OLD | NEW |