Implement workaround for GL driver which is slow to render the first frame with new state. This change will render a transparent frame when receiving new state to warm the driver.
diff --git a/src/com/android/launcher2/AllAppsView.java b/src/com/android/launcher2/AllAppsView.java
index 27afaf4..fdbc841 100644
--- a/src/com/android/launcher2/AllAppsView.java
+++ b/src/com/android/launcher2/AllAppsView.java
@@ -507,6 +507,7 @@
private Script.Invokable[] mInvokeMove = new Script.Invokable[4];
private Script.Invokable[] mInvokeFling = new Script.Invokable[4];
+ private Script.Invokable[] mInvokeResetWAR = new Script.Invokable[4];
private ProgramStore mPSIcons;
private ProgramStore mPSText;
@@ -827,6 +828,7 @@
sb.setType(mState.mType, "state", Defines.ALLOC_STATE);
mInvokeMove[idx] = sb.addInvokable("move");
mInvokeFling[idx] = sb.addInvokable("fling");
+ mInvokeResetWAR[idx] = sb.addInvokable("resetHWWar");
mScript[idx] = sb.create();
mScript[idx].setClearColor(0.0f, 0.0f, 0.0f, 0.0f);
mScript[idx].bindAllocation(mParams.mAlloc, Defines.ALLOC_PARAMS);
@@ -970,6 +972,10 @@
// Note: mScript may be null if we haven't initialized it yet.
// In that case, this is a no-op.
+ if (mInvokeResetWAR != null &&
+ mInvokeResetWAR[mViewMode] != null) {
+ mInvokeResetWAR[mViewMode].execute();
+ }
mRS.contextBindRootScript(mScript[mViewMode]);
}