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

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

Issue 2390443002: Unify GeometryPropertyTreeState and PropertyTreeState (Closed)
Patch Set: rebase x2 Created 4 years, 2 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/ScrollPaintPropertyNode.h" 10 #include "platform/graphics/paint/ScrollPaintPropertyNode.h"
(...skipping 11 matching lines...) Expand all
22 // 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
23 // properties for a given |PaintChunk|. 23 // properties for a given |PaintChunk|.
24 // 24 //
25 // This differs from |ObjectPaintProperties| because it only stores one property 25 // This differs from |ObjectPaintProperties| because it only stores one property
26 // 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).
27 struct PaintChunkProperties { 27 struct PaintChunkProperties {
28 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); 28 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW();
29 29
30 PaintChunkProperties() : backfaceHidden(false) {} 30 PaintChunkProperties() : backfaceHidden(false) {}
31 31
32 // TODO(pdr): Refactor these to use PropertyTreeState.
32 RefPtr<const TransformPaintPropertyNode> transform; 33 RefPtr<const TransformPaintPropertyNode> transform;
33 RefPtr<const ClipPaintPropertyNode> clip; 34 RefPtr<const ClipPaintPropertyNode> clip;
34 RefPtr<const EffectPaintPropertyNode> effect; 35 RefPtr<const EffectPaintPropertyNode> effect;
35 RefPtr<const ScrollPaintPropertyNode> scroll; 36 RefPtr<const ScrollPaintPropertyNode> scroll;
36 bool backfaceHidden; 37 bool backfaceHidden;
37 }; 38 };
38 39
39 // Equality is based only on the pointers and is not 'deep' which would require 40 // Equality is based only on the pointers and is not 'deep' which would require
40 // crawling the entire property tree to compute. 41 // crawling the entire property tree to compute.
41 inline bool operator==(const PaintChunkProperties& a, 42 inline bool operator==(const PaintChunkProperties& a,
42 const PaintChunkProperties& b) { 43 const PaintChunkProperties& b) {
43 return a.transform.get() == b.transform.get() && 44 return a.transform.get() == b.transform.get() &&
44 a.clip.get() == b.clip.get() && a.effect.get() == b.effect.get() && 45 a.clip.get() == b.clip.get() && a.effect.get() == b.effect.get() &&
45 a.scroll.get() == b.scroll.get() && 46 a.scroll.get() == b.scroll.get() &&
46 a.backfaceHidden == b.backfaceHidden; 47 a.backfaceHidden == b.backfaceHidden;
47 } 48 }
48 49
49 inline bool operator!=(const PaintChunkProperties& a, 50 inline bool operator!=(const PaintChunkProperties& a,
50 const PaintChunkProperties& b) { 51 const PaintChunkProperties& b) {
51 return !(a == b); 52 return !(a == b);
52 } 53 }
53 54
54 // Redeclared here to avoid ODR issues. 55 // Redeclared here to avoid ODR issues.
55 // See platform/testing/PaintPrinters.h. 56 // See platform/testing/PaintPrinters.h.
56 void PrintTo(const PaintChunkProperties&, std::ostream*); 57 void PrintTo(const PaintChunkProperties&, std::ostream*);
57 58
58 } // namespace blink 59 } // namespace blink
59 60
60 #endif // PaintChunkProperties_h 61 #endif // PaintChunkProperties_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698