| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 if (object.isBox()) | 47 if (object.isBox()) |
| 48 toLayoutBox(object).flipForWritingMode(rect); | 48 toLayoutBox(object).flipForWritingMode(rect); |
| 49 | 49 |
| 50 LayoutRect result; | 50 LayoutRect result; |
| 51 if (context.forcedSubtreeInvalidationFlags & PaintInvalidatorContext::Forced
SubtreeSlowPathRect) { | 51 if (context.forcedSubtreeInvalidationFlags & PaintInvalidatorContext::Forced
SubtreeSlowPathRect) { |
| 52 result = slowMapToVisualRectInAncestorSpace(object, *context.paintInvali
dationContainer, rect); | 52 result = slowMapToVisualRectInAncestorSpace(object, *context.paintInvali
dationContainer, rect); |
| 53 } else if (object == context.paintInvalidationContainer) { | 53 } else if (object == context.paintInvalidationContainer) { |
| 54 result = LayoutRect(rect); | 54 result = LayoutRect(rect); |
| 55 } else { | 55 } else { |
| 56 GeometryPropertyTreeState currentTreeState(context.treeBuilderContext.cu
rrent.transform, context.treeBuilderContext.current.clip, context.treeBuilderCon
text.currentEffect); | 56 GeometryPropertyTreeState currentTreeState(context.treeBuilderContext.cu
rrent.transform, context.treeBuilderContext.current.clip, context.treeBuilderCon
text.currentEffect); |
| 57 GeometryPropertyTreeState containerTreeState; | |
| 58 const ObjectPaintProperties* containerPaintProperties = context.paintInv
alidationContainer->objectPaintProperties(); | 57 const ObjectPaintProperties* containerPaintProperties = context.paintInv
alidationContainer->objectPaintProperties(); |
| 59 containerPaintProperties->getContentsProperties(containerTreeState); | 58 GeometryPropertyTreeState containerTreeState = containerPaintProperties-
>getContentsProperties(); |
| 60 | 59 |
| 61 rect.moveBy(FloatPoint(context.treeBuilderContext.current.paintOffset)); | 60 rect.moveBy(FloatPoint(context.treeBuilderContext.current.paintOffset)); |
| 62 bool success = false; | 61 bool success = false; |
| 63 result = LayoutRect(geometryMapper.mapToVisualRectInDestinationSpace(rec
t, currentTreeState, containerTreeState, success)); | 62 result = LayoutRect(geometryMapper.mapToVisualRectInDestinationSpace(rec
t, currentTreeState, containerTreeState, success)); |
| 64 DCHECK(success); | 63 DCHECK(success); |
| 65 result.moveBy(-containerPaintProperties->localBorderBoxProperties()->pai
ntOffset); | 64 result.moveBy(-containerPaintProperties->localBorderBoxProperties()->pai
ntOffset); |
| 66 } | 65 } |
| 67 | 66 |
| 68 if (context.paintInvalidationContainer->layer()->groupedMapping()) | 67 if (context.paintInvalidationContainer->layer()->groupedMapping()) |
| 69 PaintLayer::mapRectInPaintInvalidationContainerToBacking(*context.paintI
nvalidationContainer, result); | 68 PaintLayer::mapRectInPaintInvalidationContainerToBacking(*context.paintI
nvalidationContainer, result); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 93 } | 92 } |
| 94 | 93 |
| 95 LayoutPoint PaintInvalidator::computeLocationFromPaintInvalidationBacking(const
LayoutObject& object, const PaintInvalidatorContext& context) | 94 LayoutPoint PaintInvalidator::computeLocationFromPaintInvalidationBacking(const
LayoutObject& object, const PaintInvalidatorContext& context) |
| 96 { | 95 { |
| 97 FloatPoint point; | 96 FloatPoint point; |
| 98 if (object != context.paintInvalidationContainer) { | 97 if (object != context.paintInvalidationContainer) { |
| 99 point.moveBy(FloatPoint(context.treeBuilderContext.current.paintOffset))
; | 98 point.moveBy(FloatPoint(context.treeBuilderContext.current.paintOffset))
; |
| 100 | 99 |
| 101 bool success = false; | 100 bool success = false; |
| 102 GeometryPropertyTreeState currentTreeState(context.treeBuilderContext.cu
rrent.transform, context.treeBuilderContext.current.clip, context.treeBuilderCon
text.currentEffect); | 101 GeometryPropertyTreeState currentTreeState(context.treeBuilderContext.cu
rrent.transform, context.treeBuilderContext.current.clip, context.treeBuilderCon
text.currentEffect); |
| 103 GeometryPropertyTreeState containerTreeState; | 102 GeometryPropertyTreeState containerTreeState = context.paintInvalidation
Container->objectPaintProperties()->getContentsProperties(); |
| 104 context.paintInvalidationContainer->objectPaintProperties()->getContents
Properties(containerTreeState); | |
| 105 point = m_geometryMapper.mapRectToDestinationSpace(FloatRect(point, Floa
tSize()), currentTreeState, containerTreeState, success).location(); | 103 point = m_geometryMapper.mapRectToDestinationSpace(FloatRect(point, Floa
tSize()), currentTreeState, containerTreeState, success).location(); |
| 106 DCHECK(success); | 104 DCHECK(success); |
| 107 } | 105 } |
| 108 | 106 |
| 109 if (context.paintInvalidationContainer->layer()->groupedMapping()) | 107 if (context.paintInvalidationContainer->layer()->groupedMapping()) |
| 110 PaintLayer::mapPointInPaintInvalidationContainerToBacking(*context.paint
InvalidationContainer, point); | 108 PaintLayer::mapPointInPaintInvalidationContainerToBacking(*context.paint
InvalidationContainer, point); |
| 111 | 109 |
| 112 return LayoutPoint(point); | 110 return LayoutPoint(point); |
| 113 } | 111 } |
| 114 | 112 |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 object.getMutableForPainting().clearPaintInvalidationFlags(); | 283 object.getMutableForPainting().clearPaintInvalidationFlags(); |
| 286 } | 284 } |
| 287 | 285 |
| 288 void PaintInvalidator::processPendingDelayedPaintInvalidations() | 286 void PaintInvalidator::processPendingDelayedPaintInvalidations() |
| 289 { | 287 { |
| 290 for (auto target : m_pendingDelayedPaintInvalidations) | 288 for (auto target : m_pendingDelayedPaintInvalidations) |
| 291 target->getMutableForPainting().setShouldDoFullPaintInvalidation(PaintIn
validationDelayedFull); | 289 target->getMutableForPainting().setShouldDoFullPaintInvalidation(PaintIn
validationDelayedFull); |
| 292 } | 290 } |
| 293 | 291 |
| 294 } // namespace blink | 292 } // namespace blink |
| OLD | NEW |