aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/views
diff options
context:
space:
mode:
authorGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-07-10 17:30:58 +0000
committerGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-07-10 17:30:58 +0000
commit59f46b81f8bdd1b524f5cc43bc27603f9604c71a (patch)
treec074f4d76c87c4ab67e32405327a0c10201ed7e8 /src/views
parent676e66096c60615bac52f365111596de5c4ca8a6 (diff)
Fixed Windows compiler complaints
Diffstat (limited to 'src/views')
-rw-r--r--src/views/SkTouchGesture.cpp14
1 files changed, 7 insertions, 7 deletions
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;