summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorChao Zhang <chaoz@codeaurora.org>2016-05-10 16:39:26 +0800
committerLikai Ding <likaid@codeaurora.org>2016-06-14 14:55:14 +0800
commit2b08697bfefadf0cac06b109d2cf07ae35e37ec8 (patch)
tree5c41eefc5bc6e0f148f7b628d14af6a2177b02b7 /src/com
parent5101dc6a483777a87e5cfaa61d3996eab2ee6219 (diff)
downloadandroid_packages_apps_Gallery2-2b08697bfefadf0cac06b109d2cf07ae35e37ec8.tar.gz
android_packages_apps_Gallery2-2b08697bfefadf0cac06b109d2cf07ae35e37ec8.tar.bz2
android_packages_apps_Gallery2-2b08697bfefadf0cac06b109d2cf07ae35e37ec8.zip
Gallery2: fix sharpness in photo editor doesn't work.
Use ScriptIntrinsicConvolve3x3 instead local rs file. Change-Id: Ib7c2c36f9571fe5b6d1e50a2ddc26a40e89e2144 CRs-Fixed: 960252
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/gallery3d/filtershow/filters/ImageFilterSharpen.java21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/com/android/gallery3d/filtershow/filters/ImageFilterSharpen.java b/src/com/android/gallery3d/filtershow/filters/ImageFilterSharpen.java
index 4881d54e0..95f8fd258 100644
--- a/src/com/android/gallery3d/filtershow/filters/ImageFilterSharpen.java
+++ b/src/com/android/gallery3d/filtershow/filters/ImageFilterSharpen.java
@@ -16,13 +16,16 @@
package com.android.gallery3d.filtershow.filters;
-import org.codeaurora.gallery.R;
+import android.renderscript.Element;
+import android.renderscript.ScriptIntrinsicConvolve3x3;
+
import com.android.gallery3d.filtershow.editors.BasicEditor;
+import org.codeaurora.gallery.R;
public class ImageFilterSharpen extends ImageFilterRS {
private static final String SERIALIZATION_NAME = "SHARPEN";
private static final String LOGTAG = "ImageFilterSharpen";
- private ScriptC_convolve3x3 mScript;
+ private ScriptIntrinsicConvolve3x3 mScript;
private FilterBasicRepresentation mParameters;
@@ -63,7 +66,8 @@ 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());
+ mScript = ScriptIntrinsicConvolve3x3.create(getRenderScriptContext(),
+ Element.RGBA_8888(getRenderScriptContext()));
}
}
@@ -81,15 +85,11 @@ public class ImageFilterSharpen extends ImageFilterRS {
f[6] = -p;
f[7] = -p;
f[8] = -p;
- mScript.set_gCoeffs(f);
+ mScript.setCoefficients(f);
}
@Override
protected void bindScriptValues() {
- int w = getInPixelsAllocation().getType().getX();
- int h = getInPixelsAllocation().getType().getY();
- mScript.set_gWidth(w);
- mScript.set_gHeight(h);
}
@Override
@@ -98,9 +98,8 @@ public class ImageFilterSharpen extends ImageFilterRS {
return;
}
computeKernel();
- mScript.set_gIn(getInPixelsAllocation());
- mScript.bind_gPixels(getInPixelsAllocation());
- mScript.forEach_root(getInPixelsAllocation(), getOutPixelsAllocation());
+ mScript.setInput(getInPixelsAllocation());
+ mScript.forEach(getOutPixelsAllocation());
}
}