warning fixes
Review URL http://codereview.appspot.com/5328050/
git-svn-id: http://skia.googlecode.com/svn/trunk@2548 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrDrawState.h b/src/gpu/GrDrawState.h
index 37baee8..2acaf03 100644
--- a/src/gpu/GrDrawState.h
+++ b/src/gpu/GrDrawState.h
@@ -75,10 +75,10 @@
Edge(float x, float y, float z) : fX(x), fY(y), fZ(z) {}
GrPoint intersect(const Edge& other) {
return GrPoint::Make(
- (fY * other.fZ - other.fY * fZ) /
- (fX * other.fY - other.fX * fY),
- (fX * other.fZ - other.fX * fZ) /
- (other.fX * fY - fX * other.fY));
+ SkFloatToScalar((fY * other.fZ - other.fY * fZ) /
+ (fX * other.fY - other.fX * fY)),
+ SkFloatToScalar((fX * other.fZ - other.fX * fZ) /
+ (other.fX * fY - fX * other.fY)));
}
float fX, fY, fZ;
};
diff --git a/src/utils/SkMatrix44.cpp b/src/utils/SkMatrix44.cpp
index 4747888..a59c91b 100644
--- a/src/utils/SkMatrix44.cpp
+++ b/src/utils/SkMatrix44.cpp
@@ -326,7 +326,7 @@
for (int j = 0; j < 4; j++) {
value += fMat[j][i] * src[j];
}
- result[i] = value;
+ result[i] = SkMScalarToScalar(value);
}
memcpy(dst, result, sizeof(result));
}
@@ -355,12 +355,12 @@
static void initFromMatrix(SkMScalar dst[4][4], const SkMatrix& src) {
sk_bzero(dst, 16 * sizeof(SkMScalar));
- dst[0][0] = src[SkMatrix::kMScaleX];
- dst[1][0] = src[SkMatrix::kMSkewX];
- dst[3][0] = src[SkMatrix::kMTransX];
- dst[0][1] = src[SkMatrix::kMSkewY];
- dst[1][1] = src[SkMatrix::kMScaleY];
- dst[3][1] = src[SkMatrix::kMTransY];
+ dst[0][0] = SkScalarToMScalar(src[SkMatrix::kMScaleX]);
+ dst[1][0] = SkScalarToMScalar(src[SkMatrix::kMSkewX]);
+ dst[3][0] = SkScalarToMScalar(src[SkMatrix::kMTransX]);
+ dst[0][1] = SkScalarToMScalar(src[SkMatrix::kMSkewY]);
+ dst[1][1] = SkScalarToMScalar(src[SkMatrix::kMScaleY]);
+ dst[3][1] = SkScalarToMScalar(src[SkMatrix::kMTransY]);
dst[2][2] = dst[3][3] = 1;
}
@@ -377,13 +377,13 @@
SkMatrix dst;
dst.reset(); // setup our perspective correctly for identity
- dst[SkMatrix::kMScaleX] = SkMScalarToFloat(fMat[0][0]);
- dst[SkMatrix::kMSkewX] = SkMScalarToFloat(fMat[1][0]);
- dst[SkMatrix::kMTransX] = SkMScalarToFloat(fMat[3][0]);
+ dst[SkMatrix::kMScaleX] = SkMScalarToScalar(fMat[0][0]);
+ dst[SkMatrix::kMSkewX] = SkMScalarToScalar(fMat[1][0]);
+ dst[SkMatrix::kMTransX] = SkMScalarToScalar(fMat[3][0]);
- dst[SkMatrix::kMSkewY] = SkMScalarToFloat(fMat[0][1]);
- dst[SkMatrix::kMScaleY] = SkMScalarToFloat(fMat[1][1]);
- dst[SkMatrix::kMTransY] = SkMScalarToFloat(fMat[3][1]);
+ dst[SkMatrix::kMSkewY] = SkMScalarToScalar(fMat[0][1]);
+ dst[SkMatrix::kMScaleY] = SkMScalarToScalar(fMat[1][1]);
+ dst[SkMatrix::kMTransY] = SkMScalarToScalar(fMat[3][1]);
return dst;
}