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

Unified Diff: src/core/SkScalerContext.cpp

Issue 1735613002: Fully check basis vectors for extent degeneracy. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkScalerContext.cpp
diff --git a/src/core/SkScalerContext.cpp b/src/core/SkScalerContext.cpp
index 29f794a99f1dffeffc1fed64a0ebc1c5e8e67440..caef2d137721254b865e0f0b29f5fac9af8fadf4 100644
--- a/src/core/SkScalerContext.cpp
+++ b/src/core/SkScalerContext.cpp
@@ -724,13 +724,17 @@ void SkScalerContextRec::computeMatrices(PreMatrixScale preMatrixScale, SkVector
// If the 'total' matrix is singular, set the 'scale' to something finite and zero the matrices.
// All underlying ports have issues with zero text size, so use the matricies to zero.
- // Map the vectors [1,1] and [1,-1] (the EM) through the 'total' matrix.
+ // Map the vectors [0,1], [1,0], [1,1] and [1,-1] (the EM) through the 'total' matrix.
// If the length of one of these vectors is less than 1/256 then an EM filling square will
// never affect any pixels.
- SkVector diag[2] = { { A.getScaleX() + A.getSkewX(), A.getScaleY() + A.getSkewY() },
+ SkVector diag[4] = { { A.getScaleX() , A.getSkewY() },
jvanverth1 2016/02/25 19:00:33 I think you're multiplying these as row vectors, b
+ { A.getSkewX(), A.getScaleY() },
+ { A.getScaleX() + A.getSkewX(), A.getScaleY() + A.getSkewY() },
{ A.getScaleX() - A.getSkewX(), A.getScaleY() - A.getSkewY() }, };
if (diag[0].lengthSqd() <= SK_ScalarNearlyZero * SK_ScalarNearlyZero ||
- diag[1].lengthSqd() <= SK_ScalarNearlyZero * SK_ScalarNearlyZero)
+ diag[1].lengthSqd() <= SK_ScalarNearlyZero * SK_ScalarNearlyZero ||
+ diag[2].lengthSqd() <= SK_ScalarNearlyZero * SK_ScalarNearlyZero ||
+ diag[3].lengthSqd() <= SK_ScalarNearlyZero * SK_ScalarNearlyZero)
{
s->fX = SK_Scalar1;
s->fY = SK_Scalar1;
« 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