fix warnings of int->float and double->float
authorreed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Fri, 18 Mar 2011 20:53:44 +0000 (20:53 +0000)
committerreed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Fri, 18 Mar 2011 20:53:44 +0000 (20:53 +0000)
git-svn-id: http://skia.googlecode.com/svn/trunk@961 2bbb7eff-a529-9590-31e7-b0007b416f81

src/views/SkTouchGesture.cpp

index 70eb6d3..1732176 100644 (file)
@@ -71,10 +71,10 @@ bool SkFlingState::evaluateMatrix(SkMatrix* matrix) {
         return false;
     }
 
-    const float t =  getseconds() - fTime0;
+    const float t =  (float)(getseconds() - fTime0);
     const float MIN_SPEED = 2;
-    const float K0 = 5.0;
-    const float K1 = 0.02;
+    const float K0 = 5;
+    const float K1 = 0.02f;
     const float speed = fSpeed0 * (sk_float_exp(- K0 * t) - K1);
     if (speed <= MIN_SPEED) {
         fActive = false;
@@ -86,8 +86,8 @@ bool SkFlingState::evaluateMatrix(SkMatrix* matrix) {
     float tx = fDirection.fX * dist;
     float ty = fDirection.fY * dist;
     if (DISCRETIZE_TRANSLATE_TO_AVOID_FLICKER) {
-        tx = sk_float_round2int(tx);
-        ty = sk_float_round2int(ty);
+        tx = (float)sk_float_round2int(tx);
+        ty = (float)sk_float_round2int(ty);
     }
     matrix->setTranslate(tx, ty);
 //    printf("---- evaluate (%g %g)\n", tx, ty);