RenderScriptGLpublic class RenderScriptGL extends RenderScript
Fields Summary |
---|
int | mWidth | int | mHeight | SurfaceConfig | mSurfaceConfig |
Constructors Summary |
---|
public RenderScriptGL(android.content.Context ctx, SurfaceConfig sc)
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 void | bindProgramFragment(ProgramFragment p)
validate();
nContextBindProgramFragment((int)safeID(p));
| public void | bindProgramRaster(ProgramRaster p)
validate();
nContextBindProgramRaster((int)safeID(p));
| public void | bindProgramStore(ProgramStore p)
validate();
nContextBindProgramStore((int)safeID(p));
| public void | bindProgramVertex(ProgramVertex p)
validate();
nContextBindProgramVertex((int)safeID(p));
| public void | bindRootScript(Script s)
validate();
nContextBindRootScript((int)safeID(s));
| public int | getHeight()
return mHeight;
| public int | getWidth()
return mWidth;
| public void | pause()
validate();
nContextPause();
| public void | resume()
validate();
nContextResume();
| public void | setSurface(android.view.SurfaceHolder sur, int w, int h)
validate();
Surface s = null;
if (sur != null) {
s = sur.getSurface();
}
mWidth = w;
mHeight = h;
nContextSetSurface(w, h, s);
| public void | setSurfaceTexture(android.graphics.SurfaceTexture sur, int w, int h)
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);
|
|