OSDN Git Service

Only create one RS context.
authorTim Murray <timmurray@google.com>
Mon, 11 Feb 2013 23:29:20 +0000 (15:29 -0800)
committerTim Murray <timmurray@google.com>
Mon, 11 Feb 2013 23:29:20 +0000 (15:29 -0800)
Change-Id: I527da839142cd2e48fb81e8cb02b43f6f87147d6

src/com/android/gallery3d/filtershow/filters/ImageFilterRS.java

index 4778d3c..79c783a 100644 (file)
@@ -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();