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

Side by Side 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, 1 month 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 | Annotate | Revision Log
« 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 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkMatrix44.h" 8 #include "SkMatrix44.h"
9 9
10 static inline bool eq4(const SkMScalar* SK_RESTRICT a, 10 static inline bool eq4(const SkMScalar* SK_RESTRICT a,
(...skipping 801 matching lines...) Expand 10 before | Expand all | Expand 10 after
812 dst4 += 4; 812 dst4 += 4;
813 } 813 }
814 } 814 }
815 815
816 static void map2_pf(const SkMScalar mat[][4], const float* SK_RESTRICT src2, 816 static void map2_pf(const SkMScalar mat[][4], const float* SK_RESTRICT src2,
817 int count, float* SK_RESTRICT dst4) { 817 int count, float* SK_RESTRICT dst4) {
818 for (int n = 0; n < count; ++n) { 818 for (int n = 0; n < count; ++n) {
819 float sx = src2[0]; 819 float sx = src2[0];
820 float sy = src2[1]; 820 float sy = src2[1];
821 for (int i = 0; i < 4; i++) { 821 for (int i = 0; i < 4; i++) {
822 dst4[i] = mat[0][i] * sx + mat[1][i] * sy + mat[3][i]; 822 dst4[i] =
823 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
824 SkMScalarToFloat(mat[1][i]) * sy +
825 SkMScalarToFloat(mat[3][i]);
823 } 826 }
824 src2 += 2; 827 src2 += 2;
825 dst4 += 4; 828 dst4 += 4;
826 } 829 }
827 } 830 }
828 831
829 static void map2_pd(const SkMScalar mat[][4], const double* SK_RESTRICT src2, 832 static void map2_pd(const SkMScalar mat[][4], const double* SK_RESTRICT src2,
830 int count, double* SK_RESTRICT dst4) { 833 int count, double* SK_RESTRICT dst4) {
831 for (int n = 0; n < count; ++n) { 834 for (int n = 0; n < count; ++n) {
832 double sx = src2[0]; 835 double sx = src2[0];
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
925 dst[SkMatrix::kMSkewY] = SkMScalarToScalar(fMat[0][1]); 928 dst[SkMatrix::kMSkewY] = SkMScalarToScalar(fMat[0][1]);
926 dst[SkMatrix::kMScaleY] = SkMScalarToScalar(fMat[1][1]); 929 dst[SkMatrix::kMScaleY] = SkMScalarToScalar(fMat[1][1]);
927 dst[SkMatrix::kMTransY] = SkMScalarToScalar(fMat[3][1]); 930 dst[SkMatrix::kMTransY] = SkMScalarToScalar(fMat[3][1]);
928 931
929 dst[SkMatrix::kMPersp0] = SkMScalarToScalar(fMat[0][3]); 932 dst[SkMatrix::kMPersp0] = SkMScalarToScalar(fMat[0][3]);
930 dst[SkMatrix::kMPersp1] = SkMScalarToScalar(fMat[1][3]); 933 dst[SkMatrix::kMPersp1] = SkMScalarToScalar(fMat[1][3]);
931 dst[SkMatrix::kMPersp2] = SkMScalarToScalar(fMat[3][3]); 934 dst[SkMatrix::kMPersp2] = SkMScalarToScalar(fMat[3][3]);
932 935
933 return dst; 936 return dst;
934 } 937 }
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