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

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

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

Powered by Google App Engine
This is Rietveld 408576698