diff options
| author | Jason Sams <rjsams@android.com> | 2010-08-06 16:22:50 -0700 |
|---|---|---|
| committer | Jason Sams <rjsams@android.com> | 2010-08-06 16:22:50 -0700 |
| commit | d64188a4a4acc0f494551367e09f63b44f0ed7f3 (patch) | |
| tree | f53a41af67483f00b8cd6ee32d16406564558877 /libs/rs/scriptc | |
| parent | 41d9825b9aa1eb986990cd43513f7bdc6be0b88e (diff) | |
| download | frameworks_base-d64188a4a4acc0f494551367e09f63b44f0ed7f3.zip frameworks_base-d64188a4a4acc0f494551367e09f63b44f0ed7f3.tar.gz frameworks_base-d64188a4a4acc0f494551367e09f63b44f0ed7f3.tar.bz2 | |
Fix debugging support for float vectors and add matrix debugging.
Change-Id: Ie1ee3764a32889f3c39b923186f14af74ecb772f
Diffstat (limited to 'libs/rs/scriptc')
| -rw-r--r-- | libs/rs/scriptc/rs_core.rsh | 9 | ||||
| -rw-r--r-- | libs/rs/scriptc/rs_math.rsh | 44 |
2 files changed, 34 insertions, 19 deletions
diff --git a/libs/rs/scriptc/rs_core.rsh b/libs/rs/scriptc/rs_core.rsh index 93e009a..85f3b25 100644 --- a/libs/rs/scriptc/rs_core.rsh +++ b/libs/rs/scriptc/rs_core.rsh @@ -1,6 +1,15 @@ #ifndef __RS_CORE_RSH__ #define __RS_CORE_RSH__ +static void __attribute__((overloadable)) rsDebug(const char *s, float2 v) { + rsDebug(s, v.x, v.y); +} +static void __attribute__((overloadable)) rsDebug(const char *s, float3 v) { + rsDebug(s, v.x, v.y, v.z); +} +static void __attribute__((overloadable)) rsDebug(const char *s, float4 v) { + rsDebug(s, v.x, v.y, v.z, v.w); +} static uchar4 __attribute__((overloadable)) rsPackColorTo8888(float r, float g, float b) { diff --git a/libs/rs/scriptc/rs_math.rsh b/libs/rs/scriptc/rs_math.rsh index 66171d8..45f6bf4 100644 --- a/libs/rs/scriptc/rs_math.rsh +++ b/libs/rs/scriptc/rs_math.rsh @@ -1,6 +1,31 @@ #ifndef __RS_MATH_RSH__ #define __RS_MATH_RSH__ +// Debugging, print to the LOG a description string and a value. +extern void __attribute__((overloadable)) + rsDebug(const char *, float); +extern void __attribute__((overloadable)) + rsDebug(const char *, float, float); +extern void __attribute__((overloadable)) + rsDebug(const char *, float, float, float); +extern void __attribute__((overloadable)) + rsDebug(const char *, float, float, float, float); +extern void __attribute__((overloadable)) + rsDebug(const char *, const rs_matrix4x4 *); +extern void __attribute__((overloadable)) + rsDebug(const char *, const rs_matrix3x3 *); +extern void __attribute__((overloadable)) + rsDebug(const char *, const rs_matrix2x2 *); +extern void __attribute__((overloadable)) + rsDebug(const char *, int); +extern void __attribute__((overloadable)) + rsDebug(const char *, uint); +extern void __attribute__((overloadable)) + rsDebug(const char *, const void *); +#define RS_DEBUG(a) rsDebug(#a, a) +#define RS_DEBUG_MARKER rsDebug(__FILE__, __LINE__) + + #include "rs_cl.rsh" #include "rs_core.rsh" @@ -31,25 +56,6 @@ extern const void * __attribute__((overloadable)) extern const void * __attribute__((overloadable)) rsGetElementAt(rs_allocation, uint32_t x, uint32_t y, uint32_t z); - -// Debugging, print to the LOG a description string and a value. -extern void __attribute__((overloadable)) - rsDebug(const char *, float); -extern void __attribute__((overloadable)) - rsDebug(const char *, float2); -extern void __attribute__((overloadable)) - rsDebug(const char *, float3); -extern void __attribute__((overloadable)) - rsDebug(const char *, float4); -extern void __attribute__((overloadable)) - rsDebug(const char *, int); -extern void __attribute__((overloadable)) - rsDebug(const char *, uint); -extern void __attribute__((overloadable)) - rsDebug(const char *, const void *); -#define RS_DEBUG(a) rsDebug(#a, a) -#define RS_DEBUG_MARKER rsDebug(__FILE__, __LINE__) - // Return a random value between 0 (or min_value) and max_malue. extern int __attribute__((overloadable)) rsRand(int max_value); |
