am e15ea72b: Merge "Remove STL references from header files"
* commit 'e15ea72be26441644c21d536f18525702a24d28a':
Remove STL references from header files
diff --git a/cpp/ScriptIntrinsics.cpp b/cpp/ScriptIntrinsics.cpp
index e3457a7..a9a31f8 100644
--- a/cpp/ScriptIntrinsics.cpp
+++ b/cpp/ScriptIntrinsics.cpp
@@ -598,5 +598,3 @@
Script::forEach(0, nullptr, out, nullptr, 0);
}
-
-
diff --git a/cpu_ref/rsCpuIntrinsicConvolve3x3.cpp b/cpu_ref/rsCpuIntrinsicConvolve3x3.cpp
index f9b70cc..e3fa245 100644
--- a/cpu_ref/rsCpuIntrinsicConvolve3x3.cpp
+++ b/cpu_ref/rsCpuIntrinsicConvolve3x3.cpp
@@ -105,7 +105,7 @@
convert_float4(py2[x]) * coeff[7] +
convert_float4(py2[x2]) * coeff[8];
- px = clamp(px, 0.f, 255.f);
+ px = clamp(px + 0.5f, 0.f, 255.f);
uchar4 o = {(uchar)px.x, (uchar)px.y, (uchar)px.z, (uchar)px.w};
*out = o;
}
@@ -127,7 +127,7 @@
convert_float2(py2[x]) * coeff[7] +
convert_float2(py2[x2]) * coeff[8];
- px = clamp(px, 0.f, 255.f);
+ px = clamp(px + 0.5f, 0.f, 255.f);
*out = convert_uchar2(px);
}
@@ -147,7 +147,7 @@
((float)py2[x1]) * coeff[6] +
((float)py2[x]) * coeff[7] +
((float)py2[x2]) * coeff[8];
- *out = clamp(px, 0.f, 255.f);
+ *out = clamp(px + 0.5f, 0.f, 255.f);
}
static void ConvolveOneF4(const RsExpandKernelParams *p, uint32_t x, float4 *out,
diff --git a/cpu_ref/rsCpuIntrinsicConvolve5x5.cpp b/cpu_ref/rsCpuIntrinsicConvolve5x5.cpp
index 815badf..e591e44 100644
--- a/cpu_ref/rsCpuIntrinsicConvolve5x5.cpp
+++ b/cpu_ref/rsCpuIntrinsicConvolve5x5.cpp
@@ -125,7 +125,7 @@
convert_float4(py4[x2]) * coeff[22] +
convert_float4(py4[x3]) * coeff[23] +
convert_float4(py4[x4]) * coeff[24];
- px = clamp(px, 0.f, 255.f);
+ px = clamp(px + 0.5f, 0.f, 255.f);
*out = convert_uchar4(px);
}
@@ -168,7 +168,7 @@
convert_float2(py4[x2]) * coeff[22] +
convert_float2(py4[x3]) * coeff[23] +
convert_float2(py4[x4]) * coeff[24];
- px = clamp(px, 0.f, 255.f);
+ px = clamp(px + 0.5f, 0.f, 255.f);
*out = convert_uchar2(px);
}
@@ -211,7 +211,7 @@
(float)(py4[x2]) * coeff[22] +
(float)(py4[x3]) * coeff[23] +
(float)(py4[x4]) * coeff[24];
- px = clamp(px, 0.f, 255.f);
+ px = clamp(px + 0.5f, 0.f, 255.f);
*out = px;
}
diff --git a/rsAllocation.cpp b/rsAllocation.cpp
index 386d86f..360ab89 100644
--- a/rsAllocation.cpp
+++ b/rsAllocation.cpp
@@ -554,7 +554,7 @@
}
#ifndef RS_COMPATIBILITY_LIB
-void Allocation::NewBufferListener::onFrameAvailable() {
+void Allocation::NewBufferListener::onFrameAvailable(const BufferItem& /* item */) {
intptr_t ip = (intptr_t)alloc;
rsc->sendMessageToClient(&ip, RS_MESSAGE_TO_CLIENT_NEW_BUFFER, 0, sizeof(ip), true);
}
diff --git a/rsAllocation.h b/rsAllocation.h
index 1000957..83f8e82 100644
--- a/rsAllocation.h
+++ b/rsAllocation.h
@@ -213,7 +213,7 @@
const android::renderscript::Context *rsc;
const android::renderscript::Allocation *alloc;
- virtual void onFrameAvailable();
+ virtual void onFrameAvailable(const BufferItem& item);
};
sp<NewBufferListener> mBufferListener;
diff --git a/scriptc/rs_allocation.rsh b/scriptc/rs_allocation.rsh
index 6f3f8d9..03bd1ca 100644
--- a/scriptc/rs_allocation.rsh
+++ b/scriptc/rs_allocation.rsh
@@ -374,8 +374,7 @@
#endif // (defined(RS_VERSION) && (RS_VERSION >= 18))
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 999))
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
#define VOP(T) \
extern T __attribute__((overloadable)) \
@@ -424,7 +423,7 @@
#undef VOP
-#endif //(defined(RS_VERSION) && (RS_VERSION >= 999))
+#endif //(defined(RS_VERSION) && (RS_VERSION >= 22))
#endif