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 "platform/wtf/Allocator.h" | 9 #include "platform/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 struct PaintInvalidatorContext; | 15 struct PaintInvalidatorContext; |
16 | 16 |
17 class BoxPaintInvalidator { | 17 class BoxPaintInvalidator { |
18 STACK_ALLOCATED(); | 18 STACK_ALLOCATED(); |
19 | 19 |
20 public: | 20 public: |
21 BoxPaintInvalidator(const LayoutBox& box, | 21 BoxPaintInvalidator(const LayoutBox& box, |
22 const PaintInvalidatorContext& context) | 22 const PaintInvalidatorContext& context) |
23 : box_(box), context_(context) {} | 23 : box_(box), context_(context) {} |
24 | 24 |
25 static void BoxWillBeDestroyed(const LayoutBox&); | 25 static void BoxWillBeDestroyed(const LayoutBox&); |
26 | 26 |
27 PaintInvalidationReason InvalidatePaintIfNeeded(); | 27 PaintInvalidationReason InvalidatePaint(); |
28 | 28 |
29 private: | 29 private: |
30 bool BackgroundGeometryDependsOnLayoutOverflowRect(); | 30 bool BackgroundGeometryDependsOnLayoutOverflowRect(); |
31 bool BackgroundPaintsOntoScrollingContentsLayer(); | 31 bool BackgroundPaintsOntoScrollingContentsLayer(); |
32 bool ShouldFullyInvalidateBackgroundOnLayoutOverflowChange( | 32 bool ShouldFullyInvalidateBackgroundOnLayoutOverflowChange( |
33 const LayoutRect& old_layout_overflow, | 33 const LayoutRect& old_layout_overflow, |
34 const LayoutRect& new_layout_overflow); | 34 const LayoutRect& new_layout_overflow); |
35 void InvalidateScrollingContentsBackgroundIfNeeded(); | 35 void InvalidateScrollingContentsBackgroundIfNeeded(); |
36 | 36 |
37 PaintInvalidationReason ComputePaintInvalidationReason(); | 37 PaintInvalidationReason ComputePaintInvalidationReason(); |
38 | 38 |
39 bool IncrementallyInvalidatePaint(PaintInvalidationReason, | 39 bool IncrementallyInvalidatePaint(PaintInvalidationReason, |
40 const LayoutRect& old_rect, | 40 const LayoutRect& old_rect, |
41 const LayoutRect& new_rect); | 41 const LayoutRect& new_rect); |
42 | 42 |
43 bool NeedsToSavePreviousContentBoxSizeOrLayoutOverflowRect(); | 43 bool NeedsToSavePreviousContentBoxSizeOrLayoutOverflowRect(); |
44 void SavePreviousBoxGeometriesIfNeeded(); | 44 void SavePreviousBoxGeometriesIfNeeded(); |
45 | 45 |
46 const LayoutBox& box_; | 46 const LayoutBox& box_; |
47 const PaintInvalidatorContext& context_; | 47 const PaintInvalidatorContext& context_; |
48 }; | 48 }; |
49 | 49 |
50 } // namespace blink | 50 } // namespace blink |
51 | 51 |
52 #endif | 52 #endif |
OLD | NEW |