diff options
author | The Android Automerger <android-build@android.com> | 2010-06-08 14:09:01 -0700 |
---|---|---|
committer | The Android Automerger <android-build@android.com> | 2010-06-08 14:09:01 -0700 |
commit | 18a4c04193113b582e344ad65c7d7c8764743d59 (patch) | |
tree | 9245e0808b7c751265e9b9f98c7547b79b83132c | |
parent | 646ef6549c2928ff24a4f88720c40dd2511e21f6 (diff) | |
parent | 71d73a0dfc110d0bdfc1b7ba385db3e2cfe007e5 (diff) | |
download | base-18a4c04193113b582e344ad65c7d7c8764743d59.tar.gz |
Merge branch 'froyo' into froyo-release
-rw-r--r-- | core/java/android/view/SurfaceView.java | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/core/java/android/view/SurfaceView.java b/core/java/android/view/SurfaceView.java index 2a3f03269cd9..53f0c2e5f917 100644 --- a/core/java/android/view/SurfaceView.java +++ b/core/java/android/view/SurfaceView.java @@ -16,6 +16,7 @@ package android.view; +import android.util.DisplayMetrics; import com.android.internal.view.BaseIWindow; import android.content.Context; @@ -212,6 +213,46 @@ public class SurfaceView extends View { mRequestedVisible = mWindowVisibility && mViewVisibility; updateWindow(false); } + + /** + * This method is not intended for general use. It was created + * temporarily to improve performance of 3D layers in Launcher + * and should be removed and fixed properly. + * + * Do not call this method. Ever. + * + * @hide + */ + protected void showSurface() { + if (mSession != null) { + updateWindow(true); + } + } + + /** + * This method is not intended for general use. It was created + * temporarily to improve performance of 3D layers in Launcher + * and should be removed and fixed properly. + * + * Do not call this method. Ever. + * + * @hide + */ + protected void hideSurface() { + if (mSession != null && mWindow != null) { + mSurfaceLock.lock(); + try { + DisplayMetrics metrics = getResources().getDisplayMetrics(); + mLayout.x = metrics.widthPixels * 3; + mSession.relayout(mWindow, mLayout, mWidth, mHeight, VISIBLE, false, + mWinFrame, mContentInsets, mVisibleInsets, mConfiguration, mSurface); + } catch (RemoteException e) { + // Ignore + } finally { + mSurfaceLock.unlock(); + } + } + } @Override protected void onDetachedFromWindow() { |