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 PaintChunkProperties_h | 5 #ifndef PaintChunkProperties_h |
6 #define PaintChunkProperties_h | 6 #define PaintChunkProperties_h |
7 | 7 |
8 #include "platform/graphics/paint/ClipPaintPropertyNode.h" | 8 #include "platform/graphics/paint/ClipPaintPropertyNode.h" |
9 #include "platform/graphics/paint/EffectPaintPropertyNode.h" | 9 #include "platform/graphics/paint/EffectPaintPropertyNode.h" |
| 10 #include "platform/graphics/paint/ScrollPaintPropertyNode.h" |
10 #include "platform/graphics/paint/TransformPaintPropertyNode.h" | 11 #include "platform/graphics/paint/TransformPaintPropertyNode.h" |
11 #include "wtf/Allocator.h" | 12 #include "wtf/Allocator.h" |
12 #include "wtf/Noncopyable.h" | 13 #include "wtf/Noncopyable.h" |
13 #include <iosfwd> | 14 #include <iosfwd> |
14 | 15 |
15 namespace blink { | 16 namespace blink { |
16 | 17 |
17 // The set of paint properties applying to a |PaintChunk|. These properties are | 18 // The set of paint properties applying to a |PaintChunk|. These properties are |
18 // not local-only paint style parameters such as color, but instead represent | 19 // not local-only paint style parameters such as color, but instead represent |
19 // the hierarchy of transforms, clips, effects, etc, that apply to a contiguous | 20 // the hierarchy of transforms, clips, effects, etc, that apply to a contiguous |
20 // chunk of display items. A single DisplayItemClient can generate multiple | 21 // chunk of display items. A single DisplayItemClient can generate multiple |
21 // properties of the same type and this struct represents the total state of all | 22 // properties of the same type and this struct represents the total state of all |
22 // properties for a given |PaintChunk|. | 23 // properties for a given |PaintChunk|. |
23 // | 24 // |
24 // This differs from |ObjectPaintProperties| because it only stores one property | 25 // This differs from |ObjectPaintProperties| because it only stores one property |
25 // for each type (e.g., either transform or perspective, but not both). | 26 // for each type (e.g., either transform or perspective, but not both). |
26 struct PaintChunkProperties { | 27 struct PaintChunkProperties { |
27 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); | 28 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); |
28 | 29 |
29 PaintChunkProperties() : backfaceHidden(false) { } | 30 PaintChunkProperties() : backfaceHidden(false) { } |
30 | 31 |
31 // TODO(pdr): Add scroll properties. | |
32 RefPtr<const TransformPaintPropertyNode> transform; | 32 RefPtr<const TransformPaintPropertyNode> transform; |
33 RefPtr<const ClipPaintPropertyNode> clip; | 33 RefPtr<const ClipPaintPropertyNode> clip; |
34 RefPtr<const EffectPaintPropertyNode> effect; | 34 RefPtr<const EffectPaintPropertyNode> effect; |
| 35 RefPtr<const ScrollPaintPropertyNode> scroll; |
35 bool backfaceHidden; | 36 bool backfaceHidden; |
36 }; | 37 }; |
37 | 38 |
38 // Equality is based only on the pointers and is not 'deep' which would require | 39 // Equality is based only on the pointers and is not 'deep' which would require |
39 // crawling the entire property tree to compute. | 40 // crawling the entire property tree to compute. |
40 inline bool operator==(const PaintChunkProperties& a, const PaintChunkProperties
& b) | 41 inline bool operator==(const PaintChunkProperties& a, const PaintChunkProperties
& b) |
41 { | 42 { |
42 return a.transform.get() == b.transform.get() | 43 return a.transform.get() == b.transform.get() |
43 && a.clip.get() == b.clip.get() | 44 && a.clip.get() == b.clip.get() |
44 && a.effect.get() == b.effect.get() | 45 && a.effect.get() == b.effect.get() |
| 46 && a.scroll.get() == b.scroll.get() |
45 && a.backfaceHidden == b.backfaceHidden; | 47 && a.backfaceHidden == b.backfaceHidden; |
46 } | 48 } |
47 | 49 |
48 inline bool operator!=(const PaintChunkProperties& a, const PaintChunkProperties
& b) | 50 inline bool operator!=(const PaintChunkProperties& a, const PaintChunkProperties
& b) |
49 { | 51 { |
50 return !(a == b); | 52 return !(a == b); |
51 } | 53 } |
52 | 54 |
53 // Redeclared here to avoid ODR issues. | 55 // Redeclared here to avoid ODR issues. |
54 // See platform/testing/PaintPrinters.h. | 56 // See platform/testing/PaintPrinters.h. |
55 void PrintTo(const PaintChunkProperties&, std::ostream*); | 57 void PrintTo(const PaintChunkProperties&, std::ostream*); |
56 | 58 |
57 } // namespace blink | 59 } // namespace blink |
58 | 60 |
59 #endif // PaintChunkProperties_h | 61 #endif // PaintChunkProperties_h |
OLD | NEW |