summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/filtershow/pipeline/SharedBuffer.java
diff options
context:
space:
mode:
authornicolasroard <nicolasroard@google.com>2013-08-15 09:58:50 -0700
committernicolasroard <nicolasroard@google.com>2013-08-15 09:58:50 -0700
commitbd9a4acc7a9b607d18d08cb2199d46afa023548b (patch)
tree985436d651cfd13e405b865a1786db964dfdba28 /src/com/android/gallery3d/filtershow/pipeline/SharedBuffer.java
parent2228e7f0000db4c3f7fb92519f9f4c2856dd47a1 (diff)
downloadandroid_packages_apps_Gallery2-bd9a4acc7a9b607d18d08cb2199d46afa023548b.tar.gz
android_packages_apps_Gallery2-bd9a4acc7a9b607d18d08cb2199d46afa023548b.tar.bz2
android_packages_apps_Gallery2-bd9a4acc7a9b607d18d08cb2199d46afa023548b.zip
Improves bitmap reuse / memory usage
bug:8782701 Change-Id: Ic655d6f1704dd0429e96819566f50927de02b994
Diffstat (limited to 'src/com/android/gallery3d/filtershow/pipeline/SharedBuffer.java')
-rw-r--r--src/com/android/gallery3d/filtershow/pipeline/SharedBuffer.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/com/android/gallery3d/filtershow/pipeline/SharedBuffer.java b/src/com/android/gallery3d/filtershow/pipeline/SharedBuffer.java
index 98e69f60e..871e4cd6c 100644
--- a/src/com/android/gallery3d/filtershow/pipeline/SharedBuffer.java
+++ b/src/com/android/gallery3d/filtershow/pipeline/SharedBuffer.java
@@ -30,6 +30,11 @@ public class SharedBuffer {
private volatile boolean mNeedsRepaint = true;
public void setProducer(Bitmap producer) {
+ synchronized (this) {
+ if (mProducer != null) {
+ mProducer.remove();
+ }
+ }
Buffer buffer = new Buffer(producer);
synchronized (this) {
mProducer = buffer;