| 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 2295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2306 | 2306 |
| 2307 if (fPaint.getPathEffect() == NULL && !has_thick_frame(fPaint)) { | 2307 if (fPaint.getPathEffect() == NULL && !has_thick_frame(fPaint)) { |
| 2308 applyStrokeAndPathEffects = false; | 2308 applyStrokeAndPathEffects = false; |
| 2309 } | 2309 } |
| 2310 | 2310 |
| 2311 // can't use our canonical size if we need to apply patheffects | 2311 // can't use our canonical size if we need to apply patheffects |
| 2312 if (fPaint.getPathEffect() == NULL) { | 2312 if (fPaint.getPathEffect() == NULL) { |
| 2313 fPaint.setTextSize(SkIntToScalar(SkPaint::kCanonicalTextSizeForPaths)); | 2313 fPaint.setTextSize(SkIntToScalar(SkPaint::kCanonicalTextSizeForPaths)); |
| 2314 fScale = paint.getTextSize() / SkPaint::kCanonicalTextSizeForPaths; | 2314 fScale = paint.getTextSize() / SkPaint::kCanonicalTextSizeForPaths; |
| 2315 if (has_thick_frame(fPaint)) { | 2315 if (has_thick_frame(fPaint)) { |
| 2316 fPaint.setStrokeWidth(SkScalarDiv(fPaint.getStrokeWidth(), fScale)); | 2316 fPaint.setStrokeWidth(fPaint.getStrokeWidth() / fScale); |
| 2317 } | 2317 } |
| 2318 } else { | 2318 } else { |
| 2319 fScale = SK_Scalar1; | 2319 fScale = SK_Scalar1; |
| 2320 } | 2320 } |
| 2321 | 2321 |
| 2322 if (!applyStrokeAndPathEffects) { | 2322 if (!applyStrokeAndPathEffects) { |
| 2323 fPaint.setStyle(SkPaint::kFill_Style); | 2323 fPaint.setStyle(SkPaint::kFill_Style); |
| 2324 fPaint.setPathEffect(NULL); | 2324 fPaint.setPathEffect(NULL); |
| 2325 } | 2325 } |
| 2326 | 2326 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2426 } | 2426 } |
| 2427 | 2427 |
| 2428 uint32_t SkPaint::getHash() const { | 2428 uint32_t SkPaint::getHash() const { |
| 2429 // We're going to hash 10 pointers and 7 32-bit values, finishing up with fB
itfields, | 2429 // 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. | 2430 // 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), | 2431 SK_COMPILE_ASSERT(offsetof(SkPaint, fBitfields) == 10 * sizeof(void*) + 6 *
sizeof(uint32_t), |
| 2432 SkPaint_notPackedTightly); | 2432 SkPaint_notPackedTightly); |
| 2433 return SkChecksum::Murmur3(reinterpret_cast<const uint32_t*>(this), | 2433 return SkChecksum::Murmur3(reinterpret_cast<const uint32_t*>(this), |
| 2434 offsetof(SkPaint, fBitfields) + sizeof(fBitfields
)); | 2434 offsetof(SkPaint, fBitfields) + sizeof(fBitfields
)); |
| 2435 } | 2435 } |
| OLD | NEW |