From 6af05206f0b71f7a09ed7d9f8763535723796d75 Mon Sep 17 00:00:00 2001 From: Romain Guy Date: Wed, 3 Oct 2012 18:47:21 -0700 Subject: DO NOT MERGE: Do not set the background to null for video. Bug #7275145 Bug 7405595 Removing the window background when it's not visible is a good idea to save on performance. Removing *all* the backgrounds is just a silly idea that leads to weird looking results that drive graphics engineers mad for a day until they figure out that everything is working properly and that the app is simply asking the system to draw whatever garbage is left in the GPU's graphics buffers. Cherry pick the Romain's change from jb-mr1-dev: https://googleplex-android-review.googlesource.com/#/c/234571/ Change-Id: Ief88821319989add5fda57ae7b69cdb01f6ccdf4 --- src/com/android/gallery3d/app/MoviePlayer.java | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) (limited to 'src/com/android') diff --git a/src/com/android/gallery3d/app/MoviePlayer.java b/src/com/android/gallery3d/app/MoviePlayer.java index 9d229f088..85dc4427e 100644 --- a/src/com/android/gallery3d/app/MoviePlayer.java +++ b/src/com/android/gallery3d/app/MoviePlayer.java @@ -74,8 +74,8 @@ public class MoviePlayer implements private static final long RESUMEABLE_TIMEOUT = 3 * 60 * 1000; // 3 mins private Context mContext; - private final VideoView mVideoView; private final View mRootView; + private final VideoView mVideoView; private final Bookmarker mBookmarker; private final Uri mUri; private final Handler mHandler = new Handler(); @@ -104,14 +104,6 @@ public class MoviePlayer implements } }; - private final Runnable mRemoveBackground = new Runnable() { - @SuppressWarnings("deprecation") - @Override - public void run() { - mRootView.setBackgroundDrawable(null); - } - }; - private final Runnable mProgressChecker = new Runnable() { @Override public void run() { @@ -199,19 +191,7 @@ public class MoviePlayer implements if ((diff & View.SYSTEM_UI_FLAG_HIDE_NAVIGATION) != 0 && (visibility & View.SYSTEM_UI_FLAG_HIDE_NAVIGATION) == 0) { mController.show(); - - // We need to set the background to clear ghosting images - // when ActionBar slides in. However, if we keep the background, - // there will be one additional layer in HW composer, which is bad - // to battery. As a solution, we remove the background when we - // hide the action bar - mHandler.removeCallbacks(mRemoveBackground); mRootView.setBackgroundColor(Color.BLACK); - } else { - mHandler.removeCallbacks(mRemoveBackground); - - // Wait for the slide out animation, one second should be enough - mHandler.postDelayed(mRemoveBackground, 1000); } } }); -- cgit v1.2.3