From e26d9fc2876bec60d5fb09c58efaa715ef6ab2fb Mon Sep 17 00:00:00 2001 From: Jason Sams Date: Thu, 12 Nov 2009 14:00:43 -0800 Subject: Update AllApps to defered surface attachment for RS. --- src/com/android/launcher2/AllAppsView.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/com/android/launcher2/AllAppsView.java') diff --git a/src/com/android/launcher2/AllAppsView.java b/src/com/android/launcher2/AllAppsView.java index 8ee995cfe..baa717489 100644 --- a/src/com/android/launcher2/AllAppsView.java +++ b/src/com/android/launcher2/AllAppsView.java @@ -157,6 +157,13 @@ public class AllAppsView extends RSSurfaceView setOnLongClickListener(this); setZOrderOnTop(true); getHolder().setFormat(PixelFormat.TRANSLUCENT); + + mRS = createRenderScript(true); + } + + @Override + protected void onDetachedFromWindow() { + destroyRenderScript(); } /** @@ -192,8 +199,7 @@ public class AllAppsView extends RSSurfaceView super.surfaceChanged(holder, format, w, h); - if (mRS == null) { - mRS = createRenderScript(true); + if (mRollo == null) { mRollo = new RolloRS(); mRollo.mHasSurface = true; mRollo.init(getResources(), w, h); @@ -204,11 +210,10 @@ public class AllAppsView extends RSSurfaceView gainFocus(); mShouldGainFocus = false; } - mRollo.dirtyCheck(); } else { mRollo.mHasSurface = true; - mRollo.dirtyCheck(); } + mRollo.dirtyCheck(); mRS.mMessageCallback = mMessageProc = new AAMessage(); @@ -298,7 +303,7 @@ public class AllAppsView extends RSSurfaceView public boolean onKeyDown(int keyCode, KeyEvent event) { boolean handled = false; - + if (!isVisible()) { return false; } -- cgit v1.2.3