diff options
author | nicolasroard <nicolasroard@google.com> | 2013-02-08 14:06:33 -0800 |
---|---|---|
committer | nicolasroard <nicolasroard@google.com> | 2013-02-08 14:52:05 -0800 |
commit | 47dbc0eb95c69d5eae633933af36cfcced5cd190 (patch) | |
tree | de4c1d27a950f3926a1c73e246487229904aac38 /src | |
parent | 494b481c99ac03f207835d00f1bab488419828c0 (diff) | |
download | android_packages_apps_Snap-47dbc0eb95c69d5eae633933af36cfcced5cd190.tar.gz android_packages_apps_Snap-47dbc0eb95c69d5eae633933af36cfcced5cd190.tar.bz2 android_packages_apps_Snap-47dbc0eb95c69d5eae633933af36cfcced5cd190.zip |
Fix leaks / init
Change-Id: I5befdc24cc89cdcfb73ee4d13f076b1c4a585cf6
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/gallery3d/filtershow/filters/FilterImageBorderRepresentation.java | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/src/com/android/gallery3d/filtershow/filters/FilterImageBorderRepresentation.java b/src/com/android/gallery3d/filtershow/filters/FilterImageBorderRepresentation.java index 467409fb8..2b40fccc0 100644 --- a/src/com/android/gallery3d/filtershow/filters/FilterImageBorderRepresentation.java +++ b/src/com/android/gallery3d/filtershow/filters/FilterImageBorderRepresentation.java @@ -16,18 +16,18 @@ package com.android.gallery3d.filtershow.filters; -import android.graphics.drawable.Drawable; - public class FilterImageBorderRepresentation extends FilterRepresentation { - private Drawable mDrawable; private int mDrawableResource = 0; - public FilterImageBorderRepresentation(int drawableResource, Drawable drawable) { + public FilterImageBorderRepresentation(int drawableResource) { super("ImageBorder"); mDrawableResource = drawableResource; - mDrawable = drawable; setFilterClass(ImageFilterBorder.class); setPriority(ImageFilter.TYPE_BORDER); + // load the drawable at init as we are in a background thread + // (see FilterShowActivity's LoadBordersTask) + ImageFilterBorder filter = (ImageFilterBorder) FiltersManager.getManager().getFilter(getFilterClass()); + filter.getDrawable(getDrawableResource()); } public String toString() { @@ -38,7 +38,6 @@ public class FilterImageBorderRepresentation extends FilterRepresentation { public FilterRepresentation clone() throws CloneNotSupportedException { FilterImageBorderRepresentation representation = (FilterImageBorderRepresentation) super.clone(); representation.setName(getName()); - representation.setDrawable(getDrawable()); representation.setDrawableResource(getDrawableResource()); return representation; } @@ -47,7 +46,6 @@ public class FilterImageBorderRepresentation extends FilterRepresentation { if (a instanceof FilterImageBorderRepresentation) { FilterImageBorderRepresentation representation = (FilterImageBorderRepresentation) a; setName(representation.getName()); - setDrawable(representation.getDrawable()); setDrawableResource(representation.getDrawableResource()); } } @@ -70,14 +68,6 @@ public class FilterImageBorderRepresentation extends FilterRepresentation { return true; } - public Drawable getDrawable() { - return mDrawable; - } - - public void setDrawable(Drawable drawable) { - mDrawable = drawable; - } - public int getDrawableResource() { return mDrawableResource; } |