Chromium Code Reviews| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 71 rect.moveBy(FloatPoint(context.treeBuilderContext.current.paintOffset)); | 71 rect.moveBy(FloatPoint(context.treeBuilderContext.current.paintOffset)); |
| 72 | 72 |
| 73 GeometryPropertyTreeState currentTreeState(context.treeBuilderContext.cu rrent.transform, context.treeBuilderContext.current.clip, context.treeBuilderCon text.currentEffect); | 73 GeometryPropertyTreeState currentTreeState(context.treeBuilderContext.cu rrent.transform, context.treeBuilderContext.current.clip, context.treeBuilderCon text.currentEffect); |
| 74 GeometryPropertyTreeState containerTreeState; | 74 GeometryPropertyTreeState containerTreeState; |
| 75 const ObjectPaintProperties* containerPaintProperties = context.paintInv alidationContainer->objectPaintProperties(); | 75 const ObjectPaintProperties* containerPaintProperties = context.paintInv alidationContainer->objectPaintProperties(); |
| 76 containerPaintProperties->getContentsProperties(containerTreeState); | 76 containerPaintProperties->getContentsProperties(containerTreeState); |
| 77 | 77 |
| 78 bool success = false; | 78 bool success = false; |
| 79 result = LayoutRect(geometryMapper.mapToVisualRectInDestinationSpace(rec t, currentTreeState, containerTreeState, success)); | 79 result = LayoutRect(geometryMapper.mapToVisualRectInDestinationSpace(rec t, currentTreeState, containerTreeState, success)); |
| 80 DCHECK(success); | 80 DCHECK(success); |
| 81 result.moveBy(-containerPaintProperties->localBorderBoxProperties()->pai ntOffset); | 81 |
| 82 // Exclude container's paint offset from the result to get it in contain er's local coordinates, | |
|
pdr.
2016/09/29 21:00:54
If possible I'd like to avoid having to do this ki
Xianzhu
2016/09/29 22:18:06
We do zero out the paint offset in PaintPropertyTr
pdr.
2016/09/29 23:31:54
Your latest patch does make this much clearer but
Xianzhu
2016/09/30 00:20:24
I think the root cause of the concept "paintOffset
pdr.
2016/09/30 04:06:00
Aha! I think I understand it now. In other words,
Xianzhu
2016/09/30 04:10:24
The design looks great! Thanks!
| |
| 83 // except for svgLocalToBorderBoxTransform which is applied after the co ntainer's paint offset. | |
| 84 if (containerTreeState.transform != containerPaintProperties->svgLocalTo BorderBoxTransform()) | |
| 85 result.moveBy(-containerPaintProperties->localBorderBoxProperties()- >paintOffset); | |
| 82 } | 86 } |
| 83 | 87 |
| 84 if (context.paintInvalidationContainer->layer()->groupedMapping()) | 88 if (context.paintInvalidationContainer->layer()->groupedMapping()) |
| 85 PaintLayer::mapRectInPaintInvalidationContainerToBacking(*context.paintI nvalidationContainer, result); | 89 PaintLayer::mapRectInPaintInvalidationContainerToBacking(*context.paintI nvalidationContainer, result); |
| 86 return result; | 90 return result; |
| 87 } | 91 } |
| 88 | 92 |
| 89 void PaintInvalidatorContext::mapLocalRectToPaintInvalidationBacking(const Layou tObject& object, LayoutRect& rect) const | 93 void PaintInvalidatorContext::mapLocalRectToPaintInvalidationBacking(const Layou tObject& object, LayoutRect& rect) const |
| 90 { | 94 { |
| 91 GeometryMapper geometryMapper; | 95 GeometryMapper geometryMapper; |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 313 object.getMutableForPainting().clearPaintInvalidationFlags(); | 317 object.getMutableForPainting().clearPaintInvalidationFlags(); |
| 314 } | 318 } |
| 315 | 319 |
| 316 void PaintInvalidator::processPendingDelayedPaintInvalidations() | 320 void PaintInvalidator::processPendingDelayedPaintInvalidations() |
| 317 { | 321 { |
| 318 for (auto target : m_pendingDelayedPaintInvalidations) | 322 for (auto target : m_pendingDelayedPaintInvalidations) |
| 319 target->getMutableForPainting().setShouldDoFullPaintInvalidation(PaintIn validationDelayedFull); | 323 target->getMutableForPainting().setShouldDoFullPaintInvalidation(PaintIn validationDelayedFull); |
| 320 } | 324 } |
| 321 | 325 |
| 322 } // namespace blink | 326 } // namespace blink |
| OLD | NEW |