| 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 19 matching lines...) Expand all Loading... |
| 30 toLayoutBox(object).flipForWritingMode(rect); | 30 toLayoutBox(object).flipForWritingMode(rect); |
| 31 | 31 |
| 32 LayoutRect result; | 32 LayoutRect result; |
| 33 if (object == context.paintInvalidationContainer) { | 33 if (object == context.paintInvalidationContainer) { |
| 34 result = LayoutRect(rect); | 34 result = LayoutRect(rect); |
| 35 } else { | 35 } else { |
| 36 rect.moveBy(FloatPoint(context.treeBuilderContext.current.paintOffset)); | 36 rect.moveBy(FloatPoint(context.treeBuilderContext.current.paintOffset)); |
| 37 | 37 |
| 38 bool success = false; | 38 bool success = false; |
| 39 PropertyTreeState currentTreeState(context.treeBuilderContext.current.tr
ansform, context.treeBuilderContext.current.clip, context.treeBuilderContext.cur
rentEffect); | 39 PropertyTreeState currentTreeState(context.treeBuilderContext.current.tr
ansform, context.treeBuilderContext.current.clip, context.treeBuilderContext.cur
rentEffect); |
| 40 const PropertyTreeState& containerTreeState = context.paintInvalidationC
ontainer->objectPaintProperties()->localBorderBoxProperties()->propertyTreeState
; | 40 PropertyTreeState containerTreeState; |
| 41 context.paintInvalidationContainer->objectPaintProperties()->getContents
Properties(containerTreeState); |
| 41 result = LayoutRect(geometryMapper.mapToVisualRectInDestinationSpace(rec
t, currentTreeState, containerTreeState, success)); | 42 result = LayoutRect(geometryMapper.mapToVisualRectInDestinationSpace(rec
t, currentTreeState, containerTreeState, success)); |
| 42 DCHECK(success); | 43 DCHECK(success); |
| 43 } | 44 } |
| 44 | 45 |
| 45 if (context.paintInvalidationContainer->layer()->groupedMapping()) | 46 if (context.paintInvalidationContainer->layer()->groupedMapping()) |
| 46 PaintLayer::mapRectInPaintInvalidationContainerToBacking(*context.paintI
nvalidationContainer, result); | 47 PaintLayer::mapRectInPaintInvalidationContainerToBacking(*context.paintI
nvalidationContainer, result); |
| 47 return result; | 48 return result; |
| 48 } | 49 } |
| 49 | 50 |
| 50 void PaintInvalidatorContext::mapLocalRectToPaintInvalidationBacking(const Layou
tObject& object, LayoutRect& rect) const | 51 void PaintInvalidatorContext::mapLocalRectToPaintInvalidationBacking(const Layou
tObject& object, LayoutRect& rect) const |
| (...skipping 19 matching lines...) Expand all Loading... |
| 70 } | 71 } |
| 71 | 72 |
| 72 LayoutPoint PaintInvalidator::computeLocationFromPaintInvalidationBacking(const
LayoutObject& object, const PaintInvalidatorContext& context) | 73 LayoutPoint PaintInvalidator::computeLocationFromPaintInvalidationBacking(const
LayoutObject& object, const PaintInvalidatorContext& context) |
| 73 { | 74 { |
| 74 FloatPoint point; | 75 FloatPoint point; |
| 75 if (object != context.paintInvalidationContainer) { | 76 if (object != context.paintInvalidationContainer) { |
| 76 point.moveBy(FloatPoint(context.treeBuilderContext.current.paintOffset))
; | 77 point.moveBy(FloatPoint(context.treeBuilderContext.current.paintOffset))
; |
| 77 | 78 |
| 78 bool success = false; | 79 bool success = false; |
| 79 PropertyTreeState currentTreeState(context.treeBuilderContext.current.tr
ansform, context.treeBuilderContext.current.clip, context.treeBuilderContext.cur
rentEffect); | 80 PropertyTreeState currentTreeState(context.treeBuilderContext.current.tr
ansform, context.treeBuilderContext.current.clip, context.treeBuilderContext.cur
rentEffect); |
| 80 const PropertyTreeState& containerTreeState = context.paintInvalidationC
ontainer->objectPaintProperties()->localBorderBoxProperties()->propertyTreeState
; | 81 PropertyTreeState containerTreeState; |
| 82 context.paintInvalidationContainer->objectPaintProperties()->getContents
Properties(containerTreeState); |
| 81 point = m_geometryMapper.mapRectToDestinationSpace(FloatRect(point, Floa
tSize()), currentTreeState, containerTreeState, success).location(); | 83 point = m_geometryMapper.mapRectToDestinationSpace(FloatRect(point, Floa
tSize()), currentTreeState, containerTreeState, success).location(); |
| 82 DCHECK(success); | 84 DCHECK(success); |
| 83 } | 85 } |
| 84 | 86 |
| 85 if (context.paintInvalidationContainer->layer()->groupedMapping()) | 87 if (context.paintInvalidationContainer->layer()->groupedMapping()) |
| 86 PaintLayer::mapPointInPaintInvalidationContainerToBacking(*context.paint
InvalidationContainer, point); | 88 PaintLayer::mapPointInPaintInvalidationContainerToBacking(*context.paint
InvalidationContainer, point); |
| 87 | 89 |
| 88 return LayoutPoint(point); | 90 return LayoutPoint(point); |
| 89 } | 91 } |
| 90 | 92 |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 object.getMutableForPainting().clearPaintInvalidationFlags(); | 234 object.getMutableForPainting().clearPaintInvalidationFlags(); |
| 233 } | 235 } |
| 234 | 236 |
| 235 void PaintInvalidator::processPendingDelayedPaintInvalidations() | 237 void PaintInvalidator::processPendingDelayedPaintInvalidations() |
| 236 { | 238 { |
| 237 for (auto target : m_pendingDelayedPaintInvalidations) | 239 for (auto target : m_pendingDelayedPaintInvalidations) |
| 238 target->getMutableForPainting().setShouldDoFullPaintInvalidation(PaintIn
validationDelayedFull); | 240 target->getMutableForPainting().setShouldDoFullPaintInvalidation(PaintIn
validationDelayedFull); |
| 239 } | 241 } |
| 240 | 242 |
| 241 } // namespace blink | 243 } // namespace blink |
| OLD | NEW |