[Android] no bitmap reuse before HoneyComb

Geoffrey Métais git at videolan.org
Thu Sep 10 12:03:52 CEST 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Sep 10 12:01:55 2015 +0200| [9268a12ad4528cbc125069d3727f0eeb9fd11477] | committer: Geoffrey Métais

no bitmap reuse before HoneyComb

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=9268a12ad4528cbc125069d3727f0eeb9fd11477
---

 vlc-android/src/org/videolan/vlc/util/BitmapCache.java |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/util/BitmapCache.java b/vlc-android/src/org/videolan/vlc/util/BitmapCache.java
index a836361..6f278eb 100644
--- a/vlc-android/src/org/videolan/vlc/util/BitmapCache.java
+++ b/vlc-android/src/org/videolan/vlc/util/BitmapCache.java
@@ -84,7 +84,7 @@ public class BitmapCache {
             protected void entryRemoved(boolean evicted, String key, CacheableBitmap oldValue, CacheableBitmap newValue) {
                 if (evicted) {
                     mCachedBitmaps.remove(oldValue.getReference());
-                    if (oldValue.get() != null && !TextUtils.equals(key, CONE_KEY) && !TextUtils.equals(key, CONE_O_KEY))
+                    if (mReusableBitmaps != null && oldValue.get() != null && !TextUtils.equals(key, CONE_KEY) && !TextUtils.equals(key, CONE_O_KEY))
                         addReusableBitmapRef(oldValue.getReference());
                 }
             }
@@ -152,7 +152,7 @@ public class BitmapCache {
         return bitmap;
     }
 
-    public synchronized void addReusableBitmapRef(SoftReference<Bitmap> ref){
+    private synchronized void addReusableBitmapRef(SoftReference<Bitmap> ref){
         mReusableBitmaps.add(ref);
     }
 



More information about the Android mailing list