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

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

Issue 1390933003: Implement the framework for the paint property hierarchy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 PaintProperties_h 5 #ifndef PaintProperties_h
6 #define PaintProperties_h 6 #define PaintProperties_h
7 7
8 #include "platform/graphics/paint/TransformPaintProperty.h"
9
8 #include <iosfwd> 10 #include <iosfwd>
9 11
10 namespace blink { 12 namespace blink {
11 13
12 // The set of paint properties applying to a |PaintChunk|. 14 // The set of paint properties applying to a |PaintChunk|. These properties are
13 // In particular, this does not mean properties like background-color, but 15 // not simple color changes but instead represent the hierachy of transforms,
14 // rather the hierarchy of transforms, clips, effects, etc. that apply to a 16 // clips, effects, etc, that apply to a contiguous chunk of display items.
15 // contiguous chunk of drawings. 17 // A single DisplayItemClient can generate multiple properties of the same type
18 // and this struct represents the total state of all properties for a given
19 // |PaintChunk|.
16 struct PaintProperties { 20 struct PaintProperties {
17 // TODO(jbroman): Add actual properties. 21 // TODO(pdr): Add clip, scroll, and effect properties.
22 RefPtr<TransformPaintProperty> transform;
18 }; 23 };
19 24
20 inline bool operator==(const PaintProperties&, const PaintProperties&) 25 inline bool operator==(const PaintProperties& a, const PaintProperties& b)
21 { 26 {
22 return true; 27 return a.transform.get() == b.transform.get();
23 } 28 }
24 29
25 inline bool operator!=(const PaintProperties& a, const PaintProperties& b) 30 inline bool operator!=(const PaintProperties& a, const PaintProperties& b)
26 { 31 {
27 return !(a == b); 32 return !(a == b);
28 } 33 }
29 34
30 // Redeclared here to avoid ODR issues. 35 // Redeclared here to avoid ODR issues.
31 // See platform/testing/PaintPrinters.h. 36 // See platform/testing/PaintPrinters.h.
32 void PrintTo(const PaintProperties&, std::ostream*); 37 void PrintTo(const PaintProperties&, std::ostream*);
33 38
34 } // namespace blink 39 } // namespace blink
35 40
36 #endif // PaintProperties_h 41 #endif // PaintProperties_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698