| Index: src/gpu/GrGpu.cpp
|
| diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp
|
| index 9564a50f94f62eb735d8daaf8d58ad80ef5b08c4..3172ce96b393e8bc85095a74e30223d0037a0923 100644
|
| --- a/src/gpu/GrGpu.cpp
|
| +++ b/src/gpu/GrGpu.cpp
|
| @@ -65,7 +65,7 @@ void GrGpu::abandonResources() {
|
| fResourceList.head()->abandon();
|
| }
|
|
|
| - GrAssert(NULL == fQuadIndexBuffer || !fQuadIndexBuffer->isValid());
|
| + SkASSERT(NULL == fQuadIndexBuffer || !fQuadIndexBuffer->isValid());
|
| GrSafeSetNull(fQuadIndexBuffer);
|
| delete fVertexPool;
|
| fVertexPool = NULL;
|
| @@ -81,7 +81,7 @@ void GrGpu::releaseResources() {
|
| fResourceList.head()->release();
|
| }
|
|
|
| - GrAssert(NULL == fQuadIndexBuffer || !fQuadIndexBuffer->isValid());
|
| + SkASSERT(NULL == fQuadIndexBuffer || !fQuadIndexBuffer->isValid());
|
| GrSafeSetNull(fQuadIndexBuffer);
|
| delete fVertexPool;
|
| fVertexPool = NULL;
|
| @@ -90,15 +90,15 @@ void GrGpu::releaseResources() {
|
| }
|
|
|
| void GrGpu::insertResource(GrResource* resource) {
|
| - GrAssert(NULL != resource);
|
| - GrAssert(this == resource->getGpu());
|
| + SkASSERT(NULL != resource);
|
| + SkASSERT(this == resource->getGpu());
|
|
|
| fResourceList.addToHead(resource);
|
| }
|
|
|
| void GrGpu::removeResource(GrResource* resource) {
|
| - GrAssert(NULL != resource);
|
| - GrAssert(this == resource->getGpu());
|
| + SkASSERT(NULL != resource);
|
| + SkASSERT(this == resource->getGpu());
|
|
|
| fResourceList.remove(resource);
|
| }
|
| @@ -123,7 +123,7 @@ GrTexture* GrGpu::createTexture(const GrTextureDesc& desc,
|
| if (NULL != tex &&
|
| (kRenderTarget_GrTextureFlagBit & desc.fFlags) &&
|
| !(kNoStencil_GrTextureFlagBit & desc.fFlags)) {
|
| - GrAssert(NULL != tex->asRenderTarget());
|
| + SkASSERT(NULL != tex->asRenderTarget());
|
| // TODO: defer this and attach dynamically
|
| if (!this->attachStencilBufferToRenderTarget(tex->asRenderTarget())) {
|
| tex->unref();
|
| @@ -134,7 +134,7 @@ GrTexture* GrGpu::createTexture(const GrTextureDesc& desc,
|
| }
|
|
|
| bool GrGpu::attachStencilBufferToRenderTarget(GrRenderTarget* rt) {
|
| - GrAssert(NULL == rt->getStencilBuffer());
|
| + SkASSERT(NULL == rt->getStencilBuffer());
|
| GrStencilBuffer* sb =
|
| this->getContext()->findStencilBuffer(rt->width(),
|
| rt->height(),
|
| @@ -198,7 +198,7 @@ GrIndexBuffer* GrGpu::createIndexBuffer(uint32_t size, bool dynamic) {
|
| }
|
|
|
| GrPath* GrGpu::createPath(const SkPath& path) {
|
| - GrAssert(this->caps()->pathStencilingSupport());
|
| + SkASSERT(this->caps()->pathStencilingSupport());
|
| this->handleDirtyContext();
|
| return this->onCreatePath(path);
|
| }
|
| @@ -211,7 +211,7 @@ void GrGpu::clear(const SkIRect* rect,
|
| art.set(this->drawState(), renderTarget);
|
| }
|
| if (NULL == this->getDrawState().getRenderTarget()) {
|
| - GrAssert(0);
|
| + SkASSERT(0);
|
| return;
|
| }
|
| this->handleDirtyContext();
|
| @@ -242,7 +242,7 @@ bool GrGpu::writeTexturePixels(GrTexture* texture,
|
| }
|
|
|
| void GrGpu::resolveRenderTarget(GrRenderTarget* target) {
|
| - GrAssert(target);
|
| + SkASSERT(target);
|
| this->handleDirtyContext();
|
| this->onResolveRenderTarget(target);
|
| }
|
| @@ -331,7 +331,7 @@ void GrGpu::geometrySourceWillPush() {
|
|
|
| void GrGpu::geometrySourceWillPop(const GeometrySrcState& restoredState) {
|
| // if popping last entry then pops are unbalanced with pushes
|
| - GrAssert(fGeomPoolStateStack.count() > 1);
|
| + SkASSERT(fGeomPoolStateStack.count() > 1);
|
| fGeomPoolStateStack.pop_back();
|
| }
|
|
|
| @@ -362,18 +362,18 @@ void GrGpu::onStencilPath(const GrPath* path, const SkStrokeRec&, SkPath::FillTy
|
| }
|
|
|
| void GrGpu::finalizeReservedVertices() {
|
| - GrAssert(NULL != fVertexPool);
|
| + SkASSERT(NULL != fVertexPool);
|
| fVertexPool->unlock();
|
| }
|
|
|
| void GrGpu::finalizeReservedIndices() {
|
| - GrAssert(NULL != fIndexPool);
|
| + SkASSERT(NULL != fIndexPool);
|
| fIndexPool->unlock();
|
| }
|
|
|
| void GrGpu::prepareVertexPool() {
|
| if (NULL == fVertexPool) {
|
| - GrAssert(0 == fVertexPoolUseCnt);
|
| + SkASSERT(0 == fVertexPoolUseCnt);
|
| fVertexPool = SkNEW_ARGS(GrVertexBufferAllocPool, (this, true,
|
| VERTEX_POOL_VB_SIZE,
|
| VERTEX_POOL_VB_COUNT));
|
| @@ -386,7 +386,7 @@ void GrGpu::prepareVertexPool() {
|
|
|
| void GrGpu::prepareIndexPool() {
|
| if (NULL == fIndexPool) {
|
| - GrAssert(0 == fIndexPoolUseCnt);
|
| + SkASSERT(0 == fIndexPoolUseCnt);
|
| fIndexPool = SkNEW_ARGS(GrIndexBufferAllocPool, (this, true,
|
| INDEX_POOL_IB_SIZE,
|
| INDEX_POOL_IB_COUNT));
|
| @@ -402,8 +402,8 @@ bool GrGpu::onReserveVertexSpace(size_t vertexSize,
|
| void** vertices) {
|
| GeometryPoolState& geomPoolState = fGeomPoolStateStack.back();
|
|
|
| - GrAssert(vertexCount > 0);
|
| - GrAssert(NULL != vertices);
|
| + SkASSERT(vertexCount > 0);
|
| + SkASSERT(NULL != vertices);
|
|
|
| this->prepareVertexPool();
|
|
|
| @@ -421,8 +421,8 @@ bool GrGpu::onReserveVertexSpace(size_t vertexSize,
|
| bool GrGpu::onReserveIndexSpace(int indexCount, void** indices) {
|
| GeometryPoolState& geomPoolState = fGeomPoolStateStack.back();
|
|
|
| - GrAssert(indexCount > 0);
|
| - GrAssert(NULL != indices);
|
| + SkASSERT(indexCount > 0);
|
| + SkASSERT(NULL != indices);
|
|
|
| this->prepareIndexPool();
|
|
|
| @@ -438,7 +438,7 @@ bool GrGpu::onReserveIndexSpace(int indexCount, void** indices) {
|
|
|
| void GrGpu::releaseReservedVertexSpace() {
|
| const GeometrySrcState& geoSrc = this->getGeomSrc();
|
| - GrAssert(kReserved_GeometrySrcType == geoSrc.fVertexSrc);
|
| + SkASSERT(kReserved_GeometrySrcType == geoSrc.fVertexSrc);
|
| size_t bytes = geoSrc.fVertexCount * geoSrc.fVertexSize;
|
| fVertexPool->putBack(bytes);
|
| --fVertexPoolUseCnt;
|
| @@ -446,7 +446,7 @@ void GrGpu::releaseReservedVertexSpace() {
|
|
|
| void GrGpu::releaseReservedIndexSpace() {
|
| const GeometrySrcState& geoSrc = this->getGeomSrc();
|
| - GrAssert(kReserved_GeometrySrcType == geoSrc.fIndexSrc);
|
| + SkASSERT(kReserved_GeometrySrcType == geoSrc.fIndexSrc);
|
| size_t bytes = geoSrc.fIndexCount * sizeof(uint16_t);
|
| fIndexPool->putBack(bytes);
|
| --fIndexPoolUseCnt;
|
| @@ -484,7 +484,7 @@ void GrGpu::onSetIndexSourceToArray(const void* indexArray, int indexCount) {
|
| void GrGpu::releaseVertexArray() {
|
| // if vertex source was array, we stowed data in the pool
|
| const GeometrySrcState& geoSrc = this->getGeomSrc();
|
| - GrAssert(kArray_GeometrySrcType == geoSrc.fVertexSrc);
|
| + SkASSERT(kArray_GeometrySrcType == geoSrc.fVertexSrc);
|
| size_t bytes = geoSrc.fVertexCount * geoSrc.fVertexSize;
|
| fVertexPool->putBack(bytes);
|
| --fVertexPoolUseCnt;
|
| @@ -493,7 +493,7 @@ void GrGpu::releaseVertexArray() {
|
| void GrGpu::releaseIndexArray() {
|
| // if index source was array, we stowed data in the pool
|
| const GeometrySrcState& geoSrc = this->getGeomSrc();
|
| - GrAssert(kArray_GeometrySrcType == geoSrc.fIndexSrc);
|
| + SkASSERT(kArray_GeometrySrcType == geoSrc.fIndexSrc);
|
| size_t bytes = geoSrc.fIndexCount * sizeof(uint16_t);
|
| fIndexPool->putBack(bytes);
|
| --fIndexPoolUseCnt;
|
|
|