| 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 1097 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1108 while (iter.next(&iterPath, &xpos)) { | 1108 while (iter.next(&iterPath, &xpos)) { |
| 1109 matrix.postTranslate(xpos - prevXPos, 0); | 1109 matrix.postTranslate(xpos - prevXPos, 0); |
| 1110 if (iterPath) { | 1110 if (iterPath) { |
| 1111 path->addPath(*iterPath, matrix); | 1111 path->addPath(*iterPath, matrix); |
| 1112 } | 1112 } |
| 1113 prevXPos = xpos; | 1113 prevXPos = xpos; |
| 1114 } | 1114 } |
| 1115 } | 1115 } |
| 1116 | 1116 |
| 1117 int SkPaint::getTextIntercepts(const void* textData, size_t length, | 1117 int SkPaint::getTextIntercepts(const void* textData, size_t length, |
| 1118 SkScalar x, SkScalar y, const SkScalar bounds[2],
| 1118 SkScalar x, SkScalar y, const SkScalar bounds[2], |
| 1119 SkScalar* array) const { | 1119 SkScalar* array) const { |
| 1120 SkASSERT(length == 0 || textData != nullptr); | 1120 SkASSERT(length == 0 || textData != nullptr); |
| 1121 if (!length) { | 1121 if (!length) { |
| 1122 return 0; | 1122 return 0; |
| 1123 } | 1123 } |
| 1124 | 1124 |
| 1125 const char* text = (const char*) textData; | 1125 const char* text = (const char*) textData; |
| 1126 SkTextInterceptsIter iter(text, length, *this, bounds, x, y, | 1126 SkTextInterceptsIter iter(text, length, *this, bounds, x, y, |
| 1127 SkTextInterceptsIter::TextType::kText); | 1127 SkTextInterceptsIter::TextType::kText); |
| 1128 int count = 0; | 1128 int count = 0; |
| (...skipping 1226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2355 } | 2355 } |
| 2356 | 2356 |
| 2357 uint32_t SkPaint::getHash() const { | 2357 uint32_t SkPaint::getHash() const { |
| 2358 // We're going to hash 10 pointers and 7 32-bit values, finishing up with fB
itfields, | 2358 // We're going to hash 10 pointers and 7 32-bit values, finishing up with fB
itfields, |
| 2359 // so fBitfields should be 10 pointers and 6 32-bit values from the start. | 2359 // so fBitfields should be 10 pointers and 6 32-bit values from the start. |
| 2360 static_assert(offsetof(SkPaint, fBitfields) == 9 * sizeof(void*) + 6 * sizeo
f(uint32_t), | 2360 static_assert(offsetof(SkPaint, fBitfields) == 9 * sizeof(void*) + 6 * sizeo
f(uint32_t), |
| 2361 "SkPaint_notPackedTightly"); | 2361 "SkPaint_notPackedTightly"); |
| 2362 return SkChecksum::Murmur3(reinterpret_cast<const uint32_t*>(this), | 2362 return SkChecksum::Murmur3(reinterpret_cast<const uint32_t*>(this), |
| 2363 offsetof(SkPaint, fBitfields) + sizeof(fBitfields
)); | 2363 offsetof(SkPaint, fBitfields) + sizeof(fBitfields
)); |
| 2364 } | 2364 } |
| OLD | NEW |