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

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

Issue 1740163002: Improve horizontal baseline detection. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 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 | « src/core/SkScalerContext.h ('k') | 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 809 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 }
OLDNEW
« no previous file with comments | « src/core/SkScalerContext.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698