summaryrefslogtreecommitdiffstats
path: root/tests/RenderScriptTests/SceneGraph/src
diff options
context:
space:
mode:
authorAlex Sakhartchouk <alexst@google.com>2012-01-30 14:05:39 -0800
committerAlex Sakhartchouk <alexst@google.com>2012-01-30 14:05:39 -0800
commit5de922962a2fa06267f3ad26f75e3a8083af906c (patch)
tree818ffa1bd801889a07547e4a49ae65365a4f4402 /tests/RenderScriptTests/SceneGraph/src
parente93db17a143ff560f92d94b68ce1e76f79db7902 (diff)
downloadframeworks_base-5de922962a2fa06267f3ad26f75e3a8083af906c.zip
frameworks_base-5de922962a2fa06267f3ad26f75e3a8083af906c.tar.gz
frameworks_base-5de922962a2fa06267f3ad26f75e3a8083af906c.tar.bz2
Fixing possible pne.
Change-Id: I4a8071374a72c0ca2639dc033d06d17e0a0466f7
Diffstat (limited to 'tests/RenderScriptTests/SceneGraph/src')
-rw-r--r--tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph/FragmentShader.java7
-rw-r--r--tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph/Renderable.java5
2 files changed, 10 insertions, 2 deletions
diff --git a/tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph/FragmentShader.java b/tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph/FragmentShader.java
index 0fb32ff..ca03263 100644
--- a/tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph/FragmentShader.java
+++ b/tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph/FragmentShader.java
@@ -19,6 +19,8 @@ package com.android.scenegraph;
import java.lang.Math;
import java.util.ArrayList;
+import com.android.scenegraph.TextureBase;
+
import android.content.res.Resources;
import android.renderscript.*;
import android.renderscript.ProgramFragment.Builder;
@@ -102,7 +104,10 @@ public class FragmentShader extends Shader {
ShaderParam sp = mSourceParams.get(mShaderTextureNames.get(i));
if (sp != null && sp instanceof TextureParam) {
TextureParam p = (TextureParam)sp;
- mProgram.bindTexture(p.getTexture().getRsData(), shaderTextureStart + i);
+ TextureBase tex = p.getTexture();
+ if (tex != null) {
+ mProgram.bindTexture(tex.getRsData(), shaderTextureStart + i);
+ }
}
}
}
diff --git a/tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph/Renderable.java b/tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph/Renderable.java
index 445c590..eaf36fe 100644
--- a/tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph/Renderable.java
+++ b/tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph/Renderable.java
@@ -138,7 +138,10 @@ public class Renderable extends RenderableBase {
ShaderParam sp = allParamsIter.next();
if (sp instanceof TextureParam) {
TextureParam p = (TextureParam)sp;
- mRsFieldItem.pf_textures[paramIndex++] = p.getTexture().getRsData();
+ TextureBase tex = p.getTexture();
+ if (tex != null) {
+ mRsFieldItem.pf_textures[paramIndex++] = tex.getRsData();
+ }
}
}
ProgramFragment pf = mRenderState.mFragment.mProgram;