| 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 | 9 |
| 10 #include "SkScalerContext.h" | 10 #include "SkScalerContext.h" |
| (...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 784 } | 784 } |
| 785 | 785 |
| 786 | 786 |
| 787 void SkScalerContextRec::getMatrixFrom2x2(SkMatrix* dst) const { | 787 void SkScalerContextRec::getMatrixFrom2x2(SkMatrix* dst) const { |
| 788 dst->setAll(fPost2x2[0][0], fPost2x2[0][1], 0, | 788 dst->setAll(fPost2x2[0][0], fPost2x2[0][1], 0, |
| 789 fPost2x2[1][0], fPost2x2[1][1], 0, | 789 fPost2x2[1][0], fPost2x2[1][1], 0, |
| 790 0, 0, SkScalarToPersp(SK_Scalar1)); | 790 0, 0, SkScalarToPersp(SK_Scalar1)); |
| 791 } | 791 } |
| 792 | 792 |
| 793 void SkScalerContextRec::getLocalMatrix(SkMatrix* m) const { | 793 void SkScalerContextRec::getLocalMatrix(SkMatrix* m) const { |
| 794 m->setScale(SkScalarMul(fTextSize, fPreScaleX), fTextSize); | 794 SkPaint::SetTextMatrix(m, fTextSize, fPreScaleX, fPreSkewX); |
| 795 if (fPreSkewX) { | |
| 796 m->postSkew(fPreSkewX, 0); | |
| 797 } | |
| 798 } | 795 } |
| 799 | 796 |
| 800 void SkScalerContextRec::getSingleMatrix(SkMatrix* m) const { | 797 void SkScalerContextRec::getSingleMatrix(SkMatrix* m) const { |
| 801 this->getLocalMatrix(m); | 798 this->getLocalMatrix(m); |
| 802 | 799 |
| 803 // now concat the device matrix | 800 // now concat the device matrix |
| 804 SkMatrix deviceMatrix; | 801 SkMatrix deviceMatrix; |
| 805 this->getMatrixFrom2x2(&deviceMatrix); | 802 this->getMatrixFrom2x2(&deviceMatrix); |
| 806 m->postConcat(deviceMatrix); | 803 m->postConcat(deviceMatrix); |
| 807 } | 804 } |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 859 SkScalerContext* c = NULL; //SkCreateColorScalerContext(desc); | 856 SkScalerContext* c = NULL; //SkCreateColorScalerContext(desc); |
| 860 if (NULL == c) { | 857 if (NULL == c) { |
| 861 c = this->onCreateScalerContext(desc); | 858 c = this->onCreateScalerContext(desc); |
| 862 } | 859 } |
| 863 if (NULL == c) { | 860 if (NULL == c) { |
| 864 c = SkNEW_ARGS(SkScalerContext_Empty, | 861 c = SkNEW_ARGS(SkScalerContext_Empty, |
| 865 (const_cast<SkTypeface*>(this), desc)); | 862 (const_cast<SkTypeface*>(this), desc)); |
| 866 } | 863 } |
| 867 return c; | 864 return c; |
| 868 } | 865 } |
| OLD | NEW |