Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(284)

Side by Side Diff: src/core/SkScalerContext.cpp

Issue 1405583002: Fix text axis alignment calculation (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 811 matching lines...) Expand 10 before | Expand all | Expand 10 after
822 GsA->preScale(SkScalarInvert(s->fX), SkScalarInvert(s->fY)); 822 GsA->preScale(SkScalarInvert(s->fX), SkScalarInvert(s->fY));
823 } 823 }
824 } 824 }
825 825
826 SkAxisAlignment SkComputeAxisAlignmentForHText(const SkMatrix& matrix) { 826 SkAxisAlignment SkComputeAxisAlignmentForHText(const SkMatrix& matrix) {
827 SkASSERT(!matrix.hasPerspective()); 827 SkASSERT(!matrix.hasPerspective());
828 828
829 if (0 == matrix[SkMatrix::kMSkewY]) { 829 if (0 == matrix[SkMatrix::kMSkewY]) {
830 return kX_SkAxisAlignment; 830 return kX_SkAxisAlignment;
831 } 831 }
832 if (0 == matrix[SkMatrix::kMScaleX]) { 832 if (0 == matrix[SkMatrix::kMSkewX]) {
833 return kY_SkAxisAlignment; 833 return kY_SkAxisAlignment;
834 } 834 }
835 return kNone_SkAxisAlignment; 835 return kNone_SkAxisAlignment;
836 } 836 }
837 837
838 /////////////////////////////////////////////////////////////////////////////// 838 ///////////////////////////////////////////////////////////////////////////////
839 839
840 class SkScalerContext_Empty : public SkScalerContext { 840 class SkScalerContext_Empty : public SkScalerContext {
841 public: 841 public:
842 SkScalerContext_Empty(SkTypeface* face, const SkDescriptor* desc) 842 SkScalerContext_Empty(SkTypeface* face, const SkDescriptor* desc)
(...skipping 25 matching lines...) Expand all
868 868
869 SkScalerContext* SkTypeface::createScalerContext(const SkDescriptor* desc, 869 SkScalerContext* SkTypeface::createScalerContext(const SkDescriptor* desc,
870 bool allowFailure) const { 870 bool allowFailure) const {
871 SkScalerContext* c = this->onCreateScalerContext(desc); 871 SkScalerContext* c = this->onCreateScalerContext(desc);
872 872
873 if (!c && !allowFailure) { 873 if (!c && !allowFailure) {
874 c = new SkScalerContext_Empty(const_cast<SkTypeface*>(this), desc); 874 c = new SkScalerContext_Empty(const_cast<SkTypeface*>(this), desc);
875 } 875 }
876 return c; 876 return c;
877 } 877 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698