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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 } | 222 } |
223 | 223 |
224 void SkPaint::setFakeBoldText(bool doFakeBold) { | 224 void SkPaint::setFakeBoldText(bool doFakeBold) { |
225 this->setFlags(SkSetClearMask(fBitfields.fFlags, doFakeBold, kFakeBoldText_F
lag)); | 225 this->setFlags(SkSetClearMask(fBitfields.fFlags, doFakeBold, kFakeBoldText_F
lag)); |
226 } | 226 } |
227 | 227 |
228 void SkPaint::setDevKernText(bool doDevKern) { | 228 void SkPaint::setDevKernText(bool doDevKern) { |
229 this->setFlags(SkSetClearMask(fBitfields.fFlags, doDevKern, kDevKernText_Fla
g)); | 229 this->setFlags(SkSetClearMask(fBitfields.fFlags, doDevKern, kDevKernText_Fla
g)); |
230 } | 230 } |
231 | 231 |
232 void SkPaint::setDistanceFieldTextTEMP(bool doDistanceFieldText) { | |
233 this->setFlags(SkSetClearMask(fBitfields.fFlags, doDistanceFieldText, kDista
nceFieldTextTEMP_Flag)); | |
234 } | |
235 | |
236 void SkPaint::setStyle(Style style) { | 232 void SkPaint::setStyle(Style style) { |
237 if ((unsigned)style < kStyleCount) { | 233 if ((unsigned)style < kStyleCount) { |
238 fBitfields.fStyle = style; | 234 fBitfields.fStyle = style; |
239 } else { | 235 } else { |
240 #ifdef SK_REPORT_API_RANGE_CHECK | 236 #ifdef SK_REPORT_API_RANGE_CHECK |
241 SkDebugf("SkPaint::setStyle(%d) out of range\n", style); | 237 SkDebugf("SkPaint::setStyle(%d) out of range\n", style); |
242 #endif | 238 #endif |
243 } | 239 } |
244 } | 240 } |
245 | 241 |
(...skipping 2180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2426 } | 2422 } |
2427 | 2423 |
2428 uint32_t SkPaint::getHash() const { | 2424 uint32_t SkPaint::getHash() const { |
2429 // We're going to hash 10 pointers and 7 32-bit values, finishing up with fB
itfields, | 2425 // We're going to hash 10 pointers and 7 32-bit values, finishing up with fB
itfields, |
2430 // so fBitfields should be 10 pointers and 6 32-bit values from the start. | 2426 // so fBitfields should be 10 pointers and 6 32-bit values from the start. |
2431 SK_COMPILE_ASSERT(offsetof(SkPaint, fBitfields) == 10 * sizeof(void*) + 6 *
sizeof(uint32_t), | 2427 SK_COMPILE_ASSERT(offsetof(SkPaint, fBitfields) == 10 * sizeof(void*) + 6 *
sizeof(uint32_t), |
2432 SkPaint_notPackedTightly); | 2428 SkPaint_notPackedTightly); |
2433 return SkChecksum::Murmur3(reinterpret_cast<const uint32_t*>(this), | 2429 return SkChecksum::Murmur3(reinterpret_cast<const uint32_t*>(this), |
2434 offsetof(SkPaint, fBitfields) + sizeof(fBitfields
)); | 2430 offsetof(SkPaint, fBitfields) + sizeof(fBitfields
)); |
2435 } | 2431 } |
OLD | NEW |