OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef GrWindowRectangles_DEFINED | 8 #ifndef GrWindowRectangles_DEFINED |
9 #define GrWindowRectangles_DEFINED | 9 #define GrWindowRectangles_DEFINED |
10 | 10 |
11 #include "GrNonAtomicRef.h" | 11 #include "GrNonAtomicRef.h" |
12 #include "SkRect.h" | 12 #include "SkRect.h" |
13 | 13 |
14 class GrWindowRectangles { | 14 class GrWindowRectangles { |
15 public: | 15 public: |
16 constexpr static int kMaxWindows = 8; | 16 constexpr static int kMaxWindows = 16; |
17 | 17 |
18 enum class Mode : bool { | 18 enum class Mode : bool { |
19 kExclusive, | 19 kExclusive, |
20 kInclusive | 20 kInclusive |
21 }; | 21 }; |
22 | 22 |
23 GrWindowRectangles(Mode mode = Mode::kExclusive) : fMode(mode), fCount(0) {} | 23 GrWindowRectangles(Mode mode = Mode::kExclusive) : fMode(mode), fCount(0) {} |
24 GrWindowRectangles(const GrWindowRectangles& that) : fCount(0) { *this = tha
t; } | 24 GrWindowRectangles(const GrWindowRectangles& that) : fCount(0) { *this = tha
t; } |
25 ~GrWindowRectangles() { SkSafeUnref(this->rec()); } | 25 ~GrWindowRectangles() { SkSafeUnref(this->rec()); } |
26 | 26 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 if (fMode != that.fMode || fCount != that.fCount) { | 101 if (fMode != that.fMode || fCount != that.fCount) { |
102 return false; | 102 return false; |
103 } | 103 } |
104 if (fCount > kNumLocalWindows && fRec == that.fRec) { | 104 if (fCount > kNumLocalWindows && fRec == that.fRec) { |
105 return true; | 105 return true; |
106 } | 106 } |
107 return !fCount || !memcmp(this->data(), that.data(), sizeof(SkIRect) * fCoun
t); | 107 return !fCount || !memcmp(this->data(), that.data(), sizeof(SkIRect) * fCoun
t); |
108 } | 108 } |
109 | 109 |
110 #endif | 110 #endif |
OLD | NEW |