| 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" |
| 11 #include "core/layout/LayoutBlockFlow.h" | 11 #include "core/layout/LayoutBlockFlow.h" |
| 12 #include "core/layout/LayoutObject.h" | 12 #include "core/layout/LayoutObject.h" |
| 13 #include "core/layout/LayoutTable.h" | 13 #include "core/layout/LayoutTable.h" |
| 14 #include "core/layout/LayoutView.h" | 14 #include "core/layout/LayoutView.h" |
| 15 #include "core/layout/svg/SVGLayoutSupport.h" | 15 #include "core/layout/svg/SVGLayoutSupport.h" |
| 16 #include "core/paint/ObjectPaintProperties.h" | 16 #include "core/paint/ObjectPaintProperties.h" |
| 17 #include "core/paint/PaintLayer.h" | 17 #include "core/paint/PaintLayer.h" |
| 18 #include "core/paint/PaintLayerScrollableArea.h" | 18 #include "core/paint/PaintLayerScrollableArea.h" |
| 19 #include "core/paint/PaintPropertyTreeBuilder.h" | 19 #include "core/paint/PaintPropertyTreeBuilder.h" |
| 20 #include "platform/graphics/paint/GeometryMapper.h" |
| 20 #include "wtf/Optional.h" | 21 #include "wtf/Optional.h" |
| 21 | 22 |
| 22 namespace blink { | 23 namespace blink { |
| 23 | 24 |
| 24 template <typename Rect> | 25 template <typename Rect> |
| 25 static LayoutRect slowMapToVisualRectInAncestorSpace( | 26 static LayoutRect slowMapToVisualRectInAncestorSpace( |
| 26 const LayoutObject& object, | 27 const LayoutObject& object, |
| 27 const LayoutBoxModelObject& ancestor, | 28 const LayoutBoxModelObject& ancestor, |
| 28 const Rect& rect) { | 29 const Rect& rect) { |
| 29 if (object.isSVGChild()) { | 30 if (object.isSVGChild()) { |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 // (see CompositedLayerMapping::setContentsNeedDisplayInRect()). | 121 // (see CompositedLayerMapping::setContentsNeedDisplayInRect()). |
| 121 if (!isSVGChild && context.m_treeBuilderContext.current.transform != | 122 if (!isSVGChild && context.m_treeBuilderContext.current.transform != |
| 122 containerContentsProperties->transform()) | 123 containerContentsProperties->transform()) |
| 123 rect = Rect(enclosingIntRect(rect)); | 124 rect = Rect(enclosingIntRect(rect)); |
| 124 | 125 |
| 125 PropertyTreeState currentTreeState( | 126 PropertyTreeState currentTreeState( |
| 126 context.m_treeBuilderContext.current.transform, | 127 context.m_treeBuilderContext.current.transform, |
| 127 context.m_treeBuilderContext.current.clip, nullptr); | 128 context.m_treeBuilderContext.current.clip, nullptr); |
| 128 | 129 |
| 129 FloatRect floatRect(rect); | 130 FloatRect floatRect(rect); |
| 130 context.m_geometryMapper.sourceToDestinationVisualRect( | 131 GeometryMapper::sourceToDestinationVisualRect( |
| 131 currentTreeState, *containerContentsProperties, floatRect); | 132 currentTreeState, *containerContentsProperties, floatRect); |
| 132 result = LayoutRect(floatRect); | 133 result = LayoutRect(floatRect); |
| 133 } | 134 } |
| 134 | 135 |
| 135 // Convert the result to the container's contents space. | 136 // Convert the result to the container's contents space. |
| 136 result.moveBy(-context.paintInvalidationContainer->paintOffset()); | 137 result.moveBy(-context.paintInvalidationContainer->paintOffset()); |
| 137 } | 138 } |
| 138 | 139 |
| 139 object.adjustVisualRectForRasterEffects(result); | 140 object.adjustVisualRectForRasterEffects(result); |
| 140 | 141 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 return object.paintOffset(); | 176 return object.paintOffset(); |
| 176 | 177 |
| 177 LayoutPoint point; | 178 LayoutPoint point; |
| 178 if (object != context.paintInvalidationContainer) { | 179 if (object != context.paintInvalidationContainer) { |
| 179 point.moveBy(object.paintOffset()); | 180 point.moveBy(object.paintOffset()); |
| 180 | 181 |
| 181 const auto* containerTransform = | 182 const auto* containerTransform = |
| 182 context.paintInvalidationContainer->contentsProperties()->transform(); | 183 context.paintInvalidationContainer->contentsProperties()->transform(); |
| 183 if (context.m_treeBuilderContext.current.transform != containerTransform) { | 184 if (context.m_treeBuilderContext.current.transform != containerTransform) { |
| 184 FloatRect rect = FloatRect(FloatPoint(point), FloatSize()); | 185 FloatRect rect = FloatRect(FloatPoint(point), FloatSize()); |
| 185 context.m_geometryMapper.sourceToDestinationRect( | 186 GeometryMapper::sourceToDestinationRect( |
| 186 context.m_treeBuilderContext.current.transform, containerTransform, | 187 context.m_treeBuilderContext.current.transform, containerTransform, |
| 187 rect); | 188 rect); |
| 188 point = LayoutPoint(rect.location()); | 189 point = LayoutPoint(rect.location()); |
| 189 } | 190 } |
| 190 | 191 |
| 191 // Convert the result to the container's contents space. | 192 // Convert the result to the container's contents space. |
| 192 point.moveBy(-context.paintInvalidationContainer->paintOffset()); | 193 point.moveBy(-context.paintInvalidationContainer->paintOffset()); |
| 193 } | 194 } |
| 194 | 195 |
| 195 if (context.paintInvalidationContainer->layer()->groupedMapping()) { | 196 if (context.paintInvalidationContainer->layer()->groupedMapping()) { |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 } | 494 } |
| 494 } | 495 } |
| 495 | 496 |
| 496 void PaintInvalidator::processPendingDelayedPaintInvalidations() { | 497 void PaintInvalidator::processPendingDelayedPaintInvalidations() { |
| 497 for (auto target : m_pendingDelayedPaintInvalidations) | 498 for (auto target : m_pendingDelayedPaintInvalidations) |
| 498 target->getMutableForPainting().setShouldDoFullPaintInvalidation( | 499 target->getMutableForPainting().setShouldDoFullPaintInvalidation( |
| 499 PaintInvalidationDelayedFull); | 500 PaintInvalidationDelayedFull); |
| 500 } | 501 } |
| 501 | 502 |
| 502 } // namespace blink | 503 } // namespace blink |
| OLD | NEW |