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 | 8 |
9 #include "SkDraw.h" | 9 #include "SkDraw.h" |
10 #include "SkBlitter.h" | 10 #include "SkBlitter.h" |
(...skipping 1409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1420 SkTextToPathIter iter(text, byteLength, paint, true); | 1420 SkTextToPathIter iter(text, byteLength, paint, true); |
1421 | 1421 |
1422 SkMatrix matrix; | 1422 SkMatrix matrix; |
1423 matrix.setScale(iter.getPathScale(), iter.getPathScale()); | 1423 matrix.setScale(iter.getPathScale(), iter.getPathScale()); |
1424 matrix.postTranslate(x, y); | 1424 matrix.postTranslate(x, y); |
1425 | 1425 |
1426 const SkPath* iterPath; | 1426 const SkPath* iterPath; |
1427 SkScalar xpos, prevXPos = 0; | 1427 SkScalar xpos, prevXPos = 0; |
1428 | 1428 |
1429 while (iter.next(&iterPath, &xpos)) { | 1429 while (iter.next(&iterPath, &xpos)) { |
1430 matrix.postTranslate(xpos - prevXPos, 0); | 1430 SkScalar delta = xpos - prevXPos; |
| 1431 if (paint.isVerticalText()) { |
| 1432 matrix.postTranslate(0, delta); |
| 1433 } else { |
| 1434 matrix.postTranslate(delta, 0); |
| 1435 } |
| 1436 |
1431 if (iterPath) { | 1437 if (iterPath) { |
1432 const SkPaint& pnt = iter.getPaint(); | 1438 const SkPaint& pnt = iter.getPaint(); |
1433 if (fDevice) { | 1439 if (fDevice) { |
1434 fDevice->drawPath(*this, *iterPath, pnt, &matrix, false); | 1440 fDevice->drawPath(*this, *iterPath, pnt, &matrix, false); |
1435 } else { | 1441 } else { |
1436 this->drawPath(*iterPath, pnt, &matrix, false); | 1442 this->drawPath(*iterPath, pnt, &matrix, false); |
1437 } | 1443 } |
1438 } | 1444 } |
1439 prevXPos = xpos; | 1445 prevXPos = xpos; |
1440 } | 1446 } |
(...skipping 1336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2777 mask->fImage = SkMask::AllocImage(size); | 2783 mask->fImage = SkMask::AllocImage(size); |
2778 memset(mask->fImage, 0, mask->computeImageSize()); | 2784 memset(mask->fImage, 0, mask->computeImageSize()); |
2779 } | 2785 } |
2780 | 2786 |
2781 if (SkMask::kJustComputeBounds_CreateMode != mode) { | 2787 if (SkMask::kJustComputeBounds_CreateMode != mode) { |
2782 draw_into_mask(*mask, devPath, style); | 2788 draw_into_mask(*mask, devPath, style); |
2783 } | 2789 } |
2784 | 2790 |
2785 return true; | 2791 return true; |
2786 } | 2792 } |
OLD | NEW |