Loading graphics/java/android/renderscript/BaseObj.java +10 −4 Original line number Original line Diff line number Diff line Loading @@ -75,11 +75,17 @@ class BaseObj { * @param name The name to assign to the object. * @param name The name to assign to the object. */ */ public void setName(String name) { public void setName(String name) { if (name == null) { throw new RSIllegalArgumentException( "setName requires a string of non-zero length."); } if(name.length() < 1) { if(name.length() < 1) { throw new RSIllegalArgumentException("setName does not accept a zero length string."); throw new RSIllegalArgumentException( "setName does not accept a zero length string."); } } if(mName != null) { if(mName != null) { throw new RSIllegalArgumentException("setName object already has a name."); throw new RSIllegalArgumentException( "setName object already has a name."); } } try { try { Loading @@ -106,9 +112,9 @@ class BaseObj { } } /** /** * destroy disconnects the object from the native object effectivly * destroy disconnects the object from the native object effectively * rendering this java object dead. The primary use is to force immediate * rendering this java object dead. The primary use is to force immediate * cleanup of resources when its believed the GC will not respond quickly * cleanup of resources when it is believed the GC will not respond quickly * enough. * enough. */ */ synchronized public void destroy() { synchronized public void destroy() { Loading libs/rs/rsScriptC_Lib.cpp +4 −2 Original line number Original line Diff line number Diff line Loading @@ -76,13 +76,15 @@ static float SC_cosf_fast(float x) { static float SC_randf(float max) { static float SC_randf(float max) { float r = (float)rand(); float r = (float)rand(); r *= max; r *= max; return r / RAND_MAX; r /= RAND_MAX; return r; } } static float SC_randf2(float min, float max) { static float SC_randf2(float min, float max) { float r = (float)rand(); float r = (float)rand(); r /= RAND_MAX; r = r * (max - min) + min; r = r * (max - min) + min; return r / RAND_MAX; return r; } } static int SC_randi(int max) { static int SC_randi(int max) { Loading Loading
graphics/java/android/renderscript/BaseObj.java +10 −4 Original line number Original line Diff line number Diff line Loading @@ -75,11 +75,17 @@ class BaseObj { * @param name The name to assign to the object. * @param name The name to assign to the object. */ */ public void setName(String name) { public void setName(String name) { if (name == null) { throw new RSIllegalArgumentException( "setName requires a string of non-zero length."); } if(name.length() < 1) { if(name.length() < 1) { throw new RSIllegalArgumentException("setName does not accept a zero length string."); throw new RSIllegalArgumentException( "setName does not accept a zero length string."); } } if(mName != null) { if(mName != null) { throw new RSIllegalArgumentException("setName object already has a name."); throw new RSIllegalArgumentException( "setName object already has a name."); } } try { try { Loading @@ -106,9 +112,9 @@ class BaseObj { } } /** /** * destroy disconnects the object from the native object effectivly * destroy disconnects the object from the native object effectively * rendering this java object dead. The primary use is to force immediate * rendering this java object dead. The primary use is to force immediate * cleanup of resources when its believed the GC will not respond quickly * cleanup of resources when it is believed the GC will not respond quickly * enough. * enough. */ */ synchronized public void destroy() { synchronized public void destroy() { Loading
libs/rs/rsScriptC_Lib.cpp +4 −2 Original line number Original line Diff line number Diff line Loading @@ -76,13 +76,15 @@ static float SC_cosf_fast(float x) { static float SC_randf(float max) { static float SC_randf(float max) { float r = (float)rand(); float r = (float)rand(); r *= max; r *= max; return r / RAND_MAX; r /= RAND_MAX; return r; } } static float SC_randf2(float min, float max) { static float SC_randf2(float min, float max) { float r = (float)rand(); float r = (float)rand(); r /= RAND_MAX; r = r * (max - min) + min; r = r * (max - min) + min; return r / RAND_MAX; return r; } } static int SC_randi(int max) { static int SC_randi(int max) { Loading