summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Murray <timmurray@google.com>2013-02-11 15:29:20 -0800
committerTim Murray <timmurray@google.com>2013-02-11 15:29:20 -0800
commit3adce2f354258282f9c0e19667786ea79481feeb (patch)
tree1523124d158975c752e7d69cdfac445f502d1945
parentcef56e96ff49a90d032699ed06b9991fc8486d2a (diff)
downloadandroid_packages_apps_Snap-3adce2f354258282f9c0e19667786ea79481feeb.tar.gz
android_packages_apps_Snap-3adce2f354258282f9c0e19667786ea79481feeb.tar.bz2
android_packages_apps_Snap-3adce2f354258282f9c0e19667786ea79481feeb.zip
Only create one RS context.
Change-Id: I527da839142cd2e48fb81e8cb02b43f6f87147d6
-rw-r--r--src/com/android/gallery3d/filtershow/filters/ImageFilterRS.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/com/android/gallery3d/filtershow/filters/ImageFilterRS.java b/src/com/android/gallery3d/filtershow/filters/ImageFilterRS.java
index 4778d3c08..79c783a94 100644
--- a/src/com/android/gallery3d/filtershow/filters/ImageFilterRS.java
+++ b/src/com/android/gallery3d/filtershow/filters/ImageFilterRS.java
@@ -92,7 +92,9 @@ public class ImageFilterRS extends ImageFilter {
}
public static void setRenderScriptContext(Activity context) {
- mRS = RenderScript.create(context);
+ if (mRS == null) {
+ mRS = RenderScript.create(context);
+ }
mResources = context.getResources();
if (mInPixelsAllocation != null) {
mInPixelsAllocation.destroy();