| 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 BoxPaintInvalidator_h | 5 #ifndef BoxPaintInvalidator_h |
| 6 #define BoxPaintInvalidator_h | 6 #define BoxPaintInvalidator_h |
| 7 | 7 |
| 8 #include "platform/graphics/PaintInvalidationReason.h" | 8 #include "platform/graphics/PaintInvalidationReason.h" |
| 9 #include "wtf/Allocator.h" | 9 #include "wtf/Allocator.h" |
| 10 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 class LayoutBox; | 13 class LayoutBox; |
| 14 class LayoutRect; | 14 class LayoutRect; |
| 15 class LayoutSize; | |
| 16 struct PaintInvalidatorContext; | 15 struct PaintInvalidatorContext; |
| 17 | 16 |
| 18 class BoxPaintInvalidator { | 17 class BoxPaintInvalidator { |
| 19 STACK_ALLOCATED(); | 18 STACK_ALLOCATED(); |
| 20 | 19 |
| 21 public: | 20 public: |
| 22 BoxPaintInvalidator(const LayoutBox& box, | 21 BoxPaintInvalidator(const LayoutBox& box, |
| 23 const PaintInvalidatorContext& context) | 22 const PaintInvalidatorContext& context) |
| 24 : m_box(box), m_context(context) {} | 23 : m_box(box), m_context(context) {} |
| 25 | 24 |
| 26 static void boxWillBeDestroyed(const LayoutBox&); | 25 static void boxWillBeDestroyed(const LayoutBox&); |
| 27 | 26 |
| 28 PaintInvalidationReason invalidatePaintIfNeeded(); | 27 PaintInvalidationReason invalidatePaintIfNeeded(); |
| 29 | 28 |
| 30 static LayoutSize previousBorderBoxSize(const LayoutBox&, | |
| 31 const LayoutSize& defaultSize); | |
| 32 | |
| 33 private: | 29 private: |
| 34 bool backgroundGeometryDependsOnLayoutOverflowRect(); | 30 bool backgroundGeometryDependsOnLayoutOverflowRect(); |
| 35 bool backgroundPaintsOntoScrollingContentsLayer(); | 31 bool backgroundPaintsOntoScrollingContentsLayer(); |
| 36 bool shouldFullyInvalidateBackgroundOnLayoutOverflowChange( | 32 bool shouldFullyInvalidateBackgroundOnLayoutOverflowChange( |
| 37 const LayoutRect& oldLayoutOverflow, | 33 const LayoutRect& oldLayoutOverflow, |
| 38 const LayoutRect& newLayoutOverflow); | 34 const LayoutRect& newLayoutOverflow); |
| 39 void invalidateScrollingContentsBackgroundIfNeeded(); | 35 void invalidateScrollingContentsBackgroundIfNeeded(); |
| 40 | 36 |
| 41 PaintInvalidationReason computePaintInvalidationReason(); | 37 PaintInvalidationReason computePaintInvalidationReason(); |
| 42 | 38 |
| 43 bool incrementallyInvalidatePaint(PaintInvalidationReason, | 39 bool incrementallyInvalidatePaint(PaintInvalidationReason, |
| 44 const LayoutRect& oldRect, | 40 const LayoutRect& oldRect, |
| 45 const LayoutRect& newRect); | 41 const LayoutRect& newRect); |
| 46 | 42 |
| 47 bool needsToSavePreviousBoxGeometries(); | 43 bool needsToSavePreviousBoxGeometries(); |
| 48 void savePreviousBoxGeometriesIfNeeded(); | 44 void savePreviousBoxGeometriesIfNeeded(); |
| 49 LayoutRect previousContentBoxRect(); | 45 LayoutRect previousContentBoxRect(); |
| 50 LayoutRect previousLayoutOverflowRect(); | 46 LayoutRect previousLayoutOverflowRect(); |
| 51 | 47 |
| 52 const LayoutBox& m_box; | 48 const LayoutBox& m_box; |
| 53 const PaintInvalidatorContext& m_context; | 49 const PaintInvalidatorContext& m_context; |
| 54 }; | 50 }; |
| 55 | 51 |
| 56 } // namespace blink | 52 } // namespace blink |
| 57 | 53 |
| 58 #endif | 54 #endif |
| OLD | NEW |