Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2776)

Unified Diff: tools/viewer/sk_app/Window.cpp

Issue 1982643004: Implement touch control (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: SkMutex Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/viewer/sk_app/Window.h ('k') | tools/viewer/sk_app/android/Window_android.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/viewer/sk_app/Window.cpp
diff --git a/tools/viewer/sk_app/Window.cpp b/tools/viewer/sk_app/Window.cpp
index 47053be5afc5a503f398316238bdda317fd94ead..997500c51599b40614f6f80e571dcf051743117e 100644
--- a/tools/viewer/sk_app/Window.cpp
+++ b/tools/viewer/sk_app/Window.cpp
@@ -27,11 +27,17 @@ 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,
+ void* userData) {
+ return false;
+}
+
static void default_paint_func(SkCanvas*, void* userData) {}
Window::Window() : fCharFunc(default_char_func)
, fKeyFunc(default_key_func)
, fMouseFunc(default_mouse_func)
+ , fTouchFunc(default_touch_func)
, fPaintFunc(default_paint_func) {
}
@@ -52,6 +58,10 @@ 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) {
+ return fTouchFunc(owner, state, x, y, fTouchUserData);
+}
+
void Window::onPaint() {
SkSurface* backbuffer = fWindowContext->getBackbufferSurface();
if (backbuffer) {
« no previous file with comments | « tools/viewer/sk_app/Window.h ('k') | tools/viewer/sk_app/android/Window_android.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698