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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 FloatRect rect = localRect; | 46 FloatRect rect = localRect; |
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 rect.moveBy(FloatPoint(context.treeBuilderContext.current.paintOffset)); |
| 57 |
| 58 // In SPv2, visual rects are in the space of their local transform node. |
| 59 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) |
| 60 return LayoutRect(rect); |
| 61 |
56 GeometryPropertyTreeState currentTreeState(context.treeBuilderContext.cu
rrent.transform, context.treeBuilderContext.current.clip, context.treeBuilderCon
text.currentEffect); | 62 GeometryPropertyTreeState currentTreeState(context.treeBuilderContext.cu
rrent.transform, context.treeBuilderContext.current.clip, context.treeBuilderCon
text.currentEffect); |
57 GeometryPropertyTreeState containerTreeState; | 63 GeometryPropertyTreeState containerTreeState; |
58 const ObjectPaintProperties* containerPaintProperties = context.paintInv
alidationContainer->objectPaintProperties(); | 64 const ObjectPaintProperties* containerPaintProperties = context.paintInv
alidationContainer->objectPaintProperties(); |
59 containerPaintProperties->getContentsProperties(containerTreeState); | 65 containerPaintProperties->getContentsProperties(containerTreeState); |
60 | 66 |
61 rect.moveBy(FloatPoint(context.treeBuilderContext.current.paintOffset)); | |
62 bool success = false; | 67 bool success = false; |
63 result = LayoutRect(geometryMapper.mapToVisualRectInDestinationSpace(rec
t, currentTreeState, containerTreeState, success)); | 68 result = LayoutRect(geometryMapper.mapToVisualRectInDestinationSpace(rec
t, currentTreeState, containerTreeState, success)); |
64 DCHECK(success); | 69 DCHECK(success); |
65 result.moveBy(-containerPaintProperties->localBorderBoxProperties()->pai
ntOffset); | 70 result.moveBy(-containerPaintProperties->localBorderBoxProperties()->pai
ntOffset); |
66 } | 71 } |
67 | 72 |
68 if (context.paintInvalidationContainer->layer()->groupedMapping()) | 73 if (context.paintInvalidationContainer->layer()->groupedMapping()) |
69 PaintLayer::mapRectInPaintInvalidationContainerToBacking(*context.paintI
nvalidationContainer, result); | 74 PaintLayer::mapRectInPaintInvalidationContainerToBacking(*context.paintI
nvalidationContainer, result); |
70 return result; | 75 return result; |
71 } | 76 } |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 object.getMutableForPainting().clearPaintInvalidationFlags(); | 290 object.getMutableForPainting().clearPaintInvalidationFlags(); |
286 } | 291 } |
287 | 292 |
288 void PaintInvalidator::processPendingDelayedPaintInvalidations() | 293 void PaintInvalidator::processPendingDelayedPaintInvalidations() |
289 { | 294 { |
290 for (auto target : m_pendingDelayedPaintInvalidations) | 295 for (auto target : m_pendingDelayedPaintInvalidations) |
291 target->getMutableForPainting().setShouldDoFullPaintInvalidation(PaintIn
validationDelayedFull); | 296 target->getMutableForPainting().setShouldDoFullPaintInvalidation(PaintIn
validationDelayedFull); |
292 } | 297 } |
293 | 298 |
294 } // namespace blink | 299 } // namespace blink |
OLD | NEW |