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

Unified Diff: sky/shell/android/org/domokit/sky/shell/PlatformViewAndroid.java

Issue 1236043004: Improve drawer performance (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: cache paint Created 5 years, 5 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/services/engine/input_event.mojom ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/shell/android/org/domokit/sky/shell/PlatformViewAndroid.java
diff --git a/sky/shell/android/org/domokit/sky/shell/PlatformViewAndroid.java b/sky/shell/android/org/domokit/sky/shell/PlatformViewAndroid.java
index be7dbf41d6bebdaf0c4785824ccc3c0bef9a12b5..a9e4dbb1fdbb975d803b2c116c1ca121185588b6 100644
--- a/sky/shell/android/org/domokit/sky/shell/PlatformViewAndroid.java
+++ b/sky/shell/android/org/domokit/sky/shell/PlatformViewAndroid.java
@@ -5,6 +5,7 @@
package org.domokit.sky.shell;
import android.content.Context;
+import android.os.Build;
import android.view.MotionEvent;
import android.view.Surface;
import android.view.SurfaceHolder;
@@ -170,15 +171,23 @@ public class PlatformViewAndroid extends SurfaceView
inputEvent.timeStamp = event.getEventTime();
inputEvent.pointerData = pointerData;
-
-
mSkyEngine.onInputEvent(inputEvent);
}
@Override
public boolean onTouchEvent(MotionEvent event) {
+ // TODO(abarth): This version check might not be effective in some
+ // versions of Android that statically compile code and will be upset
+ // at the lack of |requestUnbufferedDispatch|. Instead, we should factor
+ // version-dependent code into separate classes for each supported
+ // version and dispatch dynamically.
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+ requestUnbufferedDispatch(event);
+ }
mGestureProvider.onTouchEvent(event);
+ // TODO(abarth): Rather than unpacking these events here, we should
+ // probably send them in one packet to the engine.
int maskedAction = event.getActionMasked();
// ACTION_UP, ACTION_POINTER_UP, ACTION_DOWN, and ACTION_POINTER_DOWN
// only apply to a single pointer, other events apply to all pointers.
« no previous file with comments | « sky/services/engine/input_event.mojom ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698