Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(494)

Unified Diff: src/gpu/gl/GrGLShaderBuilder.cpp

Issue 22850006: Replace uses of GrAssert by SkASSERT. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebase Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/gl/GrGLShaderBuilder.h ('k') | src/gpu/gl/GrGLShaderVar.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLShaderBuilder.cpp
diff --git a/src/gpu/gl/GrGLShaderBuilder.cpp b/src/gpu/gl/GrGLShaderBuilder.cpp
index 57294975f7dc4148e7914003086466b69efdfbc2..49d95914d1c643feecb6aceaef5dedbd6630ee76 100644
--- a/src/gpu/gl/GrGLShaderBuilder.cpp
+++ b/src/gpu/gl/GrGLShaderBuilder.cpp
@@ -29,7 +29,7 @@ inline const char* sample_function_name(GrSLType type, GrGLSLGeneration glslGen)
if (kVec2f_GrSLType == type) {
return glslGen >= k130_GrGLSLGeneration ? "texture" : "texture2D";
} else {
- GrAssert(kVec3f_GrSLType == type);
+ SkASSERT(kVec3f_GrSLType == type);
return glslGen >= k130_GrGLSLGeneration ? "textureProj" : "texture2DProj";
}
}
@@ -293,7 +293,7 @@ void GrGLShaderBuilder::appendTextureLookup(SkString* out,
const GrGLShaderBuilder::TextureSampler& sampler,
const char* coordName,
GrSLType varyingType) const {
- GrAssert(NULL != coordName);
+ SkASSERT(NULL != coordName);
out->appendf("%s(%s, %s)",
sample_function_name(varyingType, fCtxInfo.glslGeneration()),
@@ -306,7 +306,7 @@ void GrGLShaderBuilder::appendTextureLookup(ShaderType type,
const GrGLShaderBuilder::TextureSampler& sampler,
const char* coordName,
GrSLType varyingType) {
- GrAssert(kFragment_ShaderType == type);
+ SkASSERT(kFragment_ShaderType == type);
this->appendTextureLookup(&fFSCode, sampler, coordName, varyingType);
}
@@ -316,7 +316,7 @@ void GrGLShaderBuilder::appendTextureLookupAndModulate(
const GrGLShaderBuilder::TextureSampler& sampler,
const char* coordName,
GrSLType varyingType) {
- GrAssert(kFragment_ShaderType == type);
+ SkASSERT(kFragment_ShaderType == type);
SkString lookup;
this->appendTextureLookup(&lookup, sampler, coordName, varyingType);
GrGLSLModulatef<4>(&fFSCode, modulation, lookup.c_str());
@@ -339,7 +339,7 @@ GrGLShaderBuilder::DstReadKey GrGLShaderBuilder::KeyForDstRead(const GrTexture*
if (GrGLCaps::kNone_FBFetchType != caps.fbFetchType()) {
return key;
}
- GrAssert(NULL != dstCopy);
+ SkASSERT(NULL != dstCopy);
if (!caps.textureSwizzleSupport() && GrPixelConfigIsAlphaOnly(dstCopy->config())) {
// The fact that the config is alpha-only must be considered when generating code.
key |= kUseAlphaConfig_DstReadKeyBit;
@@ -347,7 +347,7 @@ GrGLShaderBuilder::DstReadKey GrGLShaderBuilder::KeyForDstRead(const GrTexture*
if (kTopLeft_GrSurfaceOrigin == dstCopy->origin()) {
key |= kTopLeftOrigin_DstReadKeyBit;
}
- GrAssert(static_cast<DstReadKey>(key) == key);
+ SkASSERT(static_cast<DstReadKey>(key) == key);
return static_cast<DstReadKey>(key);
}
@@ -382,10 +382,10 @@ GrGLUniformManager::UniformHandle GrGLShaderBuilder::addUniformArray(uint32_t vi
const char* name,
int count,
const char** outName) {
- GrAssert(name && strlen(name));
+ SkASSERT(name && strlen(name));
SkDEBUGCODE(static const uint32_t kVisibilityMask = kVertex_ShaderType | kFragment_ShaderType);
- GrAssert(0 == (~kVisibilityMask & visibility));
- GrAssert(0 != visibility);
+ SkASSERT(0 == (~kVisibilityMask & visibility));
+ SkASSERT(0 != visibility);
BuilderUniform& uni = fUniforms.push_back();
UniformHandle h = GrGLUniformManager::UniformHandle::CreateFromUniformIndex(fUniforms.count() - 1);
@@ -393,7 +393,7 @@ GrGLUniformManager::UniformHandle GrGLShaderBuilder::addUniformArray(uint32_t vi
fUniformManager.appendUniform(type, count);
// We expect the uniform manager to initially have no uniforms and that all uniforms are added
// by this function. Therefore, the handles should match.
- GrAssert(h2 == h);
+ SkASSERT(h2 == h);
uni.fVariable.setType(type);
uni.fVariable.setTypeModifier(GrGLShaderVar::kUniform_TypeModifier);
this->nameVariable(uni.fVariable.accessName(), 'u', name);
@@ -421,7 +421,7 @@ bool GrGLShaderBuilder::addAttribute(GrSLType type,
const GrGLShaderVar& attr = fVSAttrs[i];
// if attribute already added, don't add it again
if (attr.getName().equals(name)) {
- GrAssert(attr.getType() == type);
+ SkASSERT(attr.getType() == type);
return false;
}
}
@@ -505,7 +505,7 @@ const char* GrGLShaderBuilder::fragmentPosition() {
// temporarily change the stage index because we're inserting non-stage code.
CodeStage::AutoStageRestore csar(&fCodeStage, NULL);
- GrAssert(!fRTHeightUniform.isValid());
+ SkASSERT(!fRTHeightUniform.isValid());
const char* rtHeightName;
fRTHeightUniform = this->addUniform(kFragment_ShaderType,
@@ -517,7 +517,7 @@ const char* GrGLShaderBuilder::fragmentPosition() {
kCoordName, rtHeightName);
fSetupFragPosition = true;
}
- GrAssert(fRTHeightUniform.isValid());
+ SkASSERT(fRTHeightUniform.isValid());
return kCoordName;
}
}
@@ -530,7 +530,7 @@ void GrGLShaderBuilder::emitFunction(ShaderType shader,
const GrGLShaderVar* args,
const char* body,
SkString* outName) {
- GrAssert(kFragment_ShaderType == shader);
+ SkASSERT(kFragment_ShaderType == shader);
fFSFunctions.append(GrGLSLTypeString(returnType));
this->nameVariable(outName, '\0', name);
fFSFunctions.appendf(" %s", outName->c_str());
@@ -623,7 +623,7 @@ void GrGLShaderBuilder::getShader(ShaderType type, SkString* shaderStr) const {
this->appendUniformDecls(kFragment_ShaderType, shaderStr);
this->appendDecls(fFSInputs, shaderStr);
// We shouldn't have declared outputs on 1.10
- GrAssert(k110_GrGLSLGeneration != fCtxInfo.glslGeneration() || fFSOutputs.empty());
+ SkASSERT(k110_GrGLSLGeneration != fCtxInfo.glslGeneration() || fFSOutputs.empty());
this->appendDecls(fFSOutputs, shaderStr);
shaderStr->append(fFSFunctions);
shaderStr->append("void main() {\n");
@@ -651,7 +651,7 @@ void GrGLShaderBuilder::emitEffects(
SkString outColor;
for (int e = 0; e < effectCnt; ++e) {
- GrAssert(NULL != effectStages[e] && NULL != effectStages[e]->getEffect());
+ SkASSERT(NULL != effectStages[e] && NULL != effectStages[e]->getEffect());
const GrEffectStage& stage = *effectStages[e];
const GrEffectRef& effect = *stage.getEffect();
« no previous file with comments | « src/gpu/gl/GrGLShaderBuilder.h ('k') | src/gpu/gl/GrGLShaderVar.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698