aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sksl/SkSLCPPCodeGenerator.cpp
diff options
context:
space:
mode:
authorGravatar Ethan Nicholas <ethannicholas@google.com>2018-06-12 11:05:59 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-06-12 19:16:03 +0000
commitd9d33c33dee064da260301faa313703e465d44c5 (patch)
treef2e9a592acde1715d71381d8ff7c97fdaf58edac /src/sksl/SkSLCPPCodeGenerator.cpp
parent22be4c4801f957f2820b9001b02b892f4b87a157 (diff)
renamed SkSL's assert macros
Since SkSL needs to run outside of Skia, it was originally using its own ASSERT macro, which mapped to SkASSERT when inside of Skia. This is causing conflicts with one or two other ASSERT macros defined around Skia, so to avoid that I am switching SkSL over to just use Skia's standard naming for these macros. Bug: skia: Change-Id: I115435d7282da03d076c6080f7b13d1972b9eb9f Reviewed-on: https://skia-review.googlesource.com/134322 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Diffstat (limited to 'src/sksl/SkSLCPPCodeGenerator.cpp')
-rw-r--r--src/sksl/SkSLCPPCodeGenerator.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/sksl/SkSLCPPCodeGenerator.cpp b/src/sksl/SkSLCPPCodeGenerator.cpp
index 851f8e843b..fe2dc701dc 100644
--- a/src/sksl/SkSLCPPCodeGenerator.cpp
+++ b/src/sksl/SkSLCPPCodeGenerator.cpp
@@ -185,7 +185,7 @@ void CPPCodeGenerator::writeRuntimeValue(const Type& type, const Layout& layout,
fFormatArgs.push_back(cppCode + ".bottom()");
} else {
printf("unsupported runtime value type '%s'\n", String(type.fName).c_str());
- ASSERT(false);
+ SkASSERT(false);
}
}
@@ -216,7 +216,7 @@ void CPPCodeGenerator::writeIntLiteral(const IntLiteral& i) {
void CPPCodeGenerator::writeSwizzle(const Swizzle& swizzle) {
if (fCPPMode) {
- ASSERT(swizzle.fComponents.size() == 1); // no support for multiple swizzle components yet
+ SkASSERT(swizzle.fComponents.size() == 1); // no support for multiple swizzle components yet
this->writeExpression(*swizzle.fBase, kPostfix_Precedence);
switch (swizzle.fComponents[0]) {
case 0: this->write(".left()"); break;
@@ -291,8 +291,8 @@ void CPPCodeGenerator::writeSwitchStatement(const SwitchStatement& s) {
void CPPCodeGenerator::writeFunctionCall(const FunctionCall& c) {
if (c.fFunction.fBuiltin && c.fFunction.fName == "process") {
- ASSERT(c.fArguments.size() == 1);
- ASSERT(Expression::kVariableReference_Kind == c.fArguments[0]->fKind);
+ SkASSERT(c.fArguments.size() == 1);
+ SkASSERT(Expression::kVariableReference_Kind == c.fArguments[0]->fKind);
int index = 0;
bool found = false;
for (const auto& p : fProgram) {
@@ -311,7 +311,7 @@ void CPPCodeGenerator::writeFunctionCall(const FunctionCall& c) {
break;
}
}
- ASSERT(found);
+ SkASSERT(found);
String childName = "_child" + to_string(index);
fExtraEmitCodeCode += " SkString " + childName + "(\"" + childName + "\");\n" +
" this->emitChild(" + to_string(index) + ", &" + childName +
@@ -323,8 +323,8 @@ void CPPCodeGenerator::writeFunctionCall(const FunctionCall& c) {
INHERITED::writeFunctionCall(c);
if (c.fFunction.fBuiltin && c.fFunction.fName == "texture") {
this->write(".%s");
- ASSERT(c.fArguments.size() >= 1);
- ASSERT(c.fArguments[0]->fKind == Expression::kVariableReference_Kind);
+ SkASSERT(c.fArguments.size() >= 1);
+ SkASSERT(c.fArguments[0]->fKind == Expression::kVariableReference_Kind);
String sampler = this->getSamplerHandle(((VariableReference&) *c.fArguments[0]).fVariable);
fFormatArgs.push_back("fragBuilder->getProgramBuilder()->samplerSwizzle(" + sampler +
").c_str()");