Chromium Code Reviews| Index: src/core/SkScalerContext.cpp |
| diff --git a/src/core/SkScalerContext.cpp b/src/core/SkScalerContext.cpp |
| index caef2d137721254b865e0f0b29f5fac9af8fadf4..c67ca3e9fa992a4b6da0a921315e19ff070491bc 100644 |
| --- a/src/core/SkScalerContext.cpp |
| +++ b/src/core/SkScalerContext.cpp |
| @@ -827,13 +827,21 @@ void SkScalerContextRec::computeMatrices(PreMatrixScale preMatrixScale, SkVector |
| } |
| } |
| -SkAxisAlignment SkComputeAxisAlignmentForHText(const SkMatrix& matrix) { |
| - SkASSERT(!matrix.hasPerspective()); |
| - |
| - if (0 == matrix[SkMatrix::kMSkewY]) { |
| +SkAxisAlignment SkScalerContext::computeAxisAlignmentForHText() { |
| + // Why fPost2x2 can be used here. |
| + // getSingleMatrix multiplies in getLocalMatrix, which consists of |
| + // * fTextSize (a scale, which has no effect) |
| + // * fPreScaleX (a scale in x, which has no effect) |
| + // * fPreSkewX (has no effect, but would on vertical text alignment). |
| + // In other words, making the text bigger, stretching it along the |
| + // horizontal axis, or fake italicizing it does not move the baseline. |
|
herb_g
2016/02/29 18:37:10
italicizing; it does...
bungeman-skia
2016/02/29 19:21:20
it actually has no effect on the horizontal baseli
|
| + |
| + if (0 == fRec.fPost2x2[1][0]) { |
| + // The x axis is mapped onto the x axis. |
| return kX_SkAxisAlignment; |
| } |
| - if (0 == matrix[SkMatrix::kMSkewX]) { |
| + if (0 == fRec.fPost2x2[0][0]) { |
| + // The x axis is mapped onto the y axis. |
| return kY_SkAxisAlignment; |
| } |
| return kNone_SkAxisAlignment; |