diff options
author | nicolasroard <nicolasroard@google.com> | 2013-03-11 19:16:03 -0700 |
---|---|---|
committer | nicolasroard <nicolasroard@google.com> | 2013-03-11 19:22:46 -0700 |
commit | 8d2c7ee02c8fde53effc787c172b10b14ae34d42 (patch) | |
tree | 7a74e382a46df21937a64083090cdf69c26a52cc /src/com/android/gallery3d/filtershow/filters/FilterFxRepresentation.java | |
parent | 001283a72d451999e3308f45dc365d4defc0af39 (diff) | |
download | android_packages_apps_Gallery2-8d2c7ee02c8fde53effc787c172b10b14ae34d42.tar.gz android_packages_apps_Gallery2-8d2c7ee02c8fde53effc787c172b10b14ae34d42.tar.bz2 android_packages_apps_Gallery2-8d2c7ee02c8fde53effc787c172b10b14ae34d42.zip |
Various bugfixes/improvements for Fx Filters:
- fix bug in history with Fx filters
- don't load Fx bitmaps at startup
- free bitmaps when unneeded
- fix history preview bitmaps
Change-Id: I5631a5bcec12c121871b3575066c201486896a14
Diffstat (limited to 'src/com/android/gallery3d/filtershow/filters/FilterFxRepresentation.java')
-rw-r--r-- | src/com/android/gallery3d/filtershow/filters/FilterFxRepresentation.java | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/src/com/android/gallery3d/filtershow/filters/FilterFxRepresentation.java b/src/com/android/gallery3d/filtershow/filters/FilterFxRepresentation.java index d4128dc79..6e2e7ea16 100644 --- a/src/com/android/gallery3d/filtershow/filters/FilterFxRepresentation.java +++ b/src/com/android/gallery3d/filtershow/filters/FilterFxRepresentation.java @@ -17,10 +17,11 @@ package com.android.gallery3d.filtershow.filters; import android.graphics.Bitmap; +import com.android.gallery3d.app.Log; import com.android.gallery3d.filtershow.editors.ImageOnlyEditor; public class FilterFxRepresentation extends FilterRepresentation { - private Bitmap mFxBitmap = null; + private static final String LOGTAG = "FilterFxRepresentation"; // TODO: When implementing serialization, we should find a unique way of // specifying bitmaps / names (the resource IDs being random) private int mBitmapResource = 0; @@ -41,26 +42,24 @@ public class FilterFxRepresentation extends FilterRepresentation { } public String toString() { - return "FilterFx: " + getName(); + return "FilterFx: " + hashCode() + " : " + getName() + " bitmap rsc: " + mBitmapResource; } @Override - public FilterRepresentation clone() throws CloneNotSupportedException { + public synchronized FilterRepresentation clone() throws CloneNotSupportedException { FilterFxRepresentation representation = (FilterFxRepresentation) super.clone(); representation.setName(getName()); representation.setBitmapResource(getBitmapResource()); representation.setNameResource(getNameResource()); - representation.setFxBitmap(getFxBitmap()); return representation; } - public void useParametersFrom(FilterRepresentation a) { + public synchronized void useParametersFrom(FilterRepresentation a) { if (a instanceof FilterFxRepresentation) { FilterFxRepresentation representation = (FilterFxRepresentation) a; setName(representation.getName()); setBitmapResource(representation.getBitmapResource()); setNameResource(representation.getNameResource()); - setFxBitmap(representation.getFxBitmap()); } } @@ -79,16 +78,15 @@ public class FilterFxRepresentation extends FilterRepresentation { return false; } - public boolean allowsMultipleInstances() { - return true; - } - - public Bitmap getFxBitmap() { - return mFxBitmap; + public boolean same(FilterRepresentation representation) { + if (!super.same(representation)) { + return false; + } + return equals(representation); } - public void setFxBitmap(Bitmap fxBitmap) { - mFxBitmap = fxBitmap; + public boolean allowsMultipleInstances() { + return true; } public int getNameResource() { |