| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 | 55 |
| 56 LayoutRect result; | 56 LayoutRect result; |
| 57 if (context.forcedSubtreeInvalidationFlags & PaintInvalidatorContext::Forced
SubtreeSlowPathRect) { | 57 if (context.forcedSubtreeInvalidationFlags & PaintInvalidatorContext::Forced
SubtreeSlowPathRect) { |
| 58 result = slowMapToVisualRectInAncestorSpace(object, *context.paintInvali
dationContainer, rect); | 58 result = slowMapToVisualRectInAncestorSpace(object, *context.paintInvali
dationContainer, rect); |
| 59 } else if (object == context.paintInvalidationContainer) { | 59 } else if (object == context.paintInvalidationContainer) { |
| 60 result = LayoutRect(rect); | 60 result = LayoutRect(rect); |
| 61 } else { | 61 } else { |
| 62 rect.moveBy(FloatPoint(context.treeBuilderContext.current.paintOffset)); | 62 rect.moveBy(FloatPoint(context.treeBuilderContext.current.paintOffset)); |
| 63 | 63 |
| 64 GeometryPropertyTreeState currentTreeState(context.treeBuilderContext.cu
rrent.transform, context.treeBuilderContext.current.clip, context.treeBuilderCon
text.currentEffect); | 64 GeometryPropertyTreeState currentTreeState(context.treeBuilderContext.cu
rrent.transform, context.treeBuilderContext.current.clip, context.treeBuilderCon
text.currentEffect); |
| 65 GeometryPropertyTreeState containerTreeState; | |
| 66 const ObjectPaintProperties* containerPaintProperties = context.paintInv
alidationContainer->objectPaintProperties(); | 65 const ObjectPaintProperties* containerPaintProperties = context.paintInv
alidationContainer->objectPaintProperties(); |
| 67 containerPaintProperties->getContentsProperties(containerTreeState); | 66 GeometryPropertyTreeState containerTreeState = containerPaintProperties-
>getContentsProperties(); |
| 68 | 67 |
| 69 bool success = false; | 68 bool success = false; |
| 70 result = LayoutRect(geometryMapper.mapToVisualRectInDestinationSpace(rec
t, currentTreeState, containerTreeState, success)); | 69 result = LayoutRect(geometryMapper.mapToVisualRectInDestinationSpace(rec
t, currentTreeState, containerTreeState, success)); |
| 71 DCHECK(success); | 70 DCHECK(success); |
| 72 result.moveBy(-containerPaintProperties->localBorderBoxProperties()->pai
ntOffset); | 71 result.moveBy(-containerPaintProperties->localBorderBoxProperties()->pai
ntOffset); |
| 73 } | 72 } |
| 74 | 73 |
| 75 if (context.paintInvalidationContainer->layer()->groupedMapping()) | 74 if (context.paintInvalidationContainer->layer()->groupedMapping()) |
| 76 PaintLayer::mapRectInPaintInvalidationContainerToBacking(*context.paintI
nvalidationContainer, result); | 75 PaintLayer::mapRectInPaintInvalidationContainerToBacking(*context.paintI
nvalidationContainer, result); |
| 77 return result; | 76 return result; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 100 } | 99 } |
| 101 | 100 |
| 102 LayoutPoint PaintInvalidator::computeLocationFromPaintInvalidationBacking(const
LayoutObject& object, const PaintInvalidatorContext& context) | 101 LayoutPoint PaintInvalidator::computeLocationFromPaintInvalidationBacking(const
LayoutObject& object, const PaintInvalidatorContext& context) |
| 103 { | 102 { |
| 104 FloatPoint point; | 103 FloatPoint point; |
| 105 if (object != context.paintInvalidationContainer) { | 104 if (object != context.paintInvalidationContainer) { |
| 106 point.moveBy(FloatPoint(context.treeBuilderContext.current.paintOffset))
; | 105 point.moveBy(FloatPoint(context.treeBuilderContext.current.paintOffset))
; |
| 107 | 106 |
| 108 bool success = false; | 107 bool success = false; |
| 109 GeometryPropertyTreeState currentTreeState(context.treeBuilderContext.cu
rrent.transform, context.treeBuilderContext.current.clip, context.treeBuilderCon
text.currentEffect); | 108 GeometryPropertyTreeState currentTreeState(context.treeBuilderContext.cu
rrent.transform, context.treeBuilderContext.current.clip, context.treeBuilderCon
text.currentEffect); |
| 110 GeometryPropertyTreeState containerTreeState; | 109 GeometryPropertyTreeState containerTreeState = context.paintInvalidation
Container->objectPaintProperties()->getContentsProperties(); |
| 111 context.paintInvalidationContainer->objectPaintProperties()->getContents
Properties(containerTreeState); | |
| 112 point = m_geometryMapper.mapRectToDestinationSpace(FloatRect(point, Floa
tSize()), currentTreeState, containerTreeState, success).location(); | 110 point = m_geometryMapper.mapRectToDestinationSpace(FloatRect(point, Floa
tSize()), currentTreeState, containerTreeState, success).location(); |
| 113 DCHECK(success); | 111 DCHECK(success); |
| 114 } | 112 } |
| 115 | 113 |
| 116 if (context.paintInvalidationContainer->layer()->groupedMapping()) | 114 if (context.paintInvalidationContainer->layer()->groupedMapping()) |
| 117 PaintLayer::mapPointInPaintInvalidationContainerToBacking(*context.paint
InvalidationContainer, point); | 115 PaintLayer::mapPointInPaintInvalidationContainerToBacking(*context.paint
InvalidationContainer, point); |
| 118 | 116 |
| 119 return LayoutPoint(point); | 117 return LayoutPoint(point); |
| 120 } | 118 } |
| 121 | 119 |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 object.getMutableForPainting().clearPaintInvalidationFlags(); | 303 object.getMutableForPainting().clearPaintInvalidationFlags(); |
| 306 } | 304 } |
| 307 | 305 |
| 308 void PaintInvalidator::processPendingDelayedPaintInvalidations() | 306 void PaintInvalidator::processPendingDelayedPaintInvalidations() |
| 309 { | 307 { |
| 310 for (auto target : m_pendingDelayedPaintInvalidations) | 308 for (auto target : m_pendingDelayedPaintInvalidations) |
| 311 target->getMutableForPainting().setShouldDoFullPaintInvalidation(PaintIn
validationDelayedFull); | 309 target->getMutableForPainting().setShouldDoFullPaintInvalidation(PaintIn
validationDelayedFull); |
| 312 } | 310 } |
| 313 | 311 |
| 314 } // namespace blink | 312 } // namespace blink |
| OLD | NEW |