summaryrefslogtreecommitdiffstats
path: root/src
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 /src
parent2deb6f518822055f4b60bbe8afabc938a9023cc9 (diff)
downloadandroid_packages_apps_Gallery2-650712e4615d4bbc25b07c11babfe824d7fb6f64.zip
android_packages_apps_Gallery2-650712e4615d4bbc25b07c11babfe824d7fb6f64.tar.gz
android_packages_apps_Gallery2-650712e4615d4bbc25b07c11babfe824d7fb6f64.tar.bz2
Gallery2: Fix filtershow renderscript for lollipop
* Use the non support version Change-Id: Idce8f3f4741def8dcd080f226cd9a0ef909f7eb1
Diffstat (limited to 'src')
-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
11 files changed, 34 insertions, 33 deletions
diff --git a/src/com/android/gallery3d/filtershow/filters/ImageFilter.java b/src/com/android/gallery3d/filtershow/filters/ImageFilter.java
index 4371374..1fcd300 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 1ea8edf..6c48a6a 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 cbdfaa6..7f10af9 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 9a494d8..b7c4d80 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 418afc4..bfec89f 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 49ac595..279bd18 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 c378eb9..a487a5d 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 8ae9a7c..e8c9b0f 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 ebf83b7..0b84f52 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 18321f5..1460ad4 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 d53768c..ad59e0c 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();