From: bsalomon@google.com Date: Thu, 16 Aug 2012 16:26:33 +0000 (+0000) Subject: Fix assertion in in order draw buffer X-Git-Tag: accepted/tizen/5.0/unified/20181102.025319~15148 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d57d71a5b857c273d9cf834856e10e663c1ccb91;p=platform%2Fupstream%2FlibSkiaSharp.git Fix assertion in in order draw buffer Review URL: http://codereview.appspot.com/6460095/ git-svn-id: http://skia.googlecode.com/svn/trunk@5130 2bbb7eff-a529-9590-31e7-b0007b416f81 --- diff --git a/src/gpu/GrInOrderDrawBuffer.cpp b/src/gpu/GrInOrderDrawBuffer.cpp index 9f24c4e..a0585f7 100644 --- a/src/gpu/GrInOrderDrawBuffer.cpp +++ b/src/gpu/GrInOrderDrawBuffer.cpp @@ -708,8 +708,11 @@ bool GrInOrderDrawBuffer::onReserveIndexSpace(int indexCount, void** indices) { void GrInOrderDrawBuffer::releaseReservedVertexSpace() { GeometryPoolState& poolState = fGeoPoolStateStack.back(); const GeometrySrcState& geoSrc = this->getGeomSrc(); - - GrAssert(kReserved_GeometrySrcType == geoSrc.fVertexSrc); + + // 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 || + kArray_GeometrySrcType == geoSrc.fVertexSrc); // When the caller reserved vertex buffer space we gave it back a pointer // provided by the vertex buffer pool. At each draw we tracked the largest @@ -728,7 +731,10 @@ void GrInOrderDrawBuffer::releaseReservedIndexSpace() { GeometryPoolState& poolState = fGeoPoolStateStack.back(); const GeometrySrcState& geoSrc = this->getGeomSrc(); - GrAssert(kReserved_GeometrySrcType == geoSrc.fIndexSrc); + // 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 || + kArray_GeometrySrcType == geoSrc.fIndexSrc); // Similar to releaseReservedVertexSpace we return any unused portion at // the tail