OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #include "SkPaint.h" | 9 #include "SkPaint.h" |
10 #include "SkAnnotation.h" | 10 #include "SkAnnotation.h" |
(...skipping 1053 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1064 width = this->measure_text(cache, text, length, &tempCount, bounds); | 1064 width = this->measure_text(cache, text, length, &tempCount, bounds); |
1065 if (scale) { | 1065 if (scale) { |
1066 width = SkScalarMul(width, scale); | 1066 width = SkScalarMul(width, scale); |
1067 if (bounds) { | 1067 if (bounds) { |
1068 bounds->fLeft = SkScalarMul(bounds->fLeft, scale); | 1068 bounds->fLeft = SkScalarMul(bounds->fLeft, scale); |
1069 bounds->fTop = SkScalarMul(bounds->fTop, scale); | 1069 bounds->fTop = SkScalarMul(bounds->fTop, scale); |
1070 bounds->fRight = SkScalarMul(bounds->fRight, scale); | 1070 bounds->fRight = SkScalarMul(bounds->fRight, scale); |
1071 bounds->fBottom = SkScalarMul(bounds->fBottom, scale); | 1071 bounds->fBottom = SkScalarMul(bounds->fBottom, scale); |
1072 } | 1072 } |
1073 } | 1073 } |
| 1074 } else if (bounds) { |
| 1075 // ensure that even if we don't measure_text we still update the bounds |
| 1076 bounds->setEmpty(); |
1074 } | 1077 } |
1075 return width; | 1078 return width; |
1076 } | 1079 } |
1077 | 1080 |
1078 typedef bool (*SkTextBufferPred)(const char* text, const char* stop); | 1081 typedef bool (*SkTextBufferPred)(const char* text, const char* stop); |
1079 | 1082 |
1080 static bool forward_textBufferPred(const char* text, const char* stop) { | 1083 static bool forward_textBufferPred(const char* text, const char* stop) { |
1081 return text < stop; | 1084 return text < stop; |
1082 } | 1085 } |
1083 | 1086 |
(...skipping 1461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2545 if (firstTime) { | 2548 if (firstTime) { |
2546 *dst = r; | 2549 *dst = r; |
2547 } else { | 2550 } else { |
2548 dst->join(r); | 2551 dst->join(r); |
2549 } | 2552 } |
2550 } else { | 2553 } else { |
2551 break; | 2554 break; |
2552 } | 2555 } |
2553 } | 2556 } |
2554 } | 2557 } |
OLD | NEW |