Merge "Fix blur intrinsic creation." into jb-mr2-dev
This commit is contained in:
@@ -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));
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user