OLD | NEW |
---|---|
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 FragmentData_h | 5 #ifndef FragmentData_h |
6 #define FragmentData_h | 6 #define FragmentData_h |
7 | 7 |
8 #include "core/paint/ObjectPaintProperties.h" | 8 #include "core/paint/ObjectPaintProperties.h" |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
11 | 11 |
12 class ObjectPaintProperties; | 12 class ObjectPaintProperties; |
13 | 13 |
14 // Represents the data for a particular fragment of a LayoutObject. | 14 // Represents the data for a particular fragment of a LayoutObject. |
15 // Only LayoutObjects with a self-painting PaintLayer may have more than one | 15 // Only LayoutObjects with a self-painting PaintLayer may have more than one |
16 // FragmentDeta, and even then only when they are inside of multicol. | 16 // FragmentDeta, and even then only when they are inside of multicol. |
17 // See README.md. | 17 // See README.md. |
18 class CORE_EXPORT FragmentData { | 18 class CORE_EXPORT FragmentData { |
19 public: | 19 public: |
20 static std::unique_ptr<FragmentData> Create() { | 20 static std::unique_ptr<FragmentData> Create() { |
21 return WTF::WrapUnique(new FragmentData()); | 21 return WTF::WrapUnique(new FragmentData()); |
22 } | 22 } |
23 | 23 |
24 ObjectPaintProperties* PaintProperties() const { | 24 ObjectPaintProperties* PaintProperties() const { |
25 return paint_properties_.get(); | 25 return paint_properties_.get(); |
26 } | 26 } |
27 ObjectPaintProperties& EnsurePaintProperties(); | 27 ObjectPaintProperties& EnsurePaintProperties(); |
28 void ClearPaintProperties(); | 28 void ClearPaintProperties(); |
29 | 29 |
30 ClipRects* PreviousPaintingClipRects() const { | |
wkorman
2017/05/01 20:29:24
Are there other clip rects we expect to store in F
chrishtr
2017/05/01 21:43:54
Done.
| |
31 DCHECK(RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()); | |
32 return previous_painting_clip_rects_.Get(); | |
33 } | |
34 void SetPreviousPaintingClipRects(ClipRects& clip_rects) { | |
35 previous_painting_clip_rects_ = &clip_rects; | |
36 } | |
37 void ClearPreviousPaintingClipRects() { | |
38 previous_painting_clip_rects_.Clear(); | |
39 } | |
40 | |
30 FragmentData* NextFragment() { return next_fragment_.get(); } | 41 FragmentData* NextFragment() { return next_fragment_.get(); } |
31 | 42 |
32 private: | 43 private: |
33 // Holds references to the paint property nodes created by this object. | 44 // Holds references to the paint property nodes created by this object. |
34 std::unique_ptr<ObjectPaintProperties> paint_properties_; | 45 std::unique_ptr<ObjectPaintProperties> paint_properties_; |
35 | 46 |
47 // These are used to detect changes to clipping that might invalidate | |
48 // subsequence caching or paint phase optimizations. | |
49 RefPtr<ClipRects> previous_painting_clip_rects_; | |
50 | |
36 std::unique_ptr<FragmentData> next_fragment_; | 51 std::unique_ptr<FragmentData> next_fragment_; |
37 }; | 52 }; |
38 | 53 |
39 } // namespace blink | 54 } // namespace blink |
40 | 55 |
41 #endif // FragmentData_h | 56 #endif // FragmentData_h |
OLD | NEW |