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

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

Issue 2173363002: Improve code readibility of PaintPropertyTreeBuilder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove extra "const" (might be a typo) Created 4 years, 4 months 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"
(...skipping 11 matching lines...) Expand 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 28
29 PaintChunkProperties() : backfaceHidden(false) { } 29 PaintChunkProperties() : backfaceHidden(false) { }
30 30
31 // TODO(pdr): Add scroll properties. 31 // TODO(pdr): Add scroll properties.
32 RefPtr<TransformPaintPropertyNode> transform; 32 RefPtr<const TransformPaintPropertyNode> transform;
33 RefPtr<ClipPaintPropertyNode> clip; 33 RefPtr<const ClipPaintPropertyNode> clip;
34 RefPtr<EffectPaintPropertyNode> effect; 34 RefPtr<const EffectPaintPropertyNode> effect;
35 bool backfaceHidden; 35 bool backfaceHidden;
36 }; 36 };
37 37
38 // Equality is based only on the pointers and is not 'deep' which would require 38 // Equality is based only on the pointers and is not 'deep' which would require
39 // crawling the entire property tree to compute. 39 // crawling the entire property tree to compute.
40 inline bool operator==(const PaintChunkProperties& a, const PaintChunkProperties & b) 40 inline bool operator==(const PaintChunkProperties& a, const PaintChunkProperties & b)
41 { 41 {
42 return a.transform.get() == b.transform.get() 42 return a.transform.get() == b.transform.get()
43 && a.clip.get() == b.clip.get() 43 && a.clip.get() == b.clip.get()
44 && a.effect.get() == b.effect.get() 44 && a.effect.get() == b.effect.get()
45 && a.backfaceHidden == b.backfaceHidden; 45 && a.backfaceHidden == b.backfaceHidden;
46 } 46 }
47 47
48 inline bool operator!=(const PaintChunkProperties& a, const PaintChunkProperties & b) 48 inline bool operator!=(const PaintChunkProperties& a, const PaintChunkProperties & b)
49 { 49 {
50 return !(a == b); 50 return !(a == b);
51 } 51 }
52 52
53 // Redeclared here to avoid ODR issues. 53 // Redeclared here to avoid ODR issues.
54 // See platform/testing/PaintPrinters.h. 54 // See platform/testing/PaintPrinters.h.
55 void PrintTo(const PaintChunkProperties&, std::ostream*); 55 void PrintTo(const PaintChunkProperties&, std::ostream*);
56 56
57 } // namespace blink 57 } // namespace blink
58 58
59 #endif // PaintChunkProperties_h 59 #endif // PaintChunkProperties_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698