FileDocCategorySizeDatePackage
RenderScriptGL.javaAPI DocAndroid 5.1 API10165Thu Mar 12 22:22:42 GMT 2015android.renderscript

RenderScriptGL

public class RenderScriptGL extends RenderScript
hide
deprecated
in API 16 The Graphics derivitive of RenderScript. Extends the basic context to add a root script which is the display window for graphical output. When the system needs to update the display the currently bound root script will be called. This script is expected to issue the rendering commands to repaint the screen.

Developer Guides

For more information about creating an application that uses RenderScript, read the RenderScript developer guide.

Fields Summary
int
mWidth
int
mHeight
SurfaceConfig
mSurfaceConfig
Constructors Summary
public RenderScriptGL(android.content.Context ctx, SurfaceConfig sc)

deprecated
in API 16 Construct a new RenderScriptGL context.
param
ctx The context.
param
sc The desired format of the primary rendering surface.

        super(ctx);
        mSurfaceConfig = new SurfaceConfig(sc);

        int sdkVersion = ctx.getApplicationInfo().targetSdkVersion;

        mWidth = 0;
        mHeight = 0;
        mDev = nDeviceCreate();
        int dpi = ctx.getResources().getDisplayMetrics().densityDpi;
        mContext = nContextCreateGL(mDev, 0, sdkVersion,
                                    mSurfaceConfig.mColorMin, mSurfaceConfig.mColorPref,
                                    mSurfaceConfig.mAlphaMin, mSurfaceConfig.mAlphaPref,
                                    mSurfaceConfig.mDepthMin, mSurfaceConfig.mDepthPref,
                                    mSurfaceConfig.mStencilMin, mSurfaceConfig.mStencilPref,
                                    mSurfaceConfig.mSamplesMin, mSurfaceConfig.mSamplesPref,
                                    mSurfaceConfig.mSamplesQ, dpi);
        if (mContext == 0) {
            throw new RSDriverException("Failed to create RS context.");
        }
        mMessageThread = new MessageThread(this);
        mMessageThread.start();
    
Methods Summary
public voidbindProgramFragment(ProgramFragment p)

deprecated
in API 16 Set the default ProgramFragment object seen as the parent state by the root rendering script.
param
p

        validate();
        nContextBindProgramFragment((int)safeID(p));
    
public voidbindProgramRaster(ProgramRaster p)

deprecated
in API 16 Set the default ProgramRaster object seen as the parent state by the root rendering script.
param
p

        validate();
        nContextBindProgramRaster((int)safeID(p));
    
public voidbindProgramStore(ProgramStore p)

deprecated
in API 16 Set the default ProgramStore object seen as the parent state by the root rendering script.
param
p

        validate();
        nContextBindProgramStore((int)safeID(p));
    
public voidbindProgramVertex(ProgramVertex p)

deprecated
in API 16 Set the default ProgramVertex object seen as the parent state by the root rendering script.
param
p

        validate();
        nContextBindProgramVertex((int)safeID(p));
    
public voidbindRootScript(Script s)

deprecated
in API 16 Set the script to handle calls to render the primary surface.
param
s Graphics script to process rendering requests.

        validate();
        nContextBindRootScript((int)safeID(s));
    
public intgetHeight()

deprecated
in API 16 return the height of the last set surface.
return
int

        return mHeight;
    
public intgetWidth()

deprecated
in API 16 return the width of the last set surface.
return
int

        return mWidth;
    
public voidpause()

deprecated
in API 16 Temporarly halt calls to the root rendering script.

        validate();
        nContextPause();
    
public voidresume()

deprecated
in API 16 Resume calls to the root rendering script.

        validate();
        nContextResume();
    
public voidsetSurface(android.view.SurfaceHolder sur, int w, int h)

deprecated
in API 16 Bind an os surface
param
w
param
h
param
sur

        validate();
        Surface s = null;
        if (sur != null) {
            s = sur.getSurface();
        }
        mWidth = w;
        mHeight = h;
        nContextSetSurface(w, h, s);
    
public voidsetSurfaceTexture(android.graphics.SurfaceTexture sur, int w, int h)

deprecated
in API 16 Bind an os surface
param
w
param
h
param
sur

        validate();
        //android.util.Log.v("rs", "set surface " + sur + " w=" + w + ", h=" + h);

        Surface s = null;
        if (sur != null) {
            s = new Surface(sur);
        }
        mWidth = w;
        mHeight = h;
        nContextSetSurface(w, h, s);