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

Side by Side Diff: src/gpu/gl/debug/GrDebugGL.cpp

Issue 422323002: Some fixes around GrContext::abandonContext: (Closed) Base URL: https://skia.googlesource.com/skia.git@abandon
Patch Set: Address comments Created 6 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 unified diff | Download patch
« no previous file with comments | « src/gpu/gl/debug/GrDebugGL.h ('k') | src/gpu/gl/debug/GrGLCreateDebugInterface.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « src/gpu/gl/debug/GrDebugGL.h ('k') | src/gpu/gl/debug/GrGLCreateDebugInterface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698