OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
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 #include "SkPaint.h" | 8 #include "SkPaint.h" |
9 #include "SkAnnotation.h" | 9 #include "SkAnnotation.h" |
10 #include "SkAutoKern.h" | 10 #include "SkAutoKern.h" |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 && EQUAL(fBitfieldsUInt) | 164 && EQUAL(fBitfieldsUInt) |
165 ; | 165 ; |
166 #undef EQUAL | 166 #undef EQUAL |
167 } | 167 } |
168 | 168 |
169 void SkPaint::reset() { | 169 void SkPaint::reset() { |
170 SkPaint init; | 170 SkPaint init; |
171 *this = init; | 171 *this = init; |
172 } | 172 } |
173 | 173 |
174 void SkPaint::setFilterLevel(FilterLevel level) { | 174 void SkPaint::setFilterQuality(SkFilterQuality quality) { |
175 fBitfields.fFilterLevel = level; | 175 fBitfields.fFilterQuality = quality; |
176 } | 176 } |
177 | 177 |
178 void SkPaint::setHinting(Hinting hintingLevel) { | 178 void SkPaint::setHinting(Hinting hintingLevel) { |
179 fBitfields.fHinting = hintingLevel; | 179 fBitfields.fHinting = hintingLevel; |
180 } | 180 } |
181 | 181 |
182 void SkPaint::setFlags(uint32_t flags) { | 182 void SkPaint::setFlags(uint32_t flags) { |
183 fBitfields.fFlags = flags; | 183 fBitfields.fFlags = flags; |
184 } | 184 } |
185 | 185 |
(...skipping 2197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2383 } | 2383 } |
2384 | 2384 |
2385 uint32_t SkPaint::getHash() const { | 2385 uint32_t SkPaint::getHash() const { |
2386 // We're going to hash 10 pointers and 7 32-bit values, finishing up with fB
itfields, | 2386 // We're going to hash 10 pointers and 7 32-bit values, finishing up with fB
itfields, |
2387 // so fBitfields should be 10 pointers and 6 32-bit values from the start. | 2387 // so fBitfields should be 10 pointers and 6 32-bit values from the start. |
2388 SK_COMPILE_ASSERT(offsetof(SkPaint, fBitfields) == 10 * sizeof(void*) + 6 *
sizeof(uint32_t), | 2388 SK_COMPILE_ASSERT(offsetof(SkPaint, fBitfields) == 10 * sizeof(void*) + 6 *
sizeof(uint32_t), |
2389 SkPaint_notPackedTightly); | 2389 SkPaint_notPackedTightly); |
2390 return SkChecksum::Murmur3(reinterpret_cast<const uint32_t*>(this), | 2390 return SkChecksum::Murmur3(reinterpret_cast<const uint32_t*>(this), |
2391 offsetof(SkPaint, fBitfields) + sizeof(fBitfields
)); | 2391 offsetof(SkPaint, fBitfields) + sizeof(fBitfields
)); |
2392 } | 2392 } |
OLD | NEW |