summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cpp/ScriptIntrinsics.cpp8
-rw-r--r--cpp/rsCppStructs.h5
2 files changed, 8 insertions, 5 deletions
diff --git a/cpp/ScriptIntrinsics.cpp b/cpp/ScriptIntrinsics.cpp
index a9a31f81..e40d1a03 100644
--- a/cpp/ScriptIntrinsics.cpp
+++ b/cpp/ScriptIntrinsics.cpp
@@ -419,8 +419,8 @@ void ScriptIntrinsicConvolve5x5::setCoefficients(float* v) {
Script::setVar(0, (void*)v, sizeof(float) * 25);
}
-sp<ScriptIntrinsicHistogram> ScriptIntrinsicHistogram::create(sp<RS> rs) {
- return new ScriptIntrinsicHistogram(rs, nullptr);
+sp<ScriptIntrinsicHistogram> ScriptIntrinsicHistogram::create(sp<RS> rs, sp<const Element> e) {
+ return new ScriptIntrinsicHistogram(rs, e);
}
ScriptIntrinsicHistogram::ScriptIntrinsicHistogram(sp<RS> rs, sp<const Element> e)
@@ -476,7 +476,7 @@ void ScriptIntrinsicHistogram::forEach(sp<Allocation> ain) {
return;
}
- if (!(ain->getType()->getElement()->isCompatible(Element::U8(mRS))) ||
+ if (!(ain->getType()->getElement()->isCompatible(Element::U8(mRS))) &&
!(ain->getType()->getElement()->isCompatible(Element::U8_4(mRS)))) {
mRS->throwError(RS_ERROR_INVALID_ELEMENT,
"Input allocation to Histogram must be U8 or U8_4");
@@ -494,7 +494,7 @@ void ScriptIntrinsicHistogram::forEach_dot(sp<Allocation> ain) {
"when used with forEach_dot");
return;
}
- if (!(ain->getType()->getElement()->isCompatible(Element::U8(mRS))) ||
+ if (!(ain->getType()->getElement()->isCompatible(Element::U8(mRS))) &&
!(ain->getType()->getElement()->isCompatible(Element::U8_4(mRS)))) {
mRS->throwError(RS_ERROR_INVALID_ELEMENT,
"Input allocation to Histogram must be U8 or U8_4");
diff --git a/cpp/rsCppStructs.h b/cpp/rsCppStructs.h
index 26e19545..cd8f39a1 100644
--- a/cpp/rsCppStructs.h
+++ b/cpp/rsCppStructs.h
@@ -1351,6 +1351,9 @@ protected:
void setVar(uint32_t index, int32_t v) const {
setVar(index, &v, sizeof(v));
}
+ void setVar(uint32_t index, uint32_t v) const {
+ setVar(index, &v, sizeof(v));
+ }
void setVar(uint32_t index, int64_t v) const {
setVar(index, &v, sizeof(v));
}
@@ -1722,7 +1725,7 @@ class ScriptIntrinsicHistogram : public ScriptIntrinsic {
*
* @return ScriptIntrinsicHistogram
*/
- static sp<ScriptIntrinsicHistogram> create(sp<RS> rs);
+ static sp<ScriptIntrinsicHistogram> create(sp<RS> rs, sp<const Element> e);
/**
* Set the output of the histogram. 32 bit integer types are
* supported.