FileDocCategorySizeDatePackage
RenderScriptThunker.javaAPI DocAndroid 5.1 API4826Thu Mar 12 22:22:56 GMT 2015android.support.v8.renderscript

RenderScriptThunker

public class RenderScriptThunker extends RenderScript

Fields Summary
android.renderscript.RenderScript
mN
Constructors Summary
RenderScriptThunker(android.content.Context ctx)

        super(ctx);
        isNative = true;
    
Methods Summary
public voidcontextDump()

        try {
            mN.contextDump();
        } catch (android.renderscript.RSRuntimeException e) {
            throw ExceptionThunker.convertException(e);
        }
    
public static RenderScriptcreate(android.content.Context ctx, int sdkVersion)

        try {
            RenderScriptThunker rs = new RenderScriptThunker(ctx);
            Class<?> javaRS = Class.forName("android.renderscript.RenderScript");
            Class[] signature = {Context.class, Integer.TYPE};
            Object[] args = {ctx, new Integer(sdkVersion)};
            Method create = javaRS.getDeclaredMethod("create", signature);
            rs.mN = (android.renderscript.RenderScript)create.invoke(null, args);
            return rs;
        }
        catch(android.renderscript.RSRuntimeException e) {
            throw ExceptionThunker.convertException(e);
        } catch (Exception e) {
            throw new RSRuntimeException("Failure to create platform RenderScript context");
        }
    
public voiddestroy()

        try {
            mN.destroy();
            mN = null;
        } catch (android.renderscript.RSRuntimeException e) {
            throw ExceptionThunker.convertException(e);
        }

    
booleanequals(java.lang.Object obj1, java.lang.Object obj2)

        if (obj2 instanceof android.support.v8.renderscript.BaseObj) {
            return ((android.renderscript.BaseObj)obj1).equals(((android.support.v8.renderscript.BaseObj)obj2).getNObj());
        }
        return false;
    
public voidfinish()

        try {
            mN.finish();
        } catch (android.renderscript.RSRuntimeException e) {
            throw ExceptionThunker.convertException(e);
        }
    
public voidsetErrorHandler(RSErrorHandler msg)

        mErrorCallback = msg;
        try {
            android.renderscript.RenderScript.RSErrorHandler handler =
                new android.renderscript.RenderScript.RSErrorHandler() {
                    public void run() {
                        mErrorCallback.mErrorMessage = mErrorMessage;
                        mErrorCallback.mErrorNum = mErrorNum;
                        mErrorCallback.run();
                    }
                };
            mN.setErrorHandler(handler);
        } catch (android.renderscript.RSRuntimeException e) {
            throw ExceptionThunker.convertException(e);
        }
    
public voidsetMessageHandler(RSMessageHandler msg)

        mMessageCallback = msg;
        try {
            android.renderscript.RenderScript.RSMessageHandler handler =
                new android.renderscript.RenderScript.RSMessageHandler() {
                    public void run() {
                        mMessageCallback.mData = mData;
                        mMessageCallback.mID = mID;
                        mMessageCallback.mLength = mLength;
                        mMessageCallback.run();
                    }
                };
            mN.setMessageHandler(handler);
        } catch (android.renderscript.RSRuntimeException e) {
            throw ExceptionThunker.convertException(e);
        }
    
public voidsetPriority(Priority p)

        try {
            if (p == Priority.LOW) mN.setPriority(android.renderscript.RenderScript.Priority.LOW);
            if (p == Priority.NORMAL) mN.setPriority(android.renderscript.RenderScript.Priority.NORMAL);
        } catch (android.renderscript.RSRuntimeException e) {
            throw ExceptionThunker.convertException(e);
        }
    
voidvalidate()

        if (mN == null) {
            throw new RSInvalidStateException("Calling RS with no Context active.");
        }