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

Unified Diff: src/utils/SkMatrix44.cpp

Issue 49463005: Fix narrowing conversion errors from r11986 (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Wrap Created 7 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 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/utils/SkMatrix44.cpp
diff --git a/src/utils/SkMatrix44.cpp b/src/utils/SkMatrix44.cpp
index a598e523f14de83307f586733fe5d17895106e7e..37ab8db27f08ee89a71a9376e0b5acb6caf5cb7a 100644
--- a/src/utils/SkMatrix44.cpp
+++ b/src/utils/SkMatrix44.cpp
@@ -819,7 +819,10 @@ static void map2_pf(const SkMScalar mat[][4], const float* SK_RESTRICT src2,
float sx = src2[0];
float sy = src2[1];
for (int i = 0; i < 4; i++) {
- dst4[i] = mat[0][i] * sx + mat[1][i] * sy + mat[3][i];
+ dst4[i] =
+ SkMScalarToFloat(mat[0][i]) * sx +
reed1 2013/10/29 14:58:52 This technique throws away all of the precision be
epoger 2013/10/29 15:18:30 Thanks for catching this, Mike. Do you think it's
enne (OOO) 2013/10/29 16:56:37 When SkMScalar is a float, map2_af's technique is
+ SkMScalarToFloat(mat[1][i]) * sy +
+ SkMScalarToFloat(mat[3][i]);
}
src2 += 2;
dst4 += 4;
« 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