OLD | NEW |
---|---|
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #ifndef SkBitSet_DEFINED | 10 #ifndef SkBitSet_DEFINED |
11 #define SkBitSet_DEFINED | 11 #define SkBitSet_DEFINED |
12 | 12 |
13 #include "SkTypes.h" | 13 #include "SkTypes.h" |
14 #include "SkTDArray.h" | 14 #include "SkTDArray.h" |
15 | 15 |
16 class SkBitSet { | 16 class SkBitSet { |
17 public: | 17 public: |
18 /** NumberOfBits must be greater than zero. | 18 /** NumberOfBits must be greater than zero. |
19 */ | 19 */ |
20 explicit SkBitSet(int numberOfBits); | 20 explicit SkBitSet(int numberOfBits); |
21 explicit SkBitSet(const SkBitSet& source); | 21 explicit SkBitSet(const SkBitSet& source); |
22 | 22 |
23 const SkBitSet& operator=(const SkBitSet& rhs); | 23 SkBitSet& operator=(const SkBitSet& rhs); |
reed1
2013/03/28 13:34:46
that's a funny mistake.
| |
24 bool operator==(const SkBitSet& rhs); | 24 bool operator==(const SkBitSet& rhs); |
25 bool operator!=(const SkBitSet& rhs); | 25 bool operator!=(const SkBitSet& rhs); |
26 | 26 |
27 /** Clear all data. | 27 /** Clear all data. |
28 */ | 28 */ |
29 void clearAll(); | 29 void clearAll(); |
30 | 30 |
31 /** Set the value of the index-th bit. | 31 /** Set the value of the index-th bit. |
32 */ | 32 */ |
33 void setBit(int index, bool value); | 33 void setBit(int index, bool value); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
69 uint32_t* internalGet(int index) const { | 69 uint32_t* internalGet(int index) const { |
70 SkASSERT((size_t)index < fBitCount); | 70 SkASSERT((size_t)index < fBitCount); |
71 size_t internalIndex = index / 32; | 71 size_t internalIndex = index / 32; |
72 SkASSERT(internalIndex < fDwordCount); | 72 SkASSERT(internalIndex < fDwordCount); |
73 return reinterpret_cast<uint32_t*>(fBitData.get()) + internalIndex; | 73 return reinterpret_cast<uint32_t*>(fBitData.get()) + internalIndex; |
74 } | 74 } |
75 }; | 75 }; |
76 | 76 |
77 | 77 |
78 #endif | 78 #endif |
OLD | NEW |