diff options
author | Jason Sams <jsams@google.com> | 2012-08-21 17:09:56 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-08-21 17:09:56 -0700 |
commit | f9678070a03ad16d223d26a38b319d38d5943a71 (patch) | |
tree | b8005321ef6aea7e07fbde3f4048c5bc2c424ab5 /tests/RenderScriptTests | |
parent | a8309cb7ee05502176c2715f381ea5e63016daae (diff) | |
parent | f1c051b6f2892ba56f9d8b9b8b309e5b914af387 (diff) | |
download | frameworks_base-f9678070a03ad16d223d26a38b319d38d5943a71.zip frameworks_base-f9678070a03ad16d223d26a38b319d38d5943a71.tar.gz frameworks_base-f9678070a03ad16d223d26a38b319d38d5943a71.tar.bz2 |
Merge "Fix bug in grain." into jb-mr1-dev
Diffstat (limited to 'tests/RenderScriptTests')
-rw-r--r-- | tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/grain.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/grain.rs b/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/grain.rs index 97ae4fb..7d9d3ac 100644 --- a/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/grain.rs +++ b/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/grain.rs @@ -43,10 +43,10 @@ int32_t gHeight; rs_allocation gBlendSource; void blend9(uchar *out, uint32_t x, uint32_t y) { - uint32_t x1 = min(x+1, (uint32_t)gWidth); - uint32_t x2 = max(x-1, (uint32_t)0); - uint32_t y1 = min(y+1, (uint32_t)gHeight); - uint32_t y2 = max(y-1, (uint32_t)0); + uint32_t x1 = min((int32_t)x+1, (int32_t)gWidth); + uint32_t x2 = max((int32_t)x-1, (int32_t)0); + uint32_t y1 = min((int32_t)y+1, (int32_t)gHeight); + uint32_t y2 = max((int32_t)y-1, (int32_t)0); uint p00 = 56 * ((uchar *)rsGetElementAt(gBlendSource, x1, y1))[0]; uint p01 = 114 * ((uchar *)rsGetElementAt(gBlendSource, x, y1))[0]; |