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

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

Issue 1397583002: Implement the framework for a paint property hierarchy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Job insecurity: better tests, better comments, better names. 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 PaintChunk_h 5 #ifndef PaintChunk_h
6 #define PaintChunk_h 6 #define PaintChunk_h
7 7
8 #include "platform/graphics/paint/PaintProperties.h" 8 #include "platform/graphics/paint/PaintChunkProperties.h"
9 #include <iosfwd> 9 #include <iosfwd>
10 10
11 namespace blink { 11 namespace blink {
12 12
13 // A contiguous sequence of drawings with common paint properties. 13 // A contiguous sequence of drawings with common paint properties.
14 // 14 //
15 // This is expected to be owned by the paint artifact which also owns the 15 // This is expected to be owned by the paint artifact which also owns the
16 // related drawings. 16 // related drawings.
17 // 17 //
18 // This is a Slimming Paint v2 class. 18 // This is a Slimming Paint v2 class.
19 struct PaintChunk { 19 struct PaintChunk {
20 PaintChunk() : beginIndex(0), endIndex(0) { } 20 PaintChunk() : beginIndex(0), endIndex(0) { }
21 PaintChunk(unsigned begin, unsigned end, const PaintProperties& props) 21 PaintChunk(unsigned begin, unsigned end, const PaintChunkProperties& props)
22 : beginIndex(begin), endIndex(end), properties(props) { } 22 : beginIndex(begin), endIndex(end), properties(props) { }
23 23
24 // Index of the first drawing in this chunk. 24 // Index of the first drawing in this chunk.
25 unsigned beginIndex; 25 unsigned beginIndex;
26 26
27 // Index of the first drawing not in this chunk, so that there are 27 // Index of the first drawing not in this chunk, so that there are
28 // |endIndex - beginIndex| drawings in the chunk. 28 // |endIndex - beginIndex| drawings in the chunk.
29 unsigned endIndex; 29 unsigned endIndex;
30 30
31 // The paint properties which apply to this chunk. 31 // The paint properties which apply to this chunk.
32 PaintProperties properties; 32 PaintChunkProperties properties;
33 }; 33 };
34 34
35 inline bool operator==(const PaintChunk& a, const PaintChunk& b) 35 inline bool operator==(const PaintChunk& a, const PaintChunk& b)
36 { 36 {
37 return a.beginIndex == b.beginIndex 37 return a.beginIndex == b.beginIndex
38 && a.endIndex == b.endIndex 38 && a.endIndex == b.endIndex
39 && a.properties == b.properties; 39 && a.properties == b.properties;
40 } 40 }
41 41
42 inline bool operator!=(const PaintChunk& a, const PaintChunk& b) 42 inline bool operator!=(const PaintChunk& a, const PaintChunk& b)
43 { 43 {
44 return !(a == b); 44 return !(a == b);
45 } 45 }
46 46
47 // Redeclared here to avoid ODR issues. 47 // Redeclared here to avoid ODR issues.
48 // See platform/testing/PaintPrinters.h. 48 // See platform/testing/PaintPrinters.h.
49 void PrintTo(const PaintChunk&, std::ostream*); 49 void PrintTo(const PaintChunk&, std::ostream*);
50 50
51 } // namespace blink 51 } // namespace blink
52 52
53 #endif // PaintChunk_h 53 #endif // PaintChunk_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698