OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 PaintChunk_h | 5 #ifndef PaintChunk_h |
6 #define PaintChunk_h | 6 #define PaintChunk_h |
7 | 7 |
8 #include "platform/geometry/FloatRect.h" | 8 #include "platform/geometry/FloatRect.h" |
9 #include "platform/graphics/paint/DisplayItem.h" | 9 #include "platform/graphics/paint/DisplayItem.h" |
10 #include "platform/graphics/paint/PaintChunkProperties.h" | 10 #include "platform/graphics/paint/PaintChunkProperties.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
66 // contents, so the id should be stable across document cycles. | 66 // contents, so the id should be stable across document cycles. |
67 // If the contents of the chunk can't be cached (e.g. it's created when Pain tController | 67 // If the contents of the chunk can't be cached (e.g. it's created when Pain tController |
68 // is skipping cache, normally because display items can't be uniquely ident ified), | 68 // is skipping cache, normally because display items can't be uniquely ident ified), |
69 // id is nullopt so that the chunk won't match any other chunk. | 69 // id is nullopt so that the chunk won't match any other chunk. |
70 using Id = DisplayItem::Id; | 70 using Id = DisplayItem::Id; |
71 Optional<Id> id; | 71 Optional<Id> id; |
72 | 72 |
73 // The paint properties which apply to this chunk. | 73 // The paint properties which apply to this chunk. |
74 PaintChunkProperties properties; | 74 PaintChunkProperties properties; |
75 | 75 |
76 // The total bounds of this paint chunk's contents. | 76 // The total bounds of this paint chunk's contents, in coordinate space of |
chrishtr
2016/08/26 18:10:51
nit: "in the coordinate space..."
Also, no need t
Xianzhu
2016/08/26 18:39:23
Done.
| |
77 // the containing GraphicsLayer (SPv1) or the containing transformation node (SPv2). | |
77 FloatRect bounds; | 78 FloatRect bounds; |
78 | 79 |
79 // True if the bounds are filled entirely with opaque contents. | 80 // True if the bounds are filled entirely with opaque contents. |
80 bool knownToBeOpaque; | 81 bool knownToBeOpaque; |
82 | |
83 // SPv2 only. Rectangles that need to be rerasterized in this chunk, in coor dinate | |
chrishtr
2016/08/26 18:10:51
nit: "re-rasterized" "in the coordinate space..."
Xianzhu
2016/08/26 18:39:23
Done.
| |
84 // space of the containing transformation node. | |
85 Vector<FloatRect> rasterInvalidationRects; | |
81 }; | 86 }; |
82 | 87 |
83 inline bool operator==(const PaintChunk& a, const PaintChunk& b) | 88 inline bool operator==(const PaintChunk& a, const PaintChunk& b) |
84 { | 89 { |
85 return a.beginIndex == b.beginIndex | 90 return a.beginIndex == b.beginIndex |
86 && a.endIndex == b.endIndex | 91 && a.endIndex == b.endIndex |
87 && a.id == b.id | 92 && a.id == b.id |
88 && a.properties == b.properties | 93 && a.properties == b.properties |
89 && a.bounds == b.bounds | 94 && a.bounds == b.bounds |
90 && a.knownToBeOpaque == b.knownToBeOpaque; | 95 && a.knownToBeOpaque == b.knownToBeOpaque |
96 && a.rasterInvalidationRects == b.rasterInvalidationRects; | |
91 } | 97 } |
92 | 98 |
93 inline bool operator!=(const PaintChunk& a, const PaintChunk& b) | 99 inline bool operator!=(const PaintChunk& a, const PaintChunk& b) |
94 { | 100 { |
95 return !(a == b); | 101 return !(a == b); |
96 } | 102 } |
97 | 103 |
98 // Redeclared here to avoid ODR issues. | 104 // Redeclared here to avoid ODR issues. |
99 // See platform/testing/PaintPrinters.h. | 105 // See platform/testing/PaintPrinters.h. |
100 void PrintTo(const PaintChunk&, std::ostream*); | 106 void PrintTo(const PaintChunk&, std::ostream*); |
101 | 107 |
102 } // namespace blink | 108 } // namespace blink |
103 | 109 |
104 #endif // PaintChunk_h | 110 #endif // PaintChunk_h |
OLD | NEW |