summaryrefslogtreecommitdiffstats
path: root/tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph
diff options
context:
space:
mode:
authorJean-Luc Brouillet <jeanluc@google.com>2015-05-19 14:59:42 -0700
committerJean-Luc Brouillet <jeanluc@google.com>2015-05-20 13:40:06 -0700
commitc19cdfa14dd5c64f3c185a7b07ac9ca2ecc2f0e7 (patch)
tree7b41adf189a0858b41c156dfa5b2553a067d4d99 /tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph
parentb300d31bf1cb138f0a7c4c484459cc6a2ce2f69c (diff)
downloadframeworks_base-c19cdfa14dd5c64f3c185a7b07ac9ca2ecc2f0e7.zip
frameworks_base-c19cdfa14dd5c64f3c185a7b07ac9ca2ecc2f0e7.tar.gz
frameworks_base-c19cdfa14dd5c64f3c185a7b07ac9ca2ecc2f0e7.tar.bz2
Clean RenderScript warnings
Change-Id: Ia7a98c1c977c839c74ae8081e70b5deb4b60c25d
Diffstat (limited to 'tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph')
-rw-r--r--tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph/params.rsh11
-rw-r--r--tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph/render.rs2
-rw-r--r--tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph/scenegraph_objects.rsh10
-rw-r--r--tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph/transform.rs4
4 files changed, 14 insertions, 13 deletions
diff --git a/tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph/params.rsh b/tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph/params.rsh
index 575794b..00793c0 100644
--- a/tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph/params.rsh
+++ b/tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph/params.rsh
@@ -19,7 +19,7 @@
#include "scenegraph_objects.rsh"
//#define DEBUG_PARAMS
-static void debugParam(SgShaderParam *p, SgShaderParamData *pData) {
+static inline void debugParam(SgShaderParam *p, SgShaderParamData *pData) {
rsDebug("____________ Param ____________", p);
printName(pData->paramName);
rsDebug("bufferOffset", p->bufferOffset);
@@ -44,8 +44,7 @@ static void debugParam(SgShaderParam *p, SgShaderParamData *pData) {
}
}
-
-static void writeFloatData(float *ptr, const float4 *input, uint32_t vecSize) {
+static inline void writeFloatData(float *ptr, const float4 *input, uint32_t vecSize) {
#ifdef DEBUG_PARAMS
rsDebug("Writing value ", *input);
rsDebug("Writing vec size ", vecSize);
@@ -67,7 +66,7 @@ static void writeFloatData(float *ptr, const float4 *input, uint32_t vecSize) {
}
}
-static bool processParam(SgShaderParam *p, SgShaderParamData *pData,
+static inline bool processParam(SgShaderParam *p, SgShaderParamData *pData,
uint8_t *constantBuffer,
const SgCamera *currentCam,
SgFragmentShader *shader) {
@@ -155,7 +154,7 @@ static bool processParam(SgShaderParam *p, SgShaderParamData *pData,
return true;
}
-static void processAllParams(rs_allocation shaderConst,
+static inline void processAllParams(rs_allocation shaderConst,
rs_allocation allParams,
const SgCamera *camera) {
if (rsIsObject(shaderConst)) {
@@ -177,7 +176,7 @@ static void processAllParams(rs_allocation shaderConst,
}
}
-static void processTextureParams(SgFragmentShader *shader) {
+static inline void processTextureParams(SgFragmentShader *shader) {
int numParams = 0;
if (rsIsObject(shader->shaderTextureParams)) {
numParams = rsAllocationGetDimX(shader->shaderTextureParams);
diff --git a/tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph/render.rs b/tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph/render.rs
index 8a73dbd..205b2cb 100644
--- a/tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph/render.rs
+++ b/tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph/render.rs
@@ -78,7 +78,7 @@ static void draw(SgRenderable *obj) {
if (rsIsObject(renderState->pr)) {
rsgBindProgramRaster(renderState->pr);
} else {
- rs_program_raster pr;
+ rs_program_raster pr = {0};
rsgBindProgramRaster(pr);
}
diff --git a/tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph/scenegraph_objects.rsh b/tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph/scenegraph_objects.rsh
index bdca3ab..90ae212 100644
--- a/tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph/scenegraph_objects.rsh
+++ b/tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph/scenegraph_objects.rsh
@@ -208,7 +208,7 @@ typedef struct Texture_s {
rs_allocation texture;
} SgTexture;
-static void printName(rs_allocation name) {
+static inline void printName(rs_allocation name) {
if (!rsIsObject(name)) {
rsDebug("no name", 0);
return;
@@ -217,7 +217,7 @@ static void printName(rs_allocation name) {
rsDebug((const char*)rsGetElementAt(name, 0), 0);
}
-static void printCameraInfo(const SgCamera *cam) {
+static inline void printCameraInfo(const SgCamera *cam) {
rsDebug("***** Camera information. ptr:", cam);
printName(cam->name);
const SgTransform *camTransform = (const SgTransform *)rsGetElementAt(cam->transformMatrix, 0);
@@ -233,7 +233,7 @@ static void printCameraInfo(const SgCamera *cam) {
rsDebug("View: ", &cam->view);
}
-static void printLightInfo(const SgLight *light) {
+static inline void printLightInfo(const SgLight *light) {
rsDebug("***** Light information. ptr:", light);
printName(light->name);
const SgTransform *lTransform = (const SgTransform *)rsGetElementAt(light->transformMatrix, 0);
@@ -246,7 +246,7 @@ static void printLightInfo(const SgLight *light) {
rsDebug("Type: ", light->type);
}
-static void getCameraRay(const SgCamera *cam, int screenX, int screenY, float3 *pnt, float3 *vec) {
+static inline void getCameraRay(const SgCamera *cam, int screenX, int screenY, float3 *pnt, float3 *vec) {
rsDebug("=================================", screenX);
rsDebug("Point X", screenX);
rsDebug("Point Y", screenY);
@@ -290,7 +290,7 @@ static void getCameraRay(const SgCamera *cam, int screenX, int screenY, float3 *
*pnt = cam->position.xyz;
}
-static bool intersect(const SgRenderable *obj, float3 pnt, float3 vec) {
+static inline bool intersect(const SgRenderable *obj, float3 pnt, float3 vec) {
// Solving for t^2 + Bt + C = 0
float3 originMinusCenter = pnt - obj->worldBoundingSphere.xyz;
float B = dot(originMinusCenter, vec) * 2.0f;
diff --git a/tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph/transform.rs b/tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph/transform.rs
index 941b5a8..1d0b5be 100644
--- a/tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph/transform.rs
+++ b/tests/RenderScriptTests/SceneGraph/src/com/android/scenegraph/transform.rs
@@ -26,6 +26,7 @@ typedef struct {
} ParentData;
//#define DEBUG_TRANSFORMS
+/* Unused function:
static void debugTransform(SgTransform *data, const ParentData *parent) {
rsDebug("****** <Transform> ******", (int)data);
printName(data->name);
@@ -53,6 +54,7 @@ static void debugTransform(SgTransform *data, const ParentData *parent) {
rsDebug("timestamp", data->timestamp);
rsDebug("****** </Transform> ******", (int)data);
}
+*/
static void appendTransformation(int type, float4 data, rs_matrix4x4 *mat) {
rs_matrix4x4 temp;
@@ -119,7 +121,7 @@ void root(const rs_allocation *v_in, rs_allocation *v_out, const void *usrData)
}
if (rsIsObject(data->children)) {
- rs_allocation nullAlloc;
+ rs_allocation nullAlloc = {0};
rsForEach(gTransformScript, data->children, nullAlloc, &toChild, sizeof(toChild));
}