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 809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
820 } | 820 } |
821 | 821 |
822 // The 'remainingWithoutRotation' matrix GsA is the non-rotational part of A without the scale. | 822 // The 'remainingWithoutRotation' matrix GsA is the non-rotational part of A without the scale. |
823 if (GsA) { | 823 if (GsA) { |
824 *GsA = GA; | 824 *GsA = GA; |
825 // G is rotational so reorders with the scale. | 825 // G is rotational so reorders with the scale. |
826 GsA->preScale(SkScalarInvert(s->fX), SkScalarInvert(s->fY)); | 826 GsA->preScale(SkScalarInvert(s->fX), SkScalarInvert(s->fY)); |
827 } | 827 } |
828 } | 828 } |
829 | 829 |
830 SkAxisAlignment SkComputeAxisAlignmentForHText(const SkMatrix& matrix) { | 830 SkAxisAlignment SkScalerContext::computeAxisAlignmentForHText() { |
831 SkASSERT(!matrix.hasPerspective()); | 831 if (fRec.getHinting() != SkPaint::kNo_Hinting) { |
bungeman-skia
2016/02/29 18:00:27
This is causing a lot of churn in gold because mos
| |
832 | 832 if (0 == fRec.fPost2x2[1][0]) { |
bungeman-skia
2016/02/29 18:00:27
To answer the question, does this need to use getS
| |
833 if (0 == matrix[SkMatrix::kMSkewY]) { | 833 return kX_SkAxisAlignment; |
834 return kX_SkAxisAlignment; | 834 } |
835 } | 835 if (0 == fRec.fPost2x2[0][0]) { |
836 if (0 == matrix[SkMatrix::kMSkewX]) { | 836 return kY_SkAxisAlignment; |
bungeman-skia
2016/02/29 18:00:27
This was incorrect, or at least doesn't do what th
| |
837 return kY_SkAxisAlignment; | 837 } |
838 } | 838 } |
839 return kNone_SkAxisAlignment; | 839 return kNone_SkAxisAlignment; |
840 } | 840 } |
841 | 841 |
842 /////////////////////////////////////////////////////////////////////////////// | 842 /////////////////////////////////////////////////////////////////////////////// |
843 | 843 |
844 class SkScalerContext_Empty : public SkScalerContext { | 844 class SkScalerContext_Empty : public SkScalerContext { |
845 public: | 845 public: |
846 SkScalerContext_Empty(SkTypeface* face, const SkDescriptor* desc) | 846 SkScalerContext_Empty(SkTypeface* face, const SkDescriptor* desc) |
847 : SkScalerContext(face, desc) {} | 847 : SkScalerContext(face, desc) {} |
(...skipping 24 matching lines...) Expand all Loading... | |
872 | 872 |
873 SkScalerContext* SkTypeface::createScalerContext(const SkDescriptor* desc, | 873 SkScalerContext* SkTypeface::createScalerContext(const SkDescriptor* desc, |
874 bool allowFailure) const { | 874 bool allowFailure) const { |
875 SkScalerContext* c = this->onCreateScalerContext(desc); | 875 SkScalerContext* c = this->onCreateScalerContext(desc); |
876 | 876 |
877 if (!c && !allowFailure) { | 877 if (!c && !allowFailure) { |
878 c = new SkScalerContext_Empty(const_cast<SkTypeface*>(this), desc); | 878 c = new SkScalerContext_Empty(const_cast<SkTypeface*>(this), desc); |
879 } | 879 } |
880 return c; | 880 return c; |
881 } | 881 } |
OLD | NEW |