| Index: src/gpu/GrGpu.cpp
|
| diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp
|
| index 74df26002d17c5692458cda6e9ba60a1a79d98ac..6ada03b62dab0ddc799219948e6d0a81a91b8a6a 100644
|
| --- a/src/gpu/GrGpu.cpp
|
| +++ b/src/gpu/GrGpu.cpp
|
| @@ -50,18 +50,6 @@ GrGpu::GrGpu(GrContext* context)
|
| }
|
|
|
| GrGpu::~GrGpu() {
|
| - this->releaseResources();
|
| -}
|
| -
|
| -void GrGpu::abandonResources() {
|
| -
|
| - fClipMaskManager.releaseResources();
|
| -
|
| - while (NULL != fObjectList.head()) {
|
| - fObjectList.head()->abandon();
|
| - }
|
| -
|
| - SkASSERT(NULL == fQuadIndexBuffer || fQuadIndexBuffer->wasDestroyed());
|
| SkSafeSetNull(fQuadIndexBuffer);
|
| delete fVertexPool;
|
| fVertexPool = NULL;
|
| @@ -69,42 +57,7 @@ void GrGpu::abandonResources() {
|
| fIndexPool = NULL;
|
| }
|
|
|
| -void GrGpu::releaseResources() {
|
| -
|
| - fClipMaskManager.releaseResources();
|
| -
|
| - while (NULL != fObjectList.head()) {
|
| - fObjectList.head()->release();
|
| - }
|
| -
|
| - SkASSERT(NULL == fQuadIndexBuffer || fQuadIndexBuffer->wasDestroyed());
|
| - SkSafeSetNull(fQuadIndexBuffer);
|
| - delete fVertexPool;
|
| - fVertexPool = NULL;
|
| - delete fIndexPool;
|
| - fIndexPool = NULL;
|
| -}
|
| -
|
| -void GrGpu::insertObject(GrGpuResource* object) {
|
| - SkASSERT(NULL != object);
|
| - SkASSERT(this == object->getGpu());
|
| -
|
| - fObjectList.addToHead(object);
|
| -}
|
| -
|
| -void GrGpu::removeObject(GrGpuResource* object) {
|
| - SkASSERT(NULL != object);
|
| - SkASSERT(this == object->getGpu());
|
| -
|
| - fObjectList.remove(object);
|
| -}
|
| -
|
| -
|
| -void GrGpu::unimpl(const char msg[]) {
|
| -#ifdef SK_DEBUG
|
| - GrPrintf("--- GrGpu unimplemented(\"%s\")\n", msg);
|
| -#endif
|
| -}
|
| +void GrGpu::contextAbandonded() {}
|
|
|
| ////////////////////////////////////////////////////////////////////////////////
|
|
|
| @@ -318,7 +271,8 @@ static inline void fill_indices(uint16_t* indices, int quadCount) {
|
| }
|
|
|
| const GrIndexBuffer* GrGpu::getQuadIndexBuffer() const {
|
| - if (NULL == fQuadIndexBuffer) {
|
| + if (NULL == fQuadIndexBuffer || fQuadIndexBuffer->wasDestroyed()) {
|
| + SkSafeUnref(fQuadIndexBuffer);
|
| static const int SIZE = sizeof(uint16_t) * 6 * MAX_QUADS;
|
| GrGpu* me = const_cast<GrGpu*>(this);
|
| fQuadIndexBuffer = me->createIndexBuffer(SIZE, false);
|
|
|