OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef PaintChunk_h | |
6 #define PaintChunk_h | |
7 | |
8 #include "platform/graphics/paint/PaintProperties.h" | |
9 #include <iosfwd> | |
10 | |
11 namespace blink { | |
12 | |
13 // A contiguous sequence of drawings with common paint properties. | |
14 // | |
15 // This is expected to be owned by the paint artifact which also owns the | |
pdr.
2015/10/01 00:32:48
May want to update this, depending on the discussi
jbroman
2015/10/01 18:04:20
?
| |
16 // related drawings. | |
17 // | |
18 // This is a Slimming Paint v2 class. | |
pdr.
2015/10/01 00:32:48
Lets replace this with proof in the form of an ass
jbroman
2015/10/01 18:04:20
It seems weird to have a data object asserting the
| |
19 struct PaintChunk { | |
20 PaintChunk() : beginIndex(0), endIndex(0) { } | |
21 PaintChunk(unsigned begin, unsigned end, const PaintProperties& props) | |
22 : beginIndex(begin), endIndex(end), properties(props) { } | |
23 | |
24 // Index of the first drawing in this chunk. | |
25 unsigned beginIndex; | |
26 | |
27 // Index of the first drawing not in this chunk, so that there are | |
28 // |endIndex - beginIndex| drawings in the chunk. | |
29 unsigned endIndex; | |
30 | |
31 // The paint properties which apply to this chunk. | |
32 PaintProperties properties; | |
33 }; | |
34 | |
35 inline bool operator==(const PaintChunk& a, const PaintChunk& b) | |
36 { | |
37 return a.beginIndex == b.beginIndex | |
38 && a.endIndex == b.endIndex | |
39 && a.properties == b.properties; | |
40 } | |
41 | |
42 inline bool operator!=(const PaintChunk& a, const PaintChunk& b) | |
43 { | |
44 return !(a == b); | |
45 } | |
46 | |
47 // Redeclared here to avoid ODR issues. | |
48 // See platform/testing/PaintPrinters.h. | |
49 void PrintTo(const PaintChunk&, std::ostream*); | |
50 | |
51 } // namespace blink | |
52 | |
53 #endif // PaintChunk_h | |
OLD | NEW |