diff options
author | Brian Osman <brianosman@google.com> | 2017-06-07 10:00:30 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-06-07 14:27:09 +0000 |
commit | b53f48cfec64830fa506267487a1037d27acb474 (patch) | |
tree | c7f108034ba97437371fce51c52d90970cf98156 /src | |
parent | 2e425ebd95dd97f788f7f8a3b8529d77d69b4f61 (diff) |
Touch input support for Windows
Had to add some logic to avoid touch and mouse cross-talk, because
(at least on my laptop), the touch screen generates both kinds of
events.
This seems really useful [1] for the many [2] Skia developers with
touch-enabled Windows devices.
----------
1: No, not really.
2: N = 1?
Bug: skia:
Change-Id: Ib888bf4198f2cc0a29a31581ec4b64d3d9008c33
Reviewed-on: https://skia-review.googlesource.com/18920
Reviewed-by: Yuqian Li <liyuqian@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/views/SkTouchGesture.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/views/SkTouchGesture.cpp b/src/views/SkTouchGesture.cpp index cd7388b6e1..dbcec511b7 100644 --- a/src/views/SkTouchGesture.cpp +++ b/src/views/SkTouchGesture.cpp @@ -209,10 +209,8 @@ void SkTouchGesture::touchMoved(void* owner, float x, float y) { int index = this->findRec(owner); if (index < 0) { - // not found, so I guess we should add it... - SkDebugf("---- add missing begin\n"); - this->appendNewRec(owner, x, y); - index = fTouches.count() - 1; + SkDebugf("---- ignoring move without begin\n"); + return; } Rec& rec = fTouches[index]; @@ -220,7 +218,7 @@ void SkTouchGesture::touchMoved(void* owner, float x, float y) { // not sure how valuable this is if (fTouches.count() == 2) { if (close_enough_for_jitter(rec.fLastX, rec.fLastY, x, y)) { -// SkDebugf("--- drop touchMove, withing jitter tolerance %g %g\n", rec.fLastX - x, rec.fLastY - y); +// SkDebugf("--- drop touchMove, within jitter tolerance %g %g\n", rec.fLastX - x, rec.fLastY - y); return; } } |