Bug:
7332724
By routing requestRender through postOnAnimation we can drive
the GLRootView's rendering with the UI thread's coreographer, which
ensures that touch events are processed before drawing
Change-Id: Iac2b3229e9a09ee0319c64c5fc7cb906512a379c
public static final boolean HAS_VIEW_PROPERTY_ANIMATOR =
Build.VERSION.SDK_INT >= VERSION_CODES.HONEYCOMB_MR1;
+ public static final boolean HAS_POST_ON_ANIMATION =
+ Build.VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN;
+
public static int getIntFieldIfExists(Class<?> klass, String fieldName,
Class<?> obj, int defaultVal) {
try {
}
if (mRenderRequested) return;
mRenderRequested = true;
+ if (ApiHelper.HAS_POST_ON_ANIMATION) {
+ postOnAnimation(mRequestRenderOnAnimationFrame);
+ } else {
+ super.requestRender();
+ }
+ }
+
+ private Runnable mRequestRenderOnAnimationFrame = new Runnable() {
+ @Override
+ public void run() {
+ superRequestRender();
+ }
+ };
+
+ private void superRequestRender() {
super.requestRender();
}