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(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(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);