am 4134ce33: Merge "Fix blur intrinsic creation." into jb-mr2-dev

* commit '4134ce3386e791bd2e024677197e36a3b4768dbb':
  Fix blur intrinsic creation.
This commit is contained in:
Tim Murray
2013-04-01 13:29:57 -07:00
committed by Android Git Automerger
3 changed files with 3 additions and 3 deletions

View File

@@ -46,7 +46,7 @@ public final class ScriptIntrinsicBlur extends ScriptIntrinsic {
* @return ScriptIntrinsicBlur
*/
public static ScriptIntrinsicBlur create(RenderScript rs, Element e) {
if ((e != Element.U8_4(rs)) && e != (Element.U8(rs))) {
if ((!e.isCompatible(Element.U8_4(rs))) && (!e.isCompatible(Element.U8(rs)))) {
throw new RSIllegalArgumentException("Unsuported element type.");
}
int id = rs.nScriptIntrinsicCreate(5, e.getID(rs));

View File

@@ -47,7 +47,7 @@ public final class ScriptIntrinsicColorMatrix extends ScriptIntrinsic {
* @return ScriptIntrinsicColorMatrix
*/
public static ScriptIntrinsicColorMatrix create(RenderScript rs, Element e) {
if (e != Element.U8_4(rs)) {
if (!e.isCompatible(Element.U8_4(rs))) {
throw new RSIllegalArgumentException("Unsuported element type.");
}
int id = rs.nScriptIntrinsicCreate(2, e.getID(rs));

View File

@@ -48,7 +48,7 @@ public final class ScriptIntrinsicConvolve3x3 extends ScriptIntrinsic {
*/
public static ScriptIntrinsicConvolve3x3 create(RenderScript rs, Element e) {
float f[] = { 0, 0, 0, 0, 1, 0, 0, 0, 0};
if (e != Element.U8_4(rs)) {
if (!e.isCompatible(Element.U8_4(rs))) {
throw new RSIllegalArgumentException("Unsuported element type.");
}
int id = rs.nScriptIntrinsicCreate(1, e.getID(rs));