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 "SkAutoKern.h" | 9 #include "SkAutoKern.h" |
10 #include "SkChecksum.h" | 10 #include "SkChecksum.h" |
(...skipping 1439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1450 typeface->onFilterRec(rec); | 1450 typeface->onFilterRec(rec); |
1451 | 1451 |
1452 // be sure to call PostMakeRec(rec) before you actually use it! | 1452 // be sure to call PostMakeRec(rec) before you actually use it! |
1453 } | 1453 } |
1454 | 1454 |
1455 /** | 1455 /** |
1456 * In order to call cachedDeviceLuminance, cachedPaintLuminance, or | 1456 * In order to call cachedDeviceLuminance, cachedPaintLuminance, or |
1457 * cachedMaskGamma the caller must hold the gMaskGammaCacheMutex and continue | 1457 * cachedMaskGamma the caller must hold the gMaskGammaCacheMutex and continue |
1458 * to hold it until the returned pointer is refed or forgotten. | 1458 * to hold it until the returned pointer is refed or forgotten. |
1459 */ | 1459 */ |
1460 SK_DECLARE_STATIC_MUTEX(gMaskGammaCacheMutex); | 1460 static SkMutex gMaskGammaCacheMutex; |
1461 | 1461 |
1462 static SkMaskGamma* gLinearMaskGamma = nullptr; | 1462 static SkMaskGamma* gLinearMaskGamma = nullptr; |
1463 static SkMaskGamma* gMaskGamma = nullptr; | 1463 static SkMaskGamma* gMaskGamma = nullptr; |
1464 static SkScalar gContrast = SK_ScalarMin; | 1464 static SkScalar gContrast = SK_ScalarMin; |
1465 static SkScalar gPaintGamma = SK_ScalarMin; | 1465 static SkScalar gPaintGamma = SK_ScalarMin; |
1466 static SkScalar gDeviceGamma = SK_ScalarMin; | 1466 static SkScalar gDeviceGamma = SK_ScalarMin; |
1467 /** | 1467 /** |
1468 * The caller must hold the gMaskGammaCacheMutex and continue to hold it until | 1468 * The caller must hold the gMaskGammaCacheMutex and continue to hold it until |
1469 * the returned SkMaskGamma pointer is refed or forgotten. | 1469 * the returned SkMaskGamma pointer is refed or forgotten. |
1470 */ | 1470 */ |
(...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2320 } | 2320 } |
2321 | 2321 |
2322 uint32_t SkPaint::getHash() const { | 2322 uint32_t SkPaint::getHash() const { |
2323 // We're going to hash 10 pointers and 7 32-bit values, finishing up with fB
itfields, | 2323 // We're going to hash 10 pointers and 7 32-bit values, finishing up with fB
itfields, |
2324 // so fBitfields should be 10 pointers and 6 32-bit values from the start. | 2324 // so fBitfields should be 10 pointers and 6 32-bit values from the start. |
2325 static_assert(offsetof(SkPaint, fBitfields) == 9 * sizeof(void*) + 6 * sizeo
f(uint32_t), | 2325 static_assert(offsetof(SkPaint, fBitfields) == 9 * sizeof(void*) + 6 * sizeo
f(uint32_t), |
2326 "SkPaint_notPackedTightly"); | 2326 "SkPaint_notPackedTightly"); |
2327 return SkChecksum::Murmur3(reinterpret_cast<const uint32_t*>(this), | 2327 return SkChecksum::Murmur3(reinterpret_cast<const uint32_t*>(this), |
2328 offsetof(SkPaint, fBitfields) + sizeof(fBitfields
)); | 2328 offsetof(SkPaint, fBitfields) + sizeof(fBitfields
)); |
2329 } | 2329 } |
OLD | NEW |