summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/filtershow/filters/FilterImageBorderRepresentation.java
diff options
context:
space:
mode:
authornicolasroard <nicolasroard@google.com>2013-02-08 14:06:33 -0800
committernicolasroard <nicolasroard@google.com>2013-02-08 14:52:05 -0800
commitdeeddb19c78a4299cc0e4075ed0265820eeb20f0 (patch)
treea0f103eeeb1434d6dcbe27bc12ccea0e190d5312 /src/com/android/gallery3d/filtershow/filters/FilterImageBorderRepresentation.java
parentb7e69915ebc7fa89398649ec03e9aa619e9d9991 (diff)
downloadandroid_packages_apps_Snap-deeddb19c78a4299cc0e4075ed0265820eeb20f0.tar.gz
android_packages_apps_Snap-deeddb19c78a4299cc0e4075ed0265820eeb20f0.tar.bz2
android_packages_apps_Snap-deeddb19c78a4299cc0e4075ed0265820eeb20f0.zip
Fix leaks / init
Change-Id: I5befdc24cc89cdcfb73ee4d13f076b1c4a585cf6
Diffstat (limited to 'src/com/android/gallery3d/filtershow/filters/FilterImageBorderRepresentation.java')
-rw-r--r--src/com/android/gallery3d/filtershow/filters/FilterImageBorderRepresentation.java20
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;
}