summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcretin45 <cretin45@gmail.com>2014-12-15 16:52:42 -0800
committerSteve Kondik <steve@cyngn.com>2015-03-28 14:56:24 -0700
commit650712e4615d4bbc25b07c11babfe824d7fb6f64 (patch)
tree9a78782901999cab9c41d51378a4fdab32a90c74
parent2deb6f518822055f4b60bbe8afabc938a9023cc9 (diff)
downloadandroid_packages_apps_Gallery2-650712e4615d4bbc25b07c11babfe824d7fb6f64.tar.gz
android_packages_apps_Gallery2-650712e4615d4bbc25b07c11babfe824d7fb6f64.tar.bz2
android_packages_apps_Gallery2-650712e4615d4bbc25b07c11babfe824d7fb6f64.zip
Gallery2: Fix filtershow renderscript for lollipop
* Use the non support version Change-Id: Idce8f3f4741def8dcd080f226cd9a0ef909f7eb1
-rwxr-xr-xAndroid.mk13
-rw-r--r--src/com/android/gallery3d/filtershow/filters/ImageFilter.java2
-rw-r--r--src/com/android/gallery3d/filtershow/filters/ImageFilterChanSat.java14
-rw-r--r--src/com/android/gallery3d/filtershow/filters/ImageFilterGrad.java15
-rw-r--r--src/com/android/gallery3d/filtershow/filters/ImageFilterRS.java8
-rw-r--r--src/com/android/gallery3d/filtershow/filters/ImageFilterSharpen.java2
-rw-r--r--src/com/android/gallery3d/filtershow/filters/ImageFilterVignette.java9
-rw-r--r--src/com/android/gallery3d/filtershow/pipeline/Buffer.java4
-rw-r--r--src/com/android/gallery3d/filtershow/pipeline/CachingPipeline.java5
-rw-r--r--src/com/android/gallery3d/filtershow/pipeline/FilterEnvironment.java2
-rw-r--r--src/com/android/gallery3d/filtershow/pipeline/ImagePreset.java2
-rw-r--r--src/com/android/gallery3d/filtershow/pipeline/PipelineInterface.java4
12 files changed, 35 insertions, 45 deletions
diff --git a/Android.mk b/Android.mk
index 0b471b641..8721c36da 100755
--- a/Android.mk
+++ b/Android.mk
@@ -10,19 +10,8 @@ LOCAL_STATIC_JAVA_LIBRARIES := android-support-v13
LOCAL_STATIC_JAVA_LIBRARIES += com.android.gallery3d.common2
LOCAL_STATIC_JAVA_LIBRARIES += xmp_toolkit
LOCAL_STATIC_JAVA_LIBRARIES += mp4parser
-LOCAL_STATIC_JAVA_LIBRARIES += android-support-v8-renderscript
-LOCAL_RENDERSCRIPT_TARGET_API := 18
-LOCAL_RENDERSCRIPT_COMPATIBILITY := 18
-LOCAL_RENDERSCRIPT_FLAGS := -rs-package-name=android.support.v8.renderscript
-
-# Keep track of previously compiled RS files too (from bundled GalleryGoogle).
-prev_compiled_rs_files := $(call all-renderscript-files-under, src)
-
-# We already have these files from GalleryGoogle, so don't install them.
-LOCAL_RENDERSCRIPT_SKIP_INSTALL := $(prev_compiled_rs_files)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src) $(prev_compiled_rs_files)
+LOCAL_SRC_FILES := $(call all-java-files-under, src) $(call all-renderscript-files-under, src)
LOCAL_SRC_FILES += $(call all-java-files-under, src_pd)
LOCAL_RESOURCE_DIR += $(LOCAL_PATH)/res
diff --git a/src/com/android/gallery3d/filtershow/filters/ImageFilter.java b/src/com/android/gallery3d/filtershow/filters/ImageFilter.java
index 437137416..1fcd3008c 100644
--- a/src/com/android/gallery3d/filtershow/filters/ImageFilter.java
+++ b/src/com/android/gallery3d/filtershow/filters/ImageFilter.java
@@ -19,7 +19,7 @@ package com.android.gallery3d.filtershow.filters;
import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.Matrix;
-import android.support.v8.renderscript.Allocation;
+import android.renderscript.Allocation;
import android.widget.Toast;
import com.android.gallery3d.filtershow.imageshow.GeometryMathUtils;
diff --git a/src/com/android/gallery3d/filtershow/filters/ImageFilterChanSat.java b/src/com/android/gallery3d/filtershow/filters/ImageFilterChanSat.java
index 1ea8edfb8..6c48a6a9f 100644
--- a/src/com/android/gallery3d/filtershow/filters/ImageFilterChanSat.java
+++ b/src/com/android/gallery3d/filtershow/filters/ImageFilterChanSat.java
@@ -18,11 +18,11 @@ package com.android.gallery3d.filtershow.filters;
import android.graphics.Bitmap;
import android.graphics.Matrix;
-import android.support.v8.renderscript.Allocation;
-import android.support.v8.renderscript.Element;
-import android.support.v8.renderscript.RenderScript;
-import android.support.v8.renderscript.Script.LaunchOptions;
-import android.support.v8.renderscript.Type;
+import android.renderscript.Allocation;
+import android.renderscript.Element;
+import android.renderscript.RenderScript;
+import android.renderscript.Script;
+import android.renderscript.Type;
import com.android.gallery3d.R;
import com.android.gallery3d.filtershow.pipeline.FilterEnvironment;
@@ -77,7 +77,7 @@ public class ImageFilterChanSat extends ImageFilterRS {
Type.Builder tb_float = new Type.Builder(rsCtx, Element.F32_4(rsCtx));
tb_float.setX(in.getType().getX());
tb_float.setY(in.getType().getY());
- mScript = new ScriptC_saturation(rsCtx, res, R.raw.saturation);
+ mScript = new ScriptC_saturation(rsCtx);
}
@@ -132,7 +132,7 @@ public class ImageFilterChanSat extends ImageFilterRS {
int width = in.getType().getX();
int height = in.getType().getY();
- LaunchOptions options = new LaunchOptions();
+ Script.LaunchOptions options = new Script.LaunchOptions();
int ty;
options.setX(0, width);
diff --git a/src/com/android/gallery3d/filtershow/filters/ImageFilterGrad.java b/src/com/android/gallery3d/filtershow/filters/ImageFilterGrad.java
index cbdfaa623..7f10af990 100644
--- a/src/com/android/gallery3d/filtershow/filters/ImageFilterGrad.java
+++ b/src/com/android/gallery3d/filtershow/filters/ImageFilterGrad.java
@@ -26,11 +26,12 @@ import com.android.gallery3d.filtershow.pipeline.FilterEnvironment;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.Matrix;
-import android.support.v8.renderscript.Allocation;
-import android.support.v8.renderscript.Element;
-import android.support.v8.renderscript.RenderScript;
-import android.support.v8.renderscript.Script.LaunchOptions;
-import android.support.v8.renderscript.Type;
+
+import android.renderscript.Allocation;
+import android.renderscript.Element;
+import android.renderscript.RenderScript;
+import android.renderscript.Script;
+import android.renderscript.Type;
import android.util.Log;
import com.android.gallery3d.R;
@@ -87,7 +88,7 @@ public class ImageFilterGrad extends ImageFilterRS {
Type.Builder tb_float = new Type.Builder(rsCtx, Element.F32_4(rsCtx));
tb_float.setX(in.getType().getX());
tb_float.setY(in.getType().getY());
- mScript = new ScriptC_grad(rsCtx, res, R.raw.grad);
+ mScript = new ScriptC_grad(rsCtx);
}
@@ -161,7 +162,7 @@ public class ImageFilterGrad extends ImageFilterRS {
int width = in.getType().getX();
int height = in.getType().getY();
- LaunchOptions options = new LaunchOptions();
+ Script.LaunchOptions options = new Script.LaunchOptions();
int ty;
options.setX(0, width);
diff --git a/src/com/android/gallery3d/filtershow/filters/ImageFilterRS.java b/src/com/android/gallery3d/filtershow/filters/ImageFilterRS.java
index 9a494d823..b7c4d80e0 100644
--- a/src/com/android/gallery3d/filtershow/filters/ImageFilterRS.java
+++ b/src/com/android/gallery3d/filtershow/filters/ImageFilterRS.java
@@ -18,7 +18,10 @@ package com.android.gallery3d.filtershow.filters;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
-import android.support.v8.renderscript.*;
+import android.renderscript.Allocation;
+import android.renderscript.Element;
+import android.renderscript.RenderScript;
+import android.renderscript.Type;
import android.util.Log;
import android.content.res.Resources;
import com.android.gallery3d.R;
@@ -159,8 +162,7 @@ public abstract class ImageFilterRS extends ImageFilter {
private static Allocation convertRGBAtoA(RenderScript RS, Bitmap bitmap) {
if (RS != mRScache || mGreyConvert == null) {
- mGreyConvert = new ScriptC_grey(RS, RS.getApplicationContext().getResources(),
- R.raw.grey);
+ mGreyConvert = new ScriptC_grey(RS);
mRScache = RS;
}
diff --git a/src/com/android/gallery3d/filtershow/filters/ImageFilterSharpen.java b/src/com/android/gallery3d/filtershow/filters/ImageFilterSharpen.java
index 418afc40f..bfec89f6b 100644
--- a/src/com/android/gallery3d/filtershow/filters/ImageFilterSharpen.java
+++ b/src/com/android/gallery3d/filtershow/filters/ImageFilterSharpen.java
@@ -64,7 +64,7 @@ public class ImageFilterSharpen extends ImageFilterRS {
protected void createFilter(android.content.res.Resources res, float scaleFactor,
int quality) {
if (mScript == null) {
- mScript = new ScriptC_convolve3x3(getRenderScriptContext(), res, R.raw.convolve3x3);
+ mScript = new ScriptC_convolve3x3(getRenderScriptContext());
}
}
diff --git a/src/com/android/gallery3d/filtershow/filters/ImageFilterVignette.java b/src/com/android/gallery3d/filtershow/filters/ImageFilterVignette.java
index 49ac5959c..279bd1857 100644
--- a/src/com/android/gallery3d/filtershow/filters/ImageFilterVignette.java
+++ b/src/com/android/gallery3d/filtershow/filters/ImageFilterVignette.java
@@ -24,11 +24,8 @@ import android.graphics.Rect;
import com.android.gallery3d.R;
import com.android.gallery3d.filtershow.imageshow.MasterImage;
import com.android.gallery3d.filtershow.pipeline.FilterEnvironment;
-import android.support.v8.renderscript.Allocation;
-import android.support.v8.renderscript.Element;
-import android.support.v8.renderscript.RenderScript;
-import android.support.v8.renderscript.Script.LaunchOptions;
-import android.support.v8.renderscript.Type;
+
+import android.renderscript.RenderScript;
import android.util.Log;
public class ImageFilterVignette extends ImageFilterRS {
@@ -79,7 +76,7 @@ public class ImageFilterVignette extends ImageFilterRS {
protected void createFilter(Resources res, float scaleFactor, int quality) {
RenderScript rsCtx = getRenderScriptContext();
- mScript = new ScriptC_vignette(rsCtx, res, R.raw.vignette);
+ mScript = new ScriptC_vignette(rsCtx);
}
@Override
diff --git a/src/com/android/gallery3d/filtershow/pipeline/Buffer.java b/src/com/android/gallery3d/filtershow/pipeline/Buffer.java
index c378eb994..a487a5d8d 100644
--- a/src/com/android/gallery3d/filtershow/pipeline/Buffer.java
+++ b/src/com/android/gallery3d/filtershow/pipeline/Buffer.java
@@ -18,8 +18,8 @@ package com.android.gallery3d.filtershow.pipeline;
import android.graphics.Bitmap;
import android.graphics.Canvas;
-import android.support.v8.renderscript.Allocation;
-import android.support.v8.renderscript.RenderScript;
+import android.renderscript.Allocation;
+import android.renderscript.RenderScript;
import android.util.Log;
import com.android.gallery3d.filtershow.cache.BitmapCache;
import com.android.gallery3d.filtershow.imageshow.MasterImage;
diff --git a/src/com/android/gallery3d/filtershow/pipeline/CachingPipeline.java b/src/com/android/gallery3d/filtershow/pipeline/CachingPipeline.java
index 8ae9a7c7b..e8c9b0f5c 100644
--- a/src/com/android/gallery3d/filtershow/pipeline/CachingPipeline.java
+++ b/src/com/android/gallery3d/filtershow/pipeline/CachingPipeline.java
@@ -24,8 +24,9 @@ import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.RectF;
-import android.support.v8.renderscript.Allocation;
-import android.support.v8.renderscript.RenderScript;
+
+import android.renderscript.Allocation;
+import android.renderscript.RenderScript;
import android.util.Log;
import com.android.gallery3d.filtershow.cache.BitmapCache;
diff --git a/src/com/android/gallery3d/filtershow/pipeline/FilterEnvironment.java b/src/com/android/gallery3d/filtershow/pipeline/FilterEnvironment.java
index ebf83b720..0b84f5203 100644
--- a/src/com/android/gallery3d/filtershow/pipeline/FilterEnvironment.java
+++ b/src/com/android/gallery3d/filtershow/pipeline/FilterEnvironment.java
@@ -18,7 +18,7 @@ package com.android.gallery3d.filtershow.pipeline;
import android.graphics.Bitmap;
import android.graphics.Canvas;
-import android.support.v8.renderscript.Allocation;
+import android.renderscript.Allocation;
import com.android.gallery3d.app.Log;
import com.android.gallery3d.filtershow.cache.BitmapCache;
diff --git a/src/com/android/gallery3d/filtershow/pipeline/ImagePreset.java b/src/com/android/gallery3d/filtershow/pipeline/ImagePreset.java
index 18321f567..1460ad434 100644
--- a/src/com/android/gallery3d/filtershow/pipeline/ImagePreset.java
+++ b/src/com/android/gallery3d/filtershow/pipeline/ImagePreset.java
@@ -18,7 +18,7 @@ package com.android.gallery3d.filtershow.pipeline;
import android.graphics.Bitmap;
import android.graphics.Rect;
-import android.support.v8.renderscript.Allocation;
+import android.renderscript.Allocation;
import android.util.JsonReader;
import android.util.JsonWriter;
import android.util.Log;
diff --git a/src/com/android/gallery3d/filtershow/pipeline/PipelineInterface.java b/src/com/android/gallery3d/filtershow/pipeline/PipelineInterface.java
index d53768c95..ad59e0c44 100644
--- a/src/com/android/gallery3d/filtershow/pipeline/PipelineInterface.java
+++ b/src/com/android/gallery3d/filtershow/pipeline/PipelineInterface.java
@@ -18,8 +18,8 @@ package com.android.gallery3d.filtershow.pipeline;
import android.content.res.Resources;
import android.graphics.Bitmap;
-import android.support.v8.renderscript.Allocation;
-import android.support.v8.renderscript.RenderScript;
+import android.renderscript.Allocation;
+import android.renderscript.RenderScript;
public interface PipelineInterface {
public String getName();