Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(312)

Side by Side Diff: third_party/WebKit/Source/platform/graphics/paint/PaintChunkProperties.h

Issue 1497683002: Make platform/graphics to use USING_FAST_MALLOC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 11 #include "wtf/Allocator.h"
12 #include "wtf/Noncopyable.h"
12 #include <iosfwd> 13 #include <iosfwd>
13 14
14 namespace blink { 15 namespace blink {
15 16
16 // 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
17 // 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
18 // 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
19 // chunk of display items. A single DisplayItemClient can generate multiple 20 // chunk of display items. A single DisplayItemClient can generate multiple
20 // 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
21 // properties for a given |PaintChunk|. 22 // properties for a given |PaintChunk|.
22 // 23 //
23 // This differs from |ObjectPaintProperties| because it only stores one property 24 // This differs from |ObjectPaintProperties| because it only stores one property
24 // 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).
25 struct PaintChunkProperties { 26 struct PaintChunkProperties {
27 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW();
26 // TODO(pdr): Add clip and scroll properties. 28 // TODO(pdr): Add clip and scroll properties.
27 RefPtr<TransformPaintPropertyNode> transform; 29 RefPtr<TransformPaintPropertyNode> transform;
28 RefPtr<ClipPaintPropertyNode> clip; 30 RefPtr<ClipPaintPropertyNode> clip;
29 RefPtr<EffectPaintPropertyNode> effect; 31 RefPtr<EffectPaintPropertyNode> effect;
30 }; 32 };
31 33
32 // Equality is based only on the pointers and is not 'deep' which would require 34 // Equality is based only on the pointers and is not 'deep' which would require
33 // crawling the entire property tree to compute. 35 // crawling the entire property tree to compute.
34 inline bool operator==(const PaintChunkProperties& a, const PaintChunkProperties & b) 36 inline bool operator==(const PaintChunkProperties& a, const PaintChunkProperties & b)
35 { 37 {
36 return a.transform.get() == b.transform.get() 38 return a.transform.get() == b.transform.get()
37 && a.clip.get() == b.clip.get() 39 && a.clip.get() == b.clip.get()
38 && a.effect.get() == b.effect.get(); 40 && a.effect.get() == b.effect.get();
39 } 41 }
40 42
41 inline bool operator!=(const PaintChunkProperties& a, const PaintChunkProperties & b) 43 inline bool operator!=(const PaintChunkProperties& a, const PaintChunkProperties & b)
42 { 44 {
43 return !(a == b); 45 return !(a == b);
44 } 46 }
45 47
46 // Redeclared here to avoid ODR issues. 48 // Redeclared here to avoid ODR issues.
47 // See platform/testing/PaintPrinters.h. 49 // See platform/testing/PaintPrinters.h.
48 void PrintTo(const PaintChunkProperties&, std::ostream*); 50 void PrintTo(const PaintChunkProperties&, std::ostream*);
49 51
50 } // namespace blink 52 } // namespace blink
51 53
52 #endif // PaintChunkProperties_h 54 #endif // PaintChunkProperties_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698