aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar jvanverth <jvanverth@google.com>2016-06-06 08:48:47 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-06-06 08:48:47 -0700
commit814e38d5c11e4b71b2c87d1e1fe7bc8e8d688288 (patch)
tree6c7439db15786aefb73f2fe8f8d6c7ce8f5159a7
parent11450d5ec107b3b770d27c05b107ed5b187cb777 (diff)
Use intptr_t for onTouch argument.
On 64-bit platforms, casting int to void* is not valid. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2047443002 Review-Url: https://codereview.chromium.org/2047443002
-rw-r--r--tools/viewer/Viewer.cpp4
-rw-r--r--tools/viewer/Viewer.h2
-rw-r--r--tools/viewer/sk_app/Window.cpp4
-rw-r--r--tools/viewer/sk_app/Window.h4
4 files changed, 7 insertions, 7 deletions
diff --git a/tools/viewer/Viewer.cpp b/tools/viewer/Viewer.cpp
index 7e345c5bbc..c11b82bec0 100644
--- a/tools/viewer/Viewer.cpp
+++ b/tools/viewer/Viewer.cpp
@@ -28,7 +28,7 @@ static void on_paint_handler(SkCanvas* canvas, void* userData) {
return vv->onPaint(canvas);
}
-static bool on_touch_handler(int owner, Window::InputState state, float x, float y, void* userData)
+static bool on_touch_handler(intptr_t owner, Window::InputState state, float x, float y, void* userData)
{
Viewer* viewer = reinterpret_cast<Viewer*>(userData);
@@ -332,7 +332,7 @@ void Viewer::onPaint(SkCanvas* canvas) {
fCommands.drawHelp(canvas);
}
-bool Viewer::onTouch(int owner, Window::InputState state, float x, float y) {
+bool Viewer::onTouch(intptr_t owner, Window::InputState state, float x, float y) {
void* castedOwner = reinterpret_cast<void*>(owner);
SkPoint touchPoint = fDefaultMatrixInv.mapXY(x, y);
switch (state) {
diff --git a/tools/viewer/Viewer.h b/tools/viewer/Viewer.h
index e752b3f939..4b260dfc1d 100644
--- a/tools/viewer/Viewer.h
+++ b/tools/viewer/Viewer.h
@@ -24,7 +24,7 @@ public:
void onPaint(SkCanvas* canvas);
void onIdle(double ms) override;
- bool onTouch(int owner, sk_app::Window::InputState state, float x, float y);
+ bool onTouch(intptr_t owner, sk_app::Window::InputState state, float x, float y);
void onUIStateChanged(const SkString& stateName, const SkString& stateValue);
private:
diff --git a/tools/viewer/sk_app/Window.cpp b/tools/viewer/sk_app/Window.cpp
index 1c798df399..7ec8baae36 100644
--- a/tools/viewer/sk_app/Window.cpp
+++ b/tools/viewer/sk_app/Window.cpp
@@ -27,7 +27,7 @@ static bool default_mouse_func(int x, int y, Window::InputState state, uint32_t
return false;
}
-static bool default_touch_func(int owner, Window::InputState state, float x, float y,
+static bool default_touch_func(intptr_t owner, Window::InputState state, float x, float y,
void* userData) {
return false;
}
@@ -62,7 +62,7 @@ bool Window::onMouse(int x, int y, InputState state, uint32_t modifiers) {
return fMouseFunc(x, y, state, modifiers, fMouseUserData);
}
-bool Window::onTouch(int owner, InputState state, float x, float y) {
+bool Window::onTouch(intptr_t owner, InputState state, float x, float y) {
return fTouchFunc(owner, state, x, y, fTouchUserData);
}
diff --git a/tools/viewer/sk_app/Window.h b/tools/viewer/sk_app/Window.h
index 9ca4231c80..29c85b9e78 100644
--- a/tools/viewer/sk_app/Window.h
+++ b/tools/viewer/sk_app/Window.h
@@ -111,7 +111,7 @@ public:
typedef bool(*OnCharFunc)(SkUnichar c, uint32_t modifiers, void* userData);
typedef bool(*OnKeyFunc)(Key key, InputState state, uint32_t modifiers, void* userData);
typedef bool(*OnMouseFunc)(int x, int y, InputState state, uint32_t modifiers, void* userData);
- typedef bool(*OnTouchFunc)(int owner, InputState state, float x, float y, void* userData);
+ typedef bool(*OnTouchFunc)(intptr_t owner, InputState state, float x, float y, void* userData);
typedef void(*OnUIStateChangedFunc)(
const SkString& stateName, const SkString& stateValue, void* userData);
typedef void(*OnPaintFunc)(SkCanvas*, void* userData);
@@ -149,7 +149,7 @@ public:
bool onChar(SkUnichar c, uint32_t modifiers);
bool onKey(Key key, InputState state, uint32_t modifiers);
bool onMouse(int x, int y, InputState state, uint32_t modifiers);
- bool onTouch(int owner, InputState state, float x, float y); // multi-owner = multi-touch
+ bool onTouch(intptr_t owner, InputState state, float x, float y); // multi-owner = multi-touch
void onUIStateChanged(const SkString& stateName, const SkString& stateValue);
void onPaint();
void onResize(uint32_t width, uint32_t height);