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 1287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1298 if (scale) { | 1298 if (scale) { |
1299 metrics->fTop = SkScalarMul(metrics->fTop, scale); | 1299 metrics->fTop = SkScalarMul(metrics->fTop, scale); |
1300 metrics->fAscent = SkScalarMul(metrics->fAscent, scale); | 1300 metrics->fAscent = SkScalarMul(metrics->fAscent, scale); |
1301 metrics->fDescent = SkScalarMul(metrics->fDescent, scale); | 1301 metrics->fDescent = SkScalarMul(metrics->fDescent, scale); |
1302 metrics->fBottom = SkScalarMul(metrics->fBottom, scale); | 1302 metrics->fBottom = SkScalarMul(metrics->fBottom, scale); |
1303 metrics->fLeading = SkScalarMul(metrics->fLeading, scale); | 1303 metrics->fLeading = SkScalarMul(metrics->fLeading, scale); |
1304 metrics->fAvgCharWidth = SkScalarMul(metrics->fAvgCharWidth, scale); | 1304 metrics->fAvgCharWidth = SkScalarMul(metrics->fAvgCharWidth, scale); |
1305 metrics->fXMin = SkScalarMul(metrics->fXMin, scale); | 1305 metrics->fXMin = SkScalarMul(metrics->fXMin, scale); |
1306 metrics->fXMax = SkScalarMul(metrics->fXMax, scale); | 1306 metrics->fXMax = SkScalarMul(metrics->fXMax, scale); |
1307 metrics->fXHeight = SkScalarMul(metrics->fXHeight, scale); | 1307 metrics->fXHeight = SkScalarMul(metrics->fXHeight, scale); |
| 1308 metrics->fUnderlineThickness = SkScalarMul(metrics->fUnderlineThickness,
scale); |
| 1309 metrics->fUnderlinePosition = SkScalarMul(metrics->fUnderlinePosition, s
cale); |
1308 } | 1310 } |
1309 return metrics->fDescent - metrics->fAscent + metrics->fLeading; | 1311 return metrics->fDescent - metrics->fAscent + metrics->fLeading; |
1310 } | 1312 } |
1311 | 1313 |
1312 /////////////////////////////////////////////////////////////////////////////// | 1314 /////////////////////////////////////////////////////////////////////////////// |
1313 | 1315 |
1314 static void set_bounds(const SkGlyph& g, SkRect* bounds, SkScalar scale) { | 1316 static void set_bounds(const SkGlyph& g, SkRect* bounds, SkScalar scale) { |
1315 bounds->set(g.fLeft * scale, | 1317 bounds->set(g.fLeft * scale, |
1316 g.fTop * scale, | 1318 g.fTop * scale, |
1317 (g.fLeft + g.fWidth) * scale, | 1319 (g.fLeft + g.fWidth) * scale, |
(...skipping 1334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2652 } | 2654 } |
2653 #ifdef SK_BUILD_FOR_ANDROID | 2655 #ifdef SK_BUILD_FOR_ANDROID |
2654 if (dirty & kPaintOptionsAndroid_DirtyBit) { | 2656 if (dirty & kPaintOptionsAndroid_DirtyBit) { |
2655 SkPaintOptionsAndroid options; | 2657 SkPaintOptionsAndroid options; |
2656 options.unflatten(buffer); | 2658 options.unflatten(buffer); |
2657 paint->setPaintOptionsAndroid(options); | 2659 paint->setPaintOptionsAndroid(options); |
2658 } | 2660 } |
2659 #endif | 2661 #endif |
2660 SkASSERT(dirty == paint->fDirtyBits); | 2662 SkASSERT(dirty == paint->fDirtyBits); |
2661 } | 2663 } |
OLD | NEW |