| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 #include "GrDebugGL.h" | 9 #include "GrDebugGL.h" |
| 10 #include "GrTextureObj.h" | 10 #include "GrTextureObj.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 GrDebugGL::GrDebugGL() | 33 GrDebugGL::GrDebugGL() |
| 34 : fPackRowLength(0) | 34 : fPackRowLength(0) |
| 35 , fUnPackRowLength(0) | 35 , fUnPackRowLength(0) |
| 36 , fCurTextureUnit(0) | 36 , fCurTextureUnit(0) |
| 37 , fArrayBuffer(NULL) | 37 , fArrayBuffer(NULL) |
| 38 , fElementArrayBuffer(NULL) | 38 , fElementArrayBuffer(NULL) |
| 39 , fFrameBuffer(NULL) | 39 , fFrameBuffer(NULL) |
| 40 , fRenderBuffer(NULL) | 40 , fRenderBuffer(NULL) |
| 41 , fProgram(NULL) | 41 , fProgram(NULL) |
| 42 , fTexture(NULL) | 42 , fTexture(NULL) |
| 43 , fVertexArray(NULL) { | 43 , fVertexArray(NULL) |
| 44 , fAbandoned(false) { |
| 44 | 45 |
| 45 for (int i = 0; i < kDefaultMaxTextureUnits; ++i) { | 46 for (int i = 0; i < kDefaultMaxTextureUnits; ++i) { |
| 46 | 47 |
| 47 fTextureUnits[i] = reinterpret_cast<GrTextureUnitObj *>( | 48 fTextureUnits[i] = reinterpret_cast<GrTextureUnitObj *>( |
| 48 createObj(GrDebugGL::kTextureUnit_ObjTypes)); | 49 createObj(GrDebugGL::kTextureUnit_ObjTypes)); |
| 49 fTextureUnits[i]->ref(); | 50 fTextureUnits[i]->ref(); |
| 50 | 51 |
| 51 fTextureUnits[i]->setNumber(i); | 52 fTextureUnits[i]->setNumber(i); |
| 52 } | 53 } |
| 53 } | 54 } |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 GrAlwaysAssert(!fProgram->getDeleted()); | 198 GrAlwaysAssert(!fProgram->getDeleted()); |
| 198 fProgram->ref(); | 199 fProgram->ref(); |
| 199 | 200 |
| 200 GrAlwaysAssert(!fProgram->getInUse()); | 201 GrAlwaysAssert(!fProgram->getInUse()); |
| 201 fProgram->setInUse(); | 202 fProgram->setInUse(); |
| 202 } | 203 } |
| 203 } | 204 } |
| 204 | 205 |
| 205 void GrDebugGL::report() const { | 206 void GrDebugGL::report() const { |
| 206 for (int i = 0; i < fObjects.count(); ++i) { | 207 for (int i = 0; i < fObjects.count(); ++i) { |
| 207 GrAlwaysAssert(0 == fObjects[i]->getRefCount()); | |
| 208 GrAlwaysAssert(0 < fObjects[i]->getHighRefCount()); | 208 GrAlwaysAssert(0 < fObjects[i]->getHighRefCount()); |
| 209 GrAlwaysAssert(fObjects[i]->getDeleted()); | 209 if (!fAbandoned) { |
| 210 GrAlwaysAssert(0 == fObjects[i]->getRefCount()); |
| 211 GrAlwaysAssert(fObjects[i]->getDeleted()); |
| 212 } |
| 210 } | 213 } |
| 211 } | 214 } |
| OLD | NEW |