| 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 2066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2077 | 2077 |
| 2078 #ifndef SK_IGNORE_TO_STRING | 2078 #ifndef SK_IGNORE_TO_STRING |
| 2079 | 2079 |
| 2080 void SkPaint::toString(SkString* str) const { | 2080 void SkPaint::toString(SkString* str) const { |
| 2081 str->append("<dl><dt>SkPaint:</dt><dd><dl>"); | 2081 str->append("<dl><dt>SkPaint:</dt><dd><dl>"); |
| 2082 | 2082 |
| 2083 SkTypeface* typeface = this->getTypeface(); | 2083 SkTypeface* typeface = this->getTypeface(); |
| 2084 if (typeface) { | 2084 if (typeface) { |
| 2085 SkDynamicMemoryWStream ostream; | 2085 SkDynamicMemoryWStream ostream; |
| 2086 typeface->serialize(&ostream); | 2086 typeface->serialize(&ostream); |
| 2087 SkAutoTUnref<SkStreamAsset> istream(ostream.detachAsStream()); | 2087 SkAutoTDelete<SkStreamAsset> istream(ostream.detachAsStream()); |
| 2088 SkFontDescriptor descriptor(istream); | 2088 SkFontDescriptor descriptor(istream); |
| 2089 | 2089 |
| 2090 str->append("<dt>Font Family Name:</dt><dd>"); | 2090 str->append("<dt>Font Family Name:</dt><dd>"); |
| 2091 str->append(descriptor.getFamilyName()); | 2091 str->append(descriptor.getFamilyName()); |
| 2092 str->append("</dd><dt>Font Full Name:</dt><dd>"); | 2092 str->append("</dd><dt>Font Full Name:</dt><dd>"); |
| 2093 str->append(descriptor.getFullName()); | 2093 str->append(descriptor.getFullName()); |
| 2094 str->append("</dd><dt>Font PS Name:</dt><dd>"); | 2094 str->append("</dd><dt>Font PS Name:</dt><dd>"); |
| 2095 str->append(descriptor.getPostscriptName()); | 2095 str->append(descriptor.getPostscriptName()); |
| 2096 str->append("</dd><dt>Font File Name:</dt><dd>"); | 2096 str->append("</dd><dt>Font File Name:</dt><dd>"); |
| 2097 str->append(descriptor.getFontFileName()); | 2097 str->append(descriptor.getFontFileName()); |
| (...skipping 285 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 |