From 59f46b81f8bdd1b524f5cc43bc27603f9604c71a Mon Sep 17 00:00:00 2001 From: "robertphillips@google.com" Date: Tue, 10 Jul 2012 17:30:58 +0000 Subject: Fixed Windows compiler complaints http://codereview.appspot.com/6392044 git-svn-id: http://skia.googlecode.com/svn/trunk@4511 2bbb7eff-a529-9590-31e7-b0007b416f81 --- src/views/SkTouchGesture.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/views') diff --git a/src/views/SkTouchGesture.cpp b/src/views/SkTouchGesture.cpp index 31adc74b38..1828f0390b 100644 --- a/src/views/SkTouchGesture.cpp +++ b/src/views/SkTouchGesture.cpp @@ -14,9 +14,9 @@ #define DISCRETIZE_TRANSLATE_TO_AVOID_FLICKER true -static const float MAX_FLING_SPEED = 1500; +static const SkScalar MAX_FLING_SPEED = SkIntToScalar(1500); -static float pin_max_fling(float speed) { +static SkScalar pin_max_fling(SkScalar speed) { if (speed > MAX_FLING_SPEED) { speed = MAX_FLING_SPEED; } @@ -50,7 +50,7 @@ static void unit_axis_align(SkVector* unit) { void SkFlingState::reset(float sx, float sy) { fActive = true; - fDirection.set(sx, sy); + fDirection.set(SkFloatToScalar(sx), SkFloatToScalar(sy)); fSpeed0 = SkPoint::Normalize(&fDirection); fSpeed0 = pin_max_fling(fSpeed0); fTime0 = getseconds(); @@ -82,7 +82,7 @@ bool SkFlingState::evaluateMatrix(SkMatrix* matrix) { tx = (float)sk_float_round2int(tx); ty = (float)sk_float_round2int(ty); } - matrix->setTranslate(tx, ty); + matrix->setTranslate(SkFloatToScalar(tx), SkFloatToScalar(ty)); // printf("---- evaluate (%g %g)\n", tx, ty); return true; @@ -181,8 +181,8 @@ int SkTouchGesture::findRec(void* owner) const { return -1; } -static float center(float pos0, float pos1) { - return (pos0 + pos1) * 0.5f; +static SkScalar center(float pos0, float pos1) { + return SkFloatToScalar((pos0 + pos1) * 0.5f); } static const float MAX_ZOOM_SCALE = 4; @@ -190,7 +190,7 @@ static const float MIN_ZOOM_SCALE = 0.25f; float SkTouchGesture::limitTotalZoom(float scale) const { // this query works 'cause we know that we're square-scale w/ no skew/rotation - const float curr = fGlobalM[0]; + const float curr = SkScalarToFloat(fGlobalM[0]); if (scale > 1 && curr * scale > MAX_ZOOM_SCALE) { scale = MAX_ZOOM_SCALE / curr; -- cgit v1.2.3