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