From 7d6105a77320c0de8cd7e7fbde82dccf4f606548 Mon Sep 17 00:00:00 2001 From: kaiyiz Date: Mon, 16 Sep 2013 17:09:18 +0800 Subject: Gallery2: fix display abnormal when tap sharpness in filtershow In Android4.3 version, it using stride to pad row layouts in script, and can't do 1D indexing of 2D objects, this make the resulting pixel values are not the corresponding coordinates' pixel value. We change to use rsGetElementAt() not gPixels() to get the correct pixel values. CRs-Fixed: 539928 Change-Id: Ifc0e516014c9fd974f3e7df163b06f732499f7c0 --- .../gallery3d/filtershow/filters/convolve3x3.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/com/android/gallery3d/filtershow/filters/convolve3x3.rs b/src/com/android/gallery3d/filtershow/filters/convolve3x3.rs index 2acffab06..d348b92e5 100644 --- a/src/com/android/gallery3d/filtershow/filters/convolve3x3.rs +++ b/src/com/android/gallery3d/filtershow/filters/convolve3x3.rs @@ -31,15 +31,15 @@ void root(const uchar4 *in, uchar4 *out, const void *usrData, uint32_t x, uint32 uint32_t y1 = min((int32_t)y+1, gHeight-1); uint32_t y2 = max((int32_t)y-1, 0); - float4 p00 = rsUnpackColor8888(gPixels[x1 + gWidth * y1]); - float4 p01 = rsUnpackColor8888(gPixels[x + gWidth * y1]); - float4 p02 = rsUnpackColor8888(gPixels[x2 + gWidth * y1]); - float4 p10 = rsUnpackColor8888(gPixels[x1 + gWidth * y]); - float4 p11 = rsUnpackColor8888(gPixels[x + gWidth * y]); - float4 p12 = rsUnpackColor8888(gPixels[x2 + gWidth * y]); - float4 p20 = rsUnpackColor8888(gPixels[x1 + gWidth * y2]); - float4 p21 = rsUnpackColor8888(gPixels[x + gWidth * y2]); - float4 p22 = rsUnpackColor8888(gPixels[x2 + gWidth * y2]); + float4 p00 = rsUnpackColor8888(*((uchar4 *)rsGetElementAt(gIn, x1, y1))); + float4 p01 = rsUnpackColor8888(*((uchar4 *)rsGetElementAt(gIn, x, y1))); + float4 p02 = rsUnpackColor8888(*((uchar4 *)rsGetElementAt(gIn, x2, y1))); + float4 p10 = rsUnpackColor8888(*((uchar4 *)rsGetElementAt(gIn, x1, y))); + float4 p11 = rsUnpackColor8888(*((uchar4 *)rsGetElementAt(gIn, x, y))); + float4 p12 = rsUnpackColor8888(*((uchar4 *)rsGetElementAt(gIn, x2, y))); + float4 p20 = rsUnpackColor8888(*((uchar4 *)rsGetElementAt(gIn, x1, y2))); + float4 p21 = rsUnpackColor8888(*((uchar4 *)rsGetElementAt(gIn, x, y2))); + float4 p22 = rsUnpackColor8888(*((uchar4 *)rsGetElementAt(gIn, x2, y2))); p00 *= gCoeffs[0]; p01 *= gCoeffs[1]; -- cgit v1.2.3