summaryrefslogtreecommitdiff
path: root/cpp/ScriptIntrinsics.cpp
diff options
context:
space:
mode:
authorChris Wailes <chriswailes@google.com>2014-08-12 13:51:10 -0700
committerStephen Hines <srhines@google.com>2014-08-20 18:14:27 -0700
commit44bef6fba6244292b751387f3d6c31cca96c28ad (patch)
treea9dd48535a1f3343315bc75f7751cf042c05dc67 /cpp/ScriptIntrinsics.cpp
parent4bb773ef75eeff5960852b733bcca5834020ee9e (diff)
downloadrs-44bef6fba6244292b751387f3d6c31cca96c28ad.tar.gz
Replace NULL macros with nullptr literals.
Change-Id: I918c40879aa547438f77e7d1a95fa2aa33bec398
Diffstat (limited to 'cpp/ScriptIntrinsics.cpp')
-rw-r--r--cpp/ScriptIntrinsics.cpp73
1 files changed, 37 insertions, 36 deletions
diff --git a/cpp/ScriptIntrinsics.cpp b/cpp/ScriptIntrinsics.cpp
index ba1e5f44..42903ce4 100644
--- a/cpp/ScriptIntrinsics.cpp
+++ b/cpp/ScriptIntrinsics.cpp
@@ -23,7 +23,7 @@ using namespace android;
using namespace RSC;
ScriptIntrinsic::ScriptIntrinsic(sp<RS> rs, int id, sp<const Element> e)
- : Script(NULL, rs) {
+ : Script(nullptr, rs) {
mID = createDispatch(rs, RS::dispatch->ScriptIntrinsicCreate(rs->getContext(), id, e->getID()));
mElement = e;
}
@@ -35,7 +35,7 @@ ScriptIntrinsic::~ScriptIntrinsic() {
sp<ScriptIntrinsic3DLUT> ScriptIntrinsic3DLUT::create(sp<RS> rs, sp<const Element> e) {
if (e->isCompatible(Element::U8_4(rs)) == false) {
rs->throwError(RS_ERROR_INVALID_ELEMENT, "Element not supported for intrinsic");
- return NULL;
+ return nullptr;
}
return new ScriptIntrinsic3DLUT(rs, e);
}
@@ -50,7 +50,7 @@ void ScriptIntrinsic3DLUT::forEach(sp<Allocation> ain, sp<Allocation> aout) {
mRS->throwError(RS_ERROR_INVALID_ELEMENT, "3DLUT forEach element mismatch");
return;
}
- Script::forEach(0, ain, aout, NULL, 0);
+ Script::forEach(0, ain, aout, nullptr, 0);
}
void ScriptIntrinsic3DLUT::setLUT(sp<Allocation> lut) {
sp<const Type> t = lut->getType();
@@ -69,7 +69,7 @@ void ScriptIntrinsic3DLUT::setLUT(sp<Allocation> lut) {
sp<ScriptIntrinsicBlend> ScriptIntrinsicBlend::create(sp<RS> rs, sp<const Element> e) {
if (e->isCompatible(Element::U8_4(rs)) == false) {
rs->throwError(RS_ERROR_INVALID_ELEMENT, "Element not supported for intrinsic");
- return NULL;
+ return nullptr;
}
return new ScriptIntrinsicBlend(rs, e);
}
@@ -83,7 +83,7 @@ void ScriptIntrinsicBlend::forEachClear(sp<Allocation> in, sp<Allocation> out) {
out->getType()->getElement()->isCompatible(mElement) == false) {
mRS->throwError(RS_ERROR_INVALID_ELEMENT, "Invalid element in blend");
}
- Script::forEach(0, in, out, NULL, 0);
+ Script::forEach(0, in, out, nullptr, 0);
}
void ScriptIntrinsicBlend::forEachSrc(sp<Allocation> in, sp<Allocation> out) {
@@ -91,7 +91,7 @@ void ScriptIntrinsicBlend::forEachSrc(sp<Allocation> in, sp<Allocation> out) {
out->getType()->getElement()->isCompatible(mElement) == false) {
mRS->throwError(RS_ERROR_INVALID_ELEMENT, "Invalid element in blend");
}
- Script::forEach(1, in, out, NULL, 0);
+ Script::forEach(1, in, out, nullptr, 0);
}
void ScriptIntrinsicBlend::forEachDst(sp<Allocation> in, sp<Allocation> out) {
@@ -99,7 +99,7 @@ void ScriptIntrinsicBlend::forEachDst(sp<Allocation> in, sp<Allocation> out) {
out->getType()->getElement()->isCompatible(mElement) == false) {
mRS->throwError(RS_ERROR_INVALID_ELEMENT, "Invalid element in blend");
}
- Script::forEach(2, in, out, NULL, 0);
+ Script::forEach(2, in, out, nullptr, 0);
}
void ScriptIntrinsicBlend::forEachSrcOver(sp<Allocation> in, sp<Allocation> out) {
@@ -107,7 +107,7 @@ void ScriptIntrinsicBlend::forEachSrcOver(sp<Allocation> in, sp<Allocation> out)
out->getType()->getElement()->isCompatible(mElement) == false) {
mRS->throwError(RS_ERROR_INVALID_ELEMENT, "Invalid element in blend");
}
- Script::forEach(3, in, out, NULL, 0);
+ Script::forEach(3, in, out, nullptr, 0);
}
void ScriptIntrinsicBlend::forEachDstOver(sp<Allocation> in, sp<Allocation> out) {
@@ -115,7 +115,7 @@ void ScriptIntrinsicBlend::forEachDstOver(sp<Allocation> in, sp<Allocation> out)
out->getType()->getElement()->isCompatible(mElement) == false) {
mRS->throwError(RS_ERROR_INVALID_ELEMENT, "Invalid element in blend");
}
- Script::forEach(4, in, out, NULL, 0);
+ Script::forEach(4, in, out, nullptr, 0);
}
void ScriptIntrinsicBlend::forEachSrcIn(sp<Allocation> in, sp<Allocation> out) {
@@ -123,7 +123,7 @@ void ScriptIntrinsicBlend::forEachSrcIn(sp<Allocation> in, sp<Allocation> out) {
out->getType()->getElement()->isCompatible(mElement) == false) {
mRS->throwError(RS_ERROR_INVALID_ELEMENT, "Invalid element in blend");
}
- Script::forEach(5, in, out, NULL, 0);
+ Script::forEach(5, in, out, nullptr, 0);
}
void ScriptIntrinsicBlend::forEachDstIn(sp<Allocation> in, sp<Allocation> out) {
@@ -131,7 +131,7 @@ void ScriptIntrinsicBlend::forEachDstIn(sp<Allocation> in, sp<Allocation> out) {
out->getType()->getElement()->isCompatible(mElement) == false) {
mRS->throwError(RS_ERROR_INVALID_ELEMENT, "Invalid element in blend");
}
- Script::forEach(6, in, out, NULL, 0);
+ Script::forEach(6, in, out, nullptr, 0);
}
void ScriptIntrinsicBlend::forEachSrcOut(sp<Allocation> in, sp<Allocation> out) {
@@ -139,7 +139,7 @@ void ScriptIntrinsicBlend::forEachSrcOut(sp<Allocation> in, sp<Allocation> out)
out->getType()->getElement()->isCompatible(mElement) == false) {
mRS->throwError(RS_ERROR_INVALID_ELEMENT, "Invalid element in blend");
}
- Script::forEach(7, in, out, NULL, 0);
+ Script::forEach(7, in, out, nullptr, 0);
}
void ScriptIntrinsicBlend::forEachDstOut(sp<Allocation> in, sp<Allocation> out) {
@@ -147,7 +147,7 @@ void ScriptIntrinsicBlend::forEachDstOut(sp<Allocation> in, sp<Allocation> out)
out->getType()->getElement()->isCompatible(mElement) == false) {
mRS->throwError(RS_ERROR_INVALID_ELEMENT, "Invalid element in blend");
}
- Script::forEach(8, in, out, NULL, 0);
+ Script::forEach(8, in, out, nullptr, 0);
}
void ScriptIntrinsicBlend::forEachSrcAtop(sp<Allocation> in, sp<Allocation> out) {
@@ -155,7 +155,7 @@ void ScriptIntrinsicBlend::forEachSrcAtop(sp<Allocation> in, sp<Allocation> out)
out->getType()->getElement()->isCompatible(mElement) == false) {
mRS->throwError(RS_ERROR_INVALID_ELEMENT, "Invalid element in blend");
}
- Script::forEach(9, in, out, NULL, 0);
+ Script::forEach(9, in, out, nullptr, 0);
}
void ScriptIntrinsicBlend::forEachDstAtop(sp<Allocation> in, sp<Allocation> out) {
@@ -163,7 +163,7 @@ void ScriptIntrinsicBlend::forEachDstAtop(sp<Allocation> in, sp<Allocation> out)
out->getType()->getElement()->isCompatible(mElement) == false) {
mRS->throwError(RS_ERROR_INVALID_ELEMENT, "Invalid element in blend");
}
- Script::forEach(10, in, out, NULL, 0);
+ Script::forEach(10, in, out, nullptr, 0);
}
void ScriptIntrinsicBlend::forEachXor(sp<Allocation> in, sp<Allocation> out) {
@@ -171,7 +171,7 @@ void ScriptIntrinsicBlend::forEachXor(sp<Allocation> in, sp<Allocation> out) {
out->getType()->getElement()->isCompatible(mElement) == false) {
mRS->throwError(RS_ERROR_INVALID_ELEMENT, "Invalid element in blend");
}
- Script::forEach(11, in, out, NULL, 0);
+ Script::forEach(11, in, out, nullptr, 0);
}
// Numbering jumps here
@@ -180,7 +180,7 @@ void ScriptIntrinsicBlend::forEachMultiply(sp<Allocation> in, sp<Allocation> out
out->getType()->getElement()->isCompatible(mElement) == false) {
mRS->throwError(RS_ERROR_INVALID_ELEMENT, "Invalid element in blend");
}
- Script::forEach(14, in, out, NULL, 0);
+ Script::forEach(14, in, out, nullptr, 0);
}
// Numbering jumps here
@@ -189,7 +189,7 @@ void ScriptIntrinsicBlend::forEachAdd(sp<Allocation> in, sp<Allocation> out) {
out->getType()->getElement()->isCompatible(mElement) == false) {
mRS->throwError(RS_ERROR_INVALID_ELEMENT, "Invalid element in blend");
}
- Script::forEach(34, in, out, NULL, 0);
+ Script::forEach(34, in, out, nullptr, 0);
}
void ScriptIntrinsicBlend::forEachSubtract(sp<Allocation> in, sp<Allocation> out) {
@@ -197,7 +197,7 @@ void ScriptIntrinsicBlend::forEachSubtract(sp<Allocation> in, sp<Allocation> out
out->getType()->getElement()->isCompatible(mElement) == false) {
mRS->throwError(RS_ERROR_INVALID_ELEMENT, "Invalid element in blend");
}
- Script::forEach(35, in, out, NULL, 0);
+ Script::forEach(35, in, out, nullptr, 0);
}
@@ -207,7 +207,7 @@ sp<ScriptIntrinsicBlur> ScriptIntrinsicBlur::create(sp<RS> rs, sp<const Element>
if ((e->isCompatible(Element::U8_4(rs)) == false) &&
(e->isCompatible(Element::U8(rs)) == false)) {
rs->throwError(RS_ERROR_INVALID_ELEMENT, "Invalid element in blur");
- return NULL;
+ return nullptr;
}
return new ScriptIntrinsicBlur(rs, e);
}
@@ -230,7 +230,7 @@ void ScriptIntrinsicBlur::forEach(sp<Allocation> out) {
mRS->throwError(RS_ERROR_INVALID_ELEMENT, "Invalid element in blur output");
return;
}
- Script::forEach(0, NULL, out, NULL, 0);
+ Script::forEach(0, nullptr, out, nullptr, 0);
}
void ScriptIntrinsicBlur::setRadius(float radius) {
@@ -279,7 +279,7 @@ void ScriptIntrinsicColorMatrix::forEach(sp<Allocation> in, sp<Allocation> out)
return;
}
- Script::forEach(0, in, out, NULL, 0);
+ Script::forEach(0, in, out, nullptr, 0);
}
void ScriptIntrinsicColorMatrix::setAdd(float* add) {
@@ -346,7 +346,7 @@ sp<ScriptIntrinsicConvolve3x3> ScriptIntrinsicConvolve3x3::create(sp<RS> rs, sp<
!(e->isCompatible(Element::F32_3(rs))) &&
!(e->isCompatible(Element::F32_4(rs)))) {
rs->throwError(RS_ERROR_INVALID_ELEMENT, "Invalid element for Convolve3x3");
- return NULL;
+ return nullptr;
}
return new ScriptIntrinsicConvolve3x3(rs, e);
@@ -370,7 +370,7 @@ void ScriptIntrinsicConvolve3x3::forEach(sp<Allocation> out) {
mRS->throwError(RS_ERROR_INVALID_ELEMENT, "Element mismatch in Convolve3x3");
return;
}
- Script::forEach(0, NULL, out, NULL, 0);
+ Script::forEach(0, nullptr, out, nullptr, 0);
}
void ScriptIntrinsicConvolve3x3::setCoefficients(float* v) {
@@ -387,7 +387,7 @@ sp<ScriptIntrinsicConvolve5x5> ScriptIntrinsicConvolve5x5::create(sp<RS> rs, sp<
!(e->isCompatible(Element::F32_3(rs))) &&
!(e->isCompatible(Element::F32_4(rs)))) {
rs->throwError(RS_ERROR_INVALID_ELEMENT, "Invalid element for Convolve5x5");
- return NULL;
+ return nullptr;
}
return new ScriptIntrinsicConvolve5x5(rs, e);
@@ -412,7 +412,7 @@ void ScriptIntrinsicConvolve5x5::forEach(sp<Allocation> out) {
return;
}
- Script::forEach(0, NULL, out, NULL, 0);
+ Script::forEach(0, nullptr, out, nullptr, 0);
}
void ScriptIntrinsicConvolve5x5::setCoefficients(float* v) {
@@ -420,7 +420,7 @@ void ScriptIntrinsicConvolve5x5::setCoefficients(float* v) {
}
sp<ScriptIntrinsicHistogram> ScriptIntrinsicHistogram::create(sp<RS> rs) {
- return new ScriptIntrinsicHistogram(rs, NULL);
+ return new ScriptIntrinsicHistogram(rs, nullptr);
}
ScriptIntrinsicHistogram::ScriptIntrinsicHistogram(sp<RS> rs, sp<const Element> e)
@@ -483,7 +483,7 @@ void ScriptIntrinsicHistogram::forEach(sp<Allocation> ain) {
return;
}
- Script::forEach(0, ain, NULL, NULL, 0);
+ Script::forEach(0, ain, nullptr, nullptr, 0);
}
@@ -501,13 +501,13 @@ void ScriptIntrinsicHistogram::forEach_dot(sp<Allocation> ain) {
return;
}
- Script::forEach(1, ain, NULL, NULL, 0);
+ Script::forEach(1, ain, nullptr, nullptr, 0);
}
sp<ScriptIntrinsicLUT> ScriptIntrinsicLUT::create(sp<RS> rs, sp<const Element> e) {
if (!(e->isCompatible(Element::U8_4(rs)))) {
rs->throwError(RS_ERROR_INVALID_ELEMENT, "Invalid element for LUT");
- return NULL;
+ return nullptr;
}
return new ScriptIntrinsicLUT(rs, e);
}
@@ -534,7 +534,7 @@ void ScriptIntrinsicLUT::forEach(sp<Allocation> ain, sp<Allocation> aout) {
mRS->throwError(RS_ERROR_INVALID_ELEMENT, "Invalid element for LUT");
return;
}
- Script::forEach(0, ain, aout, NULL, 0);
+ Script::forEach(0, ain, aout, nullptr, 0);
}
@@ -572,7 +572,7 @@ ScriptIntrinsicLUT::~ScriptIntrinsicLUT() {
sp<ScriptIntrinsicYuvToRGB> ScriptIntrinsicYuvToRGB::create(sp<RS> rs, sp<const Element> e) {
if (!(e->isCompatible(Element::U8_4(rs)))) {
rs->throwError(RS_ERROR_INVALID_ELEMENT, "Invalid element for YuvToRGB");
- return NULL;
+ return nullptr;
}
return new ScriptIntrinsicYuvToRGB(rs, e);
}
@@ -596,13 +596,13 @@ void ScriptIntrinsicYuvToRGB::forEach(sp<Allocation> out) {
return;
}
- Script::forEach(0, NULL, out, NULL, 0);
+ Script::forEach(0, nullptr, out, nullptr, 0);
}
sp<ScriptIntrinsicVP9LoopFilter> ScriptIntrinsicVP9LoopFilter::create(sp<RS> rs, sp<const Element> e) {
if (!(e->isCompatible(Element::U8(rs)))) {
rs->throwError(RS_ERROR_INVALID_ELEMENT, "Invalid element for Vp9LoopFilter");
- return NULL;
+ return nullptr;
}
return new ScriptIntrinsicVP9LoopFilter(rs, e);
}
@@ -610,7 +610,8 @@ sp<ScriptIntrinsicVP9LoopFilter> ScriptIntrinsicVP9LoopFilter::create(sp<RS> rs,
ScriptIntrinsicVP9LoopFilter::ScriptIntrinsicVP9LoopFilter(sp<RS> rs, sp<const Element> e)
: ScriptIntrinsic(rs, RS_SCRIPT_INTRINSIC_ID_LOOP_FILTER, e) {
sp<const Type> t_pad = Type::create(rs, e, 1, 0, 0);
- mPadAlloc = Allocation::createTyped(rs, t_pad, RS_ALLOCATION_MIPMAP_NONE, RS_ALLOCATION_USAGE_SCRIPT, NULL);
+ mPadAlloc = Allocation::createTyped(rs, t_pad, RS_ALLOCATION_MIPMAP_NONE,
+ RS_ALLOCATION_USAGE_SCRIPT, nullptr);
}
void ScriptIntrinsicVP9LoopFilter::setLoopFilterDomain(int start, int stop, int numPlanes, int miRows, int miCols) {
@@ -641,5 +642,5 @@ void ScriptIntrinsicVP9LoopFilter::forEach(sp<Allocation> frameBuffer) {
return;
}
Script::setVar(4, frameBuffer);
- Script::forEach(0, mPadAlloc, NULL, NULL, 0);
+ Script::forEach(0, mPadAlloc, nullptr, nullptr, 0);
}