OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 | 8 |
9 #ifndef SkBitSet_DEFINED | 9 #ifndef SkBitSet_DEFINED |
10 #define SkBitSet_DEFINED | 10 #define SkBitSet_DEFINED |
11 | 11 |
12 #include "SkTypes.h" | 12 #include "SkTypes.h" |
13 #include "SkTDArray.h" | 13 #include "SkTDArray.h" |
14 | 14 |
15 class SkBitSet { | 15 class SkBitSet { |
16 public: | 16 public: |
17 /** NumberOfBits must be greater than zero. | 17 /** NumberOfBits must be greater than zero. |
18 */ | 18 */ |
19 explicit SkBitSet(int numberOfBits); | 19 explicit SkBitSet(int numberOfBits); |
20 explicit SkBitSet(const SkBitSet& source); | 20 explicit SkBitSet(const SkBitSet& source); |
| 21 explicit SkBitSet(SkBitSet&&); |
21 | 22 |
22 SkBitSet& operator=(const SkBitSet& rhs); | 23 SkBitSet& operator=(const SkBitSet& rhs); |
23 bool operator==(const SkBitSet& rhs); | 24 bool operator==(const SkBitSet& rhs); |
24 bool operator!=(const SkBitSet& rhs); | 25 bool operator!=(const SkBitSet& rhs); |
25 | 26 |
26 /** Clear all data. | 27 /** Clear all data. |
27 */ | 28 */ |
28 void clearAll(); | 29 void clearAll(); |
29 | 30 |
30 /** Set the value of the index-th bit. | 31 /** Set the value of the index-th bit. |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 uint32_t* internalGet(int index) const { | 80 uint32_t* internalGet(int index) const { |
80 SkASSERT((size_t)index < fBitCount); | 81 SkASSERT((size_t)index < fBitCount); |
81 size_t internalIndex = index / 32; | 82 size_t internalIndex = index / 32; |
82 SkASSERT(internalIndex < fDwordCount); | 83 SkASSERT(internalIndex < fDwordCount); |
83 return reinterpret_cast<uint32_t*>(fBitData.get()) + internalIndex; | 84 return reinterpret_cast<uint32_t*>(fBitData.get()) + internalIndex; |
84 } | 85 } |
85 }; | 86 }; |
86 | 87 |
87 | 88 |
88 #endif | 89 #endif |
OLD | NEW |