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 #ifndef PaintInvalidator_h | 5 #ifndef PaintInvalidator_h |
| 6 #define PaintInvalidator_h | 6 #define PaintInvalidator_h |
| 7 | 7 |
| 8 #include "platform/geometry/LayoutRect.h" | 8 #include "platform/geometry/LayoutRect.h" |
| 9 #include "platform/graphics/paint/GeometryMapper.h" | 9 #include "platform/graphics/paint/GeometryMapper.h" |
| 10 #include "wtf/Vector.h" | 10 #include "wtf/Vector.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 61 // The current paint invalidation container for stacked contents (stacking | 61 // The current paint invalidation container for stacked contents (stacking |
| 62 // contexts or positioned objects). It is the nearest ancestor composited | 62 // contexts or positioned objects). It is the nearest ancestor composited |
| 63 // object which establishes a stacking context. See | 63 // object which establishes a stacking context. See |
| 64 // Source/core/paint/README.md ### PaintInvalidationState for details on how | 64 // Source/core/paint/README.md ### PaintInvalidationState for details on how |
| 65 // stacked contents' paint invalidation containers differ. | 65 // stacked contents' paint invalidation containers differ. |
| 66 const LayoutBoxModelObject* paintInvalidationContainerForStackedContents = | 66 const LayoutBoxModelObject* paintInvalidationContainerForStackedContents = |
| 67 nullptr; | 67 nullptr; |
| 68 | 68 |
| 69 PaintLayer* paintingLayer = nullptr; | 69 PaintLayer* paintingLayer = nullptr; |
| 70 | 70 |
| 71 // Store the new and old visual rects in the paint invalidation backing's | |
| 72 // coordinates. The rects do *not* account for composited scrolling. | |
| 73 // See LayoutObject::adjustVisualRectForCompositedScrolling(). | |
| 71 LayoutRect oldVisualRect; | 74 LayoutRect oldVisualRect; |
| 72 LayoutRect newVisualRect; | 75 LayoutRect newVisualRect; |
| 76 | |
| 77 // Store the origin of the object's local coordinates in the paint | |
| 78 // invalidation backing's coordinates. They are used to detect layoutObject | |
| 79 // shifts that forces a full invalidation. | |
|
chrishtr
2016/11/04 18:20:07
nit: s/forces/force/
Xianzhu
2016/11/04 19:11:03
Done.
| |
| 80 // The points do *not* account for composited scrolling. See | |
| 81 // LayoutObject::adjustVisualRectForCompositedScrolling(). | |
| 73 LayoutPoint oldLocation; | 82 LayoutPoint oldLocation; |
| 74 LayoutPoint newLocation; | 83 LayoutPoint newLocation; |
| 75 }; | 84 }; |
| 76 | 85 |
| 77 class PaintInvalidator { | 86 class PaintInvalidator { |
| 78 public: | 87 public: |
| 79 void invalidatePaintIfNeeded(FrameView&, PaintInvalidatorContext&); | 88 void invalidatePaintIfNeeded(FrameView&, PaintInvalidatorContext&); |
| 80 void invalidatePaintIfNeeded(const LayoutObject&, PaintInvalidatorContext&); | 89 void invalidatePaintIfNeeded(const LayoutObject&, PaintInvalidatorContext&); |
| 81 | 90 |
| 82 // Process objects needing paint invalidation on the next frame. | 91 // Process objects needing paint invalidation on the next frame. |
| 83 // See the definition of PaintInvalidationDelayedFull for more details. | 92 // See the definition of PaintInvalidationDelayedFull for more details. |
| 84 void processPendingDelayedPaintInvalidations(); | 93 void processPendingDelayedPaintInvalidations(); |
| 85 | 94 |
| 86 private: | 95 private: |
| 87 LayoutRect mapLocalRectToPaintInvalidationBacking( | 96 LayoutRect mapLocalRectToPaintInvalidationBacking( |
| 88 const LayoutObject&, | 97 const LayoutObject&, |
| 89 const FloatRect&, | 98 const FloatRect&, |
| 90 const PaintInvalidatorContext&); | 99 const PaintInvalidatorContext&); |
| 91 LayoutRect computeVisualRectInBacking(const LayoutObject&, | 100 LayoutRect computeVisualRectInBacking(const LayoutObject&, |
| 92 const PaintInvalidatorContext&); | 101 const PaintInvalidatorContext&); |
| 93 LayoutPoint computeLocationFromPaintInvalidationBacking( | 102 LayoutPoint computeLocationInBacking(const LayoutObject&, |
| 94 const LayoutObject&, | 103 const PaintInvalidatorContext&); |
| 95 const PaintInvalidatorContext&); | |
| 96 void updatePaintingLayer(const LayoutObject&, PaintInvalidatorContext&); | 104 void updatePaintingLayer(const LayoutObject&, PaintInvalidatorContext&); |
| 97 void updateContext(const LayoutObject&, PaintInvalidatorContext&); | 105 void updateContext(const LayoutObject&, PaintInvalidatorContext&); |
| 98 | 106 |
| 99 Vector<const LayoutObject*> m_pendingDelayedPaintInvalidations; | 107 Vector<const LayoutObject*> m_pendingDelayedPaintInvalidations; |
| 100 GeometryMapper m_geometryMapper; | 108 GeometryMapper m_geometryMapper; |
| 101 }; | 109 }; |
| 102 | 110 |
| 103 } // namespace blink | 111 } // namespace blink |
| 104 | 112 |
| 105 #endif // PaintInvalidator_h | 113 #endif // PaintInvalidator_h |
| OLD | NEW |