use of android.renderscript.RenderScriptGL in project android_frameworks_base by ParanoidAndroid.
the class Camera method getRSData.
ScriptField_Camera_s getRSData() {
if (mField != null) {
return mField;
}
RenderScriptGL rs = SceneManager.getRS();
if (rs == null) {
return null;
}
if (mTransform == null) {
throw new RuntimeException("Cameras without transforms are invalid");
}
mField = new ScriptField_Camera_s(rs, 1);
mData.transformMatrix = mTransform.getRSData().getAllocation();
mData.transformTimestamp = 1;
mData.timestamp = 1;
mData.isDirty = 1;
mData.name = getNameAlloc(rs);
mField.set(mData, 0, true);
return mField;
}
use of android.renderscript.RenderScriptGL in project android_frameworks_base by ParanoidAndroid.
the class Camera method setName.
public void setName(String n) {
super.setName(n);
if (mField != null) {
RenderScriptGL rs = SceneManager.getRS();
mData.name = getNameAlloc(rs);
mField.set_name(0, mData.name, true);
mField.set_isDirty(0, 1, true);
}
}
use of android.renderscript.RenderScriptGL in project android_frameworks_base by ParanoidAndroid.
the class SceneManager method getTextureFS.
public static FragmentShader getTextureFS() {
if (sSceneManager == null) {
return null;
}
if (sSceneManager.mTexture == null) {
RenderScriptGL rs = getRS();
final String code = "\n" + "varying vec2 varTex0;\n" + "void main() {\n" + " lowp vec4 col = texture2D(UNI_color, varTex0).rgba;\n" + " gl_FragColor = col;\n" + "}\n";
FragmentShader.Builder fb = new FragmentShader.Builder(rs);
fb.setShader(code);
fb.addTexture(Program.TextureType.TEXTURE_2D, "color");
sSceneManager.mTexture = fb.create();
sSceneManager.mTexture.mProgram.bindSampler(Sampler.CLAMP_LINEAR_MIP_LINEAR(rs), 0);
}
return sSceneManager.mTexture;
}
Aggregations