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

Unified Diff: src/gpu/GrInOrderDrawBuffer.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/GrGpu.cpp ('k') | src/gpu/GrMemoryPool.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrInOrderDrawBuffer.cpp
diff --git a/src/gpu/GrInOrderDrawBuffer.cpp b/src/gpu/GrInOrderDrawBuffer.cpp
index 9e0d21393e84c6cc504a6a8626ecee3c7b30255a..0b7a4880a6188d4671c8c9cbdce38e87fd76bf71 100644
--- a/src/gpu/GrInOrderDrawBuffer.cpp
+++ b/src/gpu/GrInOrderDrawBuffer.cpp
@@ -33,8 +33,8 @@ GrInOrderDrawBuffer::GrInOrderDrawBuffer(GrGpu* gpu,
fDstGpu->ref();
fCaps.reset(SkRef(fDstGpu->caps()));
- GrAssert(NULL != vertexPool);
- GrAssert(NULL != indexPool);
+ SkASSERT(NULL != vertexPool);
+ SkASSERT(NULL != indexPool);
GeometryPoolState& poolState = fGeoPoolStateStack.push_back();
poolState.fUsedPoolVertexBytes = 0;
@@ -62,8 +62,8 @@ void get_vertex_bounds(const void* vertices,
size_t vertexSize,
int vertexCount,
SkRect* bounds) {
- GrAssert(vertexSize >= sizeof(GrPoint));
- GrAssert(vertexCount > 0);
+ SkASSERT(vertexSize >= sizeof(GrPoint));
+ SkASSERT(vertexCount > 0);
const GrPoint* point = static_cast<const GrPoint*>(vertices);
bounds->fLeft = bounds->fRight = point->fX;
bounds->fTop = bounds->fBottom = point->fY;
@@ -196,7 +196,7 @@ void GrInOrderDrawBuffer::onDrawRect(const SkRect& rect,
this->drawIndexedInstances(kTriangles_GrPrimitiveType, 1, 4, 6, &devBounds);
// to ensure that stashing the drawState ptr is valid
- GrAssert(this->drawState() == drawState);
+ SkASSERT(this->drawState() == drawState);
}
bool GrInOrderDrawBuffer::quickInsideClip(const SkRect& devBounds) {
@@ -242,7 +242,7 @@ bool GrInOrderDrawBuffer::quickInsideClip(const SkRect& devBounds) {
}
int GrInOrderDrawBuffer::concatInstancedDraw(const DrawInfo& info) {
- GrAssert(info.isInstanced());
+ SkASSERT(info.isInstanced());
const GeometrySrcState& geomSrc = this->getGeomSrc();
const GrDrawState& drawState = this->getDrawState();
@@ -278,7 +278,7 @@ int GrInOrderDrawBuffer::concatInstancedDraw(const DrawInfo& info) {
return 0;
}
- GrAssert(poolState.fPoolStartVertex == draw->startVertex() + draw->vertexCount());
+ SkASSERT(poolState.fPoolStartVertex == draw->startVertex() + draw->vertexCount());
// how many instances can be concat'ed onto draw given the size of the index buffer
int instancesToConcat = this->indexCountInCurrentSource() / info.indicesPerInstance();
@@ -406,7 +406,7 @@ void GrInOrderDrawBuffer::clear(const SkIRect* rect, GrColor color, GrRenderTarg
SkIRect r;
if (NULL == renderTarget) {
renderTarget = this->drawState()->getRenderTarget();
- GrAssert(NULL != renderTarget);
+ SkASSERT(NULL != renderTarget);
}
if (NULL == rect) {
// We could do something smart and remove previous draws and clears to
@@ -423,13 +423,13 @@ void GrInOrderDrawBuffer::clear(const SkIRect* rect, GrColor color, GrRenderTarg
}
void GrInOrderDrawBuffer::reset() {
- GrAssert(1 == fGeoPoolStateStack.count());
+ SkASSERT(1 == fGeoPoolStateStack.count());
this->resetVertexSource();
this->resetIndexSource();
int numDraws = fDraws.count();
for (int d = 0; d < numDraws; ++d) {
// we always have a VB, but not always an IB
- GrAssert(NULL != fDraws[d].fVertexBuffer);
+ SkASSERT(NULL != fDraws[d].fVertexBuffer);
fDraws[d].fVertexBuffer->unref();
GrSafeUnref(fDraws[d].fIndexBuffer);
}
@@ -451,8 +451,8 @@ void GrInOrderDrawBuffer::flush() {
return;
}
- GrAssert(kReserved_GeometrySrcType != this->getGeomSrc().fVertexSrc);
- GrAssert(kReserved_GeometrySrcType != this->getGeomSrc().fIndexSrc);
+ SkASSERT(kReserved_GeometrySrcType != this->getGeomSrc().fVertexSrc);
+ SkASSERT(kReserved_GeometrySrcType != this->getGeomSrc().fIndexSrc);
int numCmds = fCmds.count();
if (0 == numCmds) {
@@ -527,12 +527,12 @@ void GrInOrderDrawBuffer::flush() {
}
}
// we should have consumed all the states, clips, etc.
- GrAssert(fStates.count() == currState);
- GrAssert(fClips.count() == currClip);
- GrAssert(fClipOrigins.count() == currClip);
- GrAssert(fClears.count() == currClear);
- GrAssert(fDraws.count() == currDraw);
- GrAssert(fCopySurfaces.count() == currCopySurface);
+ SkASSERT(fStates.count() == currState);
+ SkASSERT(fClips.count() == currClip);
+ SkASSERT(fClipOrigins.count() == currClip);
+ SkASSERT(fClears.count() == currClear);
+ SkASSERT(fDraws.count() == currDraw);
+ SkASSERT(fCopySurfaces.count() == currCopySurface);
fDstGpu->setDrawState(prevDrawState);
prevDrawState->unref();
@@ -637,9 +637,9 @@ bool GrInOrderDrawBuffer::onReserveVertexSpace(size_t vertexSize,
int vertexCount,
void** vertices) {
GeometryPoolState& poolState = fGeoPoolStateStack.back();
- GrAssert(vertexCount > 0);
- GrAssert(NULL != vertices);
- GrAssert(0 == poolState.fUsedPoolVertexBytes);
+ SkASSERT(vertexCount > 0);
+ SkASSERT(NULL != vertices);
+ SkASSERT(0 == poolState.fUsedPoolVertexBytes);
*vertices = fVertexPool.makeSpace(vertexSize,
vertexCount,
@@ -650,9 +650,9 @@ bool GrInOrderDrawBuffer::onReserveVertexSpace(size_t vertexSize,
bool GrInOrderDrawBuffer::onReserveIndexSpace(int indexCount, void** indices) {
GeometryPoolState& poolState = fGeoPoolStateStack.back();
- GrAssert(indexCount > 0);
- GrAssert(NULL != indices);
- GrAssert(0 == poolState.fUsedPoolIndexBytes);
+ SkASSERT(indexCount > 0);
+ SkASSERT(NULL != indices);
+ SkASSERT(0 == poolState.fUsedPoolIndexBytes);
*indices = fIndexPool.makeSpace(indexCount,
&poolState.fPoolIndexBuffer,
@@ -666,7 +666,7 @@ void GrInOrderDrawBuffer::releaseReservedVertexSpace() {
// If we get a release vertex space call then our current source should either be reserved
// or array (which we copied into reserved space).
- GrAssert(kReserved_GeometrySrcType == geoSrc.fVertexSrc ||
+ SkASSERT(kReserved_GeometrySrcType == geoSrc.fVertexSrc ||
kArray_GeometrySrcType == geoSrc.fVertexSrc);
// When the caller reserved vertex buffer space we gave it back a pointer
@@ -687,7 +687,7 @@ void GrInOrderDrawBuffer::releaseReservedIndexSpace() {
// If we get a release index space call then our current source should either be reserved
// or array (which we copied into reserved space).
- GrAssert(kReserved_GeometrySrcType == geoSrc.fIndexSrc ||
+ SkASSERT(kReserved_GeometrySrcType == geoSrc.fIndexSrc ||
kArray_GeometrySrcType == geoSrc.fIndexSrc);
// Similar to releaseReservedVertexSpace we return any unused portion at
@@ -703,7 +703,7 @@ void GrInOrderDrawBuffer::onSetVertexSourceToArray(const void* vertexArray,
int vertexCount) {
GeometryPoolState& poolState = fGeoPoolStateStack.back();
- GrAssert(0 == poolState.fUsedPoolVertexBytes);
+ SkASSERT(0 == poolState.fUsedPoolVertexBytes);
#if GR_DEBUG
bool success =
#endif
@@ -718,7 +718,7 @@ void GrInOrderDrawBuffer::onSetVertexSourceToArray(const void* vertexArray,
void GrInOrderDrawBuffer::onSetIndexSourceToArray(const void* indexArray,
int indexCount) {
GeometryPoolState& poolState = fGeoPoolStateStack.back();
- GrAssert(0 == poolState.fUsedPoolIndexBytes);
+ SkASSERT(0 == poolState.fUsedPoolIndexBytes);
#if GR_DEBUG
bool success =
#endif
@@ -755,7 +755,7 @@ void GrInOrderDrawBuffer::geometrySourceWillPush() {
void GrInOrderDrawBuffer::geometrySourceWillPop(
const GeometrySrcState& restoredState) {
- GrAssert(fGeoPoolStateStack.count() > 1);
+ SkASSERT(fGeoPoolStateStack.count() > 1);
fGeoPoolStateStack.pop_back();
GeometryPoolState& poolState = fGeoPoolStateStack.back();
// we have to assume that any slack we had in our vertex/index data
@@ -777,7 +777,7 @@ bool GrInOrderDrawBuffer::needsNewState() const {
}
bool GrInOrderDrawBuffer::needsNewClip() const {
- GrAssert(fClips.count() == fClipOrigins.count());
+ SkASSERT(fClips.count() == fClipOrigins.count());
if (this->getDrawState().isClipState()) {
if (fClipSet &&
(fClips.empty() ||
« no previous file with comments | « src/gpu/GrGpu.cpp ('k') | src/gpu/GrMemoryPool.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698