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

Unified Diff: sky/shell/org/domokit/sky/shell/PlatformView.java

Issue 970493003: Add support for pressure on pointer events (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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 | « sky/examples/touch-demo.sky ('k') | sky/shell/ui/input_event_converter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/shell/org/domokit/sky/shell/PlatformView.java
diff --git a/sky/shell/org/domokit/sky/shell/PlatformView.java b/sky/shell/org/domokit/sky/shell/PlatformView.java
index 07af2b46745bbbae2b91eb6994e55d44779fe19f..a4b98cd5fbf9a31a7d8794f65d87c38baa2ab5cc 100644
--- a/sky/shell/org/domokit/sky/shell/PlatformView.java
+++ b/sky/shell/org/domokit/sky/shell/PlatformView.java
@@ -112,11 +112,19 @@ public class PlatformView extends SurfaceView
pointerData.x = event.getX(pointerIndex);
pointerData.y = event.getY(pointerIndex);
+ pointerData.pressure = event.getPressure(pointerIndex);
+ // TODO(eseidel): Could get the calibrated range if necessary:
+ // event.getDevice().getMotionRange(MotionEvent.AXIS_PRESSURE)
+ pointerData.pressureMin = 0.0f;
+ pointerData.pressureMax = 1.0f;
+
InputEvent inputEvent = new InputEvent();
inputEvent.type = getTypeForAction(event.getActionMasked());
inputEvent.timeStamp = event.getEventTime();
inputEvent.pointerData = pointerData;
+
+
abarth-chromium 2015/02/28 03:42:30 So many blank lines. :)
abarth-chromium 2015/02/28 03:42:30 So many blank lines. :)
mViewportObserver.onInputEvent(inputEvent);
}
« no previous file with comments | « sky/examples/touch-demo.sky ('k') | sky/shell/ui/input_event_converter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698