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

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

Issue 1982643004: Implement touch control (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Dedup 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
Index: tools/viewer/sk_app/Window.h
diff --git a/tools/viewer/sk_app/Window.h b/tools/viewer/sk_app/Window.h
index f233f131a5eb15f1ce6bf5865502c3a339291197..39b06f2cd9ef0e2569d9f90420460b70f82dd76b 100644
--- a/tools/viewer/sk_app/Window.h
+++ b/tools/viewer/sk_app/Window.h
@@ -9,8 +9,9 @@
#define Window_DEFINED
#include "DisplayParams.h"
-#include "SkTypes.h"
#include "SkRect.h"
+#include "SkTouchGesture.h"
+#include "SkTypes.h"
class SkCanvas;
@@ -124,6 +125,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
void onPaint();
void onResize(uint32_t width, uint32_t height);
@@ -133,6 +135,9 @@ public:
virtual const DisplayParams& getDisplayParams();
void setDisplayParams(const DisplayParams& params);
+ const SkMatrix& getGestureLocalM();
+ const SkMatrix& getGestureGlobalM() const;
+
protected:
Window();
@@ -148,7 +153,9 @@ protected:
OnPaintFunc fPaintFunc;
void* fPaintUserData;
- WindowContext* fWindowContext;
+ WindowContext* fWindowContext = nullptr;
+
+ SkTouchGesture fGesture;
};
} // namespace sk_app

Powered by Google App Engine
This is Rietveld 408576698