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