OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef FragmentData_h |
| 6 #define FragmentData_h |
| 7 |
| 8 #include "core/paint/ObjectPaintProperties.h" |
| 9 |
| 10 namespace blink { |
| 11 |
| 12 class ObjectPaintProperties; |
| 13 |
| 14 // Represents the data for a particular fragment of a LayoutObject. |
| 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. |
| 17 // See README.md. |
| 18 class FragmentData { |
| 19 public: |
| 20 static std::unique_ptr<FragmentData> Create() { |
| 21 return WTF::WrapUnique(new FragmentData()); |
| 22 } |
| 23 |
| 24 ObjectPaintProperties* PaintProperties() const { |
| 25 return paint_properties_.get(); |
| 26 } |
| 27 ObjectPaintProperties& EnsurePaintProperties(); |
| 28 void ClearPaintProperties(); |
| 29 |
| 30 FragmentData* NextFragment() { return next_fragment_.get(); } |
| 31 |
| 32 private: |
| 33 // Holds references to the paint property nodes created by this object. |
| 34 std::unique_ptr<ObjectPaintProperties> paint_properties_; |
| 35 |
| 36 std::unique_ptr<FragmentData> next_fragment_; |
| 37 }; |
| 38 |
| 39 } // namespace blink |
| 40 |
| 41 #endif // FragmentData_h |
OLD | NEW |