aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/effects
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/effects')
-rw-r--r--src/gpu/effects/GrConfigConversionEffect.cpp8
-rw-r--r--src/gpu/effects/GrConvolutionEffect.cpp8
-rw-r--r--src/gpu/effects/GrSimpleTextureEffect.cpp6
-rw-r--r--src/gpu/effects/GrSimpleTextureEffect.h10
-rw-r--r--src/gpu/effects/GrTextureDomainEffect.cpp10
-rw-r--r--src/gpu/effects/GrTextureStripAtlas.cpp50
6 files changed, 46 insertions, 46 deletions
diff --git a/src/gpu/effects/GrConfigConversionEffect.cpp b/src/gpu/effects/GrConfigConversionEffect.cpp
index d1c7fea16d..2290cb930e 100644
--- a/src/gpu/effects/GrConfigConversionEffect.cpp
+++ b/src/gpu/effects/GrConfigConversionEffect.cpp
@@ -39,7 +39,7 @@ public:
coordsType);
builder->fsCodeAppend(";\n");
if (GrConfigConversionEffect::kNone_PMConversion == fPMConversion) {
- GrAssert(fSwapRedAndBlue);
+ SkASSERT(fSwapRedAndBlue);
builder->fsCodeAppendf("\t%s = %s.bgra;\n", outputColor, outputColor);
} else {
const char* swiz = fSwapRedAndBlue ? "bgr" : "rgb";
@@ -89,7 +89,7 @@ public:
drawEffect,
conv.coordsType(),
conv.texture(0));
- GrAssert(!(matrixKey & key));
+ SkASSERT(!(matrixKey & key));
return matrixKey | key;
}
@@ -111,10 +111,10 @@ GrConfigConversionEffect::GrConfigConversionEffect(GrTexture* texture,
: GrSingleTextureEffect(texture, matrix)
, fSwapRedAndBlue(swapRedAndBlue)
, fPMConversion(pmConversion) {
- GrAssert(kRGBA_8888_GrPixelConfig == texture->config() ||
+ SkASSERT(kRGBA_8888_GrPixelConfig == texture->config() ||
kBGRA_8888_GrPixelConfig == texture->config());
// Why did we pollute our texture cache instead of using a GrSingleTextureEffect?
- GrAssert(swapRedAndBlue || kNone_PMConversion != pmConversion);
+ SkASSERT(swapRedAndBlue || kNone_PMConversion != pmConversion);
}
const GrBackendEffectFactory& GrConfigConversionEffect::getFactory() const {
diff --git a/src/gpu/effects/GrConvolutionEffect.cpp b/src/gpu/effects/GrConvolutionEffect.cpp
index 65da81111b..aad7d4938d 100644
--- a/src/gpu/effects/GrConvolutionEffect.cpp
+++ b/src/gpu/effects/GrConvolutionEffect.cpp
@@ -109,7 +109,7 @@ void GrGLConvolutionEffect::setData(const GrGLUniformManager& uman,
const GrConvolutionEffect& conv = drawEffect.castEffect<GrConvolutionEffect>();
GrTexture& texture = *conv.texture(0);
// the code we generated was for a specific kernel radius
- GrAssert(conv.radius() == fRadius);
+ SkASSERT(conv.radius() == fRadius);
float imageIncrement[2] = { 0 };
float ySign = texture.origin() != kTopLeft_GrSurfaceOrigin ? 1.0f : -1.0f;
switch (conv.direction()) {
@@ -162,8 +162,8 @@ GrConvolutionEffect::GrConvolutionEffect(GrTexture* texture,
bool useBounds,
float bounds[2])
: Gr1DKernelEffect(texture, direction, radius), fUseBounds(useBounds) {
- GrAssert(radius <= kMaxKernelRadius);
- GrAssert(NULL != kernel);
+ SkASSERT(radius <= kMaxKernelRadius);
+ SkASSERT(NULL != kernel);
int width = this->width();
for (int i = 0; i < width; i++) {
fKernel[i] = kernel[i];
@@ -178,7 +178,7 @@ GrConvolutionEffect::GrConvolutionEffect(GrTexture* texture,
bool useBounds,
float bounds[2])
: Gr1DKernelEffect(texture, direction, radius), fUseBounds(useBounds) {
- GrAssert(radius <= kMaxKernelRadius);
+ SkASSERT(radius <= kMaxKernelRadius);
int width = this->width();
float sum = 0.0f;
diff --git a/src/gpu/effects/GrSimpleTextureEffect.cpp b/src/gpu/effects/GrSimpleTextureEffect.cpp
index 06615d296b..598c6ee6bf 100644
--- a/src/gpu/effects/GrSimpleTextureEffect.cpp
+++ b/src/gpu/effects/GrSimpleTextureEffect.cpp
@@ -34,8 +34,8 @@ public:
const char* fsCoordName;
GrSLType fsCoordSLType;
if (GrEffect::kCustom_CoordsType == ste.coordsType()) {
- GrAssert(ste.getMatrix().isIdentity());
- GrAssert(1 == ste.numVertexAttribs());
+ SkASSERT(ste.getMatrix().isIdentity());
+ SkASSERT(1 == ste.numVertexAttribs());
fsCoordSLType = kVec2f_GrSLType;
const char* vsVaryingName;
builder->addVarying(kVec2f_GrSLType, "textureCoords", &vsVaryingName, &fsCoordName);
@@ -70,7 +70,7 @@ public:
const GrDrawEffect& drawEffect) SK_OVERRIDE {
const GrSimpleTextureEffect& ste = drawEffect.castEffect<GrSimpleTextureEffect>();
if (GrEffect::kCustom_CoordsType == ste.coordsType()) {
- GrAssert(ste.getMatrix().isIdentity());
+ SkASSERT(ste.getMatrix().isIdentity());
} else {
fEffectMatrix.get()->setData(uman, ste.getMatrix(), drawEffect, ste.texture(0));
}
diff --git a/src/gpu/effects/GrSimpleTextureEffect.h b/src/gpu/effects/GrSimpleTextureEffect.h
index f80ff8da86..bcce46b595 100644
--- a/src/gpu/effects/GrSimpleTextureEffect.h
+++ b/src/gpu/effects/GrSimpleTextureEffect.h
@@ -26,7 +26,7 @@ public:
static GrEffectRef* Create(GrTexture* tex,
const SkMatrix& matrix,
CoordsType coordsType = kLocal_CoordsType) {
- GrAssert(kLocal_CoordsType == coordsType || kPosition_CoordsType == coordsType);
+ SkASSERT(kLocal_CoordsType == coordsType || kPosition_CoordsType == coordsType);
AutoEffectUnref effect(SkNEW_ARGS(GrSimpleTextureEffect, (tex, matrix, GrTextureParams::kNone_FilterMode, coordsType)));
return CreateEffectRef(effect);
}
@@ -36,7 +36,7 @@ public:
const SkMatrix& matrix,
GrTextureParams::FilterMode filterMode,
CoordsType coordsType = kLocal_CoordsType) {
- GrAssert(kLocal_CoordsType == coordsType || kPosition_CoordsType == coordsType);
+ SkASSERT(kLocal_CoordsType == coordsType || kPosition_CoordsType == coordsType);
AutoEffectUnref effect(
SkNEW_ARGS(GrSimpleTextureEffect, (tex, matrix, filterMode, coordsType)));
return CreateEffectRef(effect);
@@ -46,7 +46,7 @@ public:
const SkMatrix& matrix,
const GrTextureParams& p,
CoordsType coordsType = kLocal_CoordsType) {
- GrAssert(kLocal_CoordsType == coordsType || kPosition_CoordsType == coordsType);
+ SkASSERT(kLocal_CoordsType == coordsType || kPosition_CoordsType == coordsType);
AutoEffectUnref effect(SkNEW_ARGS(GrSimpleTextureEffect, (tex, matrix, p, coordsType)));
return CreateEffectRef(effect);
}
@@ -77,7 +77,7 @@ private:
GrTextureParams::FilterMode filterMode,
CoordsType coordsType)
: GrSingleTextureEffect(texture, matrix, filterMode, coordsType) {
- GrAssert(kLocal_CoordsType == coordsType || kPosition_CoordsType == coordsType);
+ SkASSERT(kLocal_CoordsType == coordsType || kPosition_CoordsType == coordsType);
}
GrSimpleTextureEffect(GrTexture* texture,
@@ -86,7 +86,7 @@ private:
CoordsType coordsType)
: GrSingleTextureEffect(texture, matrix, params, coordsType) {
if (kCustom_CoordsType == coordsType) {
- GrAssert(matrix.isIdentity());
+ SkASSERT(matrix.isIdentity());
this->addVertexAttrib(kVec2f_GrSLType);
}
}
diff --git a/src/gpu/effects/GrTextureDomainEffect.cpp b/src/gpu/effects/GrTextureDomainEffect.cpp
index 80fa770da4..cf100d7388 100644
--- a/src/gpu/effects/GrTextureDomainEffect.cpp
+++ b/src/gpu/effects/GrTextureDomainEffect.cpp
@@ -67,7 +67,7 @@ void GrGLTextureDomainEffect::emitCode(GrGLShaderBuilder* builder,
"clampCoord");
builder->fsCodeAppend(";\n");
} else {
- GrAssert(GrTextureDomainEffect::kDecal_WrapMode == texDom.wrapMode());
+ SkASSERT(GrTextureDomainEffect::kDecal_WrapMode == texDom.wrapMode());
if (kImagination_GrGLVendor == builder->ctxInfo().vendor()) {
// On the NexusS and GalaxyNexus, the other path (with the 'any'
@@ -162,14 +162,14 @@ GrEffectRef* GrTextureDomainEffect::Create(GrTexture* texture,
// We don't currently handle domains that are empty or don't intersect the texture.
// It is OK if the domain rect is a line or point, but it should not be inverted. We do not
// handle rects that do not intersect the [0..1]x[0..1] rect.
- GrAssert(domain.fLeft <= domain.fRight);
- GrAssert(domain.fTop <= domain.fBottom);
+ SkASSERT(domain.fLeft <= domain.fRight);
+ SkASSERT(domain.fTop <= domain.fBottom);
clippedDomain.fLeft = SkMaxScalar(domain.fLeft, kFullRect.fLeft);
clippedDomain.fRight = SkMinScalar(domain.fRight, kFullRect.fRight);
clippedDomain.fTop = SkMaxScalar(domain.fTop, kFullRect.fTop);
clippedDomain.fBottom = SkMinScalar(domain.fBottom, kFullRect.fBottom);
- GrAssert(clippedDomain.fLeft <= clippedDomain.fRight);
- GrAssert(clippedDomain.fTop <= clippedDomain.fBottom);
+ SkASSERT(clippedDomain.fLeft <= clippedDomain.fRight);
+ SkASSERT(clippedDomain.fTop <= clippedDomain.fBottom);
AutoEffectUnref effect(SkNEW_ARGS(GrTextureDomainEffect, (texture,
matrix,
diff --git a/src/gpu/effects/GrTextureStripAtlas.cpp b/src/gpu/effects/GrTextureStripAtlas.cpp
index e1caceca0d..877215ecea 100644
--- a/src/gpu/effects/GrTextureStripAtlas.cpp
+++ b/src/gpu/effects/GrTextureStripAtlas.cpp
@@ -35,7 +35,7 @@ GrTextureStripAtlas::GetCache() {
// Remove the specified atlas from the cache
void GrTextureStripAtlas::CleanUp(const GrContext*, void* info) {
- GrAssert(NULL != info);
+ SkASSERT(NULL != info);
AtlasEntry* entry = static_cast<AtlasEntry*>(info);
@@ -78,7 +78,7 @@ GrTextureStripAtlas::GrTextureStripAtlas(GrTextureStripAtlas::Desc desc)
, fRows(SkNEW_ARRAY(AtlasRow, fNumRows))
, fLRUFront(NULL)
, fLRUBack(NULL) {
- GrAssert(fNumRows * fDesc.fRowHeight == fDesc.fHeight);
+ SkASSERT(fNumRows * fDesc.fRowHeight == fDesc.fHeight);
this->initLRU();
VALIDATE;
}
@@ -164,7 +164,7 @@ int GrTextureStripAtlas::lockRow(const SkBitmap& data) {
GrContext::kDontFlush_PixelOpsFlag);
}
- GrAssert(rowNumber >= 0);
+ SkASSERT(rowNumber >= 0);
VALIDATE;
return rowNumber;
}
@@ -173,7 +173,7 @@ void GrTextureStripAtlas::unlockRow(int row) {
VALIDATE;
--fRows[row].fLocks;
--fLockedRows;
- GrAssert(fRows[row].fLocks >= 0 && fLockedRows >= 0);
+ SkASSERT(fRows[row].fLocks >= 0 && fLockedRows >= 0);
if (0 == fRows[row].fLocks) {
this->appendLRU(fRows + row);
}
@@ -209,11 +209,11 @@ void GrTextureStripAtlas::lockTexture() {
this->initLRU();
fKeyTable.rewind();
}
- GrAssert(NULL != fTexture);
+ SkASSERT(NULL != fTexture);
}
void GrTextureStripAtlas::unlockTexture() {
- GrAssert(NULL != fTexture && 0 == fLockedRows);
+ SkASSERT(NULL != fTexture && 0 == fLockedRows);
fTexture->unref();
fTexture = NULL;
fDesc.fContext->purgeCache();
@@ -229,12 +229,12 @@ void GrTextureStripAtlas::initLRU() {
fRows[i].fPrev = NULL;
this->appendLRU(fRows + i);
}
- GrAssert(NULL == fLRUFront || NULL == fLRUFront->fPrev);
- GrAssert(NULL == fLRUBack || NULL == fLRUBack->fNext);
+ SkASSERT(NULL == fLRUFront || NULL == fLRUFront->fPrev);
+ SkASSERT(NULL == fLRUBack || NULL == fLRUBack->fNext);
}
void GrTextureStripAtlas::appendLRU(AtlasRow* row) {
- GrAssert(NULL == row->fPrev && NULL == row->fNext);
+ SkASSERT(NULL == row->fPrev && NULL == row->fNext);
if (NULL == fLRUFront && NULL == fLRUBack) {
fLRUFront = row;
fLRUBack = row;
@@ -246,20 +246,20 @@ void GrTextureStripAtlas::appendLRU(AtlasRow* row) {
}
void GrTextureStripAtlas::removeFromLRU(AtlasRow* row) {
- GrAssert(NULL != row);
+ SkASSERT(NULL != row);
if (NULL != row->fNext && NULL != row->fPrev) {
row->fPrev->fNext = row->fNext;
row->fNext->fPrev = row->fPrev;
} else {
if (NULL == row->fNext) {
- GrAssert(row == fLRUBack);
+ SkASSERT(row == fLRUBack);
fLRUBack = row->fPrev;
if (fLRUBack) {
fLRUBack->fNext = NULL;
}
}
if (NULL == row->fPrev) {
- GrAssert(row == fLRUFront);
+ SkASSERT(row == fLRUFront);
fLRUFront = row->fNext;
if (fLRUFront) {
fLRUFront->fPrev = NULL;
@@ -286,20 +286,20 @@ void GrTextureStripAtlas::validate() {
// Our key table should be sorted
uint32_t prev = 1 > fKeyTable.count() ? 0 : fKeyTable[0]->fKey;
for (int i = 1; i < fKeyTable.count(); ++i) {
- GrAssert(prev < fKeyTable[i]->fKey);
- GrAssert(fKeyTable[i]->fKey != kEmptyAtlasRowKey);
+ SkASSERT(prev < fKeyTable[i]->fKey);
+ SkASSERT(fKeyTable[i]->fKey != kEmptyAtlasRowKey);
prev = fKeyTable[i]->fKey;
}
int lruCount = 0;
// Validate LRU pointers, and count LRU entries
- GrAssert(NULL == fLRUFront || NULL == fLRUFront->fPrev);
- GrAssert(NULL == fLRUBack || NULL == fLRUBack->fNext);
+ SkASSERT(NULL == fLRUFront || NULL == fLRUFront->fPrev);
+ SkASSERT(NULL == fLRUBack || NULL == fLRUBack->fNext);
for (AtlasRow* r = fLRUFront; r != NULL; r = r->fNext) {
if (NULL == r->fNext) {
- GrAssert(r == fLRUBack);
+ SkASSERT(r == fLRUBack);
} else {
- GrAssert(r->fNext->fPrev == r);
+ SkASSERT(r->fNext->fPrev == r);
}
++lruCount;
}
@@ -319,30 +319,30 @@ void GrTextureStripAtlas::validate() {
break;
}
}
- GrAssert(inLRU);
+ SkASSERT(inLRU);
} else {
// If we are locked, we should have a key
- GrAssert(kEmptyAtlasRowKey != fRows[i].fKey);
+ SkASSERT(kEmptyAtlasRowKey != fRows[i].fKey);
}
// If we have a key != kEmptyAtlasRowKey, it should be in the key table
- GrAssert(fRows[i].fKey == kEmptyAtlasRowKey || this->searchByKey(fRows[i].fKey) >= 0);
+ SkASSERT(fRows[i].fKey == kEmptyAtlasRowKey || this->searchByKey(fRows[i].fKey) >= 0);
}
// Our count of locks should equal the sum of row locks, unless we ran out of rows and flushed,
// in which case we'll have one more lock than recorded in the rows (to represent the pending
// lock of a row; which ensures we don't unlock the texture prematurely).
- GrAssert(rowLocks == fLockedRows || rowLocks + 1 == fLockedRows);
+ SkASSERT(rowLocks == fLockedRows || rowLocks + 1 == fLockedRows);
// We should have one lru entry for each free row
- GrAssert(freeRows == lruCount);
+ SkASSERT(freeRows == lruCount);
// If we have locked rows, we should have a locked texture, otherwise
// it should be unlocked
if (fLockedRows == 0) {
- GrAssert(NULL == fTexture);
+ SkASSERT(NULL == fTexture);
} else {
- GrAssert(NULL != fTexture);
+ SkASSERT(NULL != fTexture);
}
}
#endif