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

Side by Side Diff: src/gpu/gl/GrGLGpu.cpp

Issue 1150243003: Simplify path allocation, clean up resources correctly (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 11 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 | « gyp/gpu.gypi ('k') | src/gpu/gl/GrGLNameAllocator.h » ('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 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 8
9 #include "GrGLGpu.h" 9 #include "GrGLGpu.h"
10 #include "GrGLGLSL.h" 10 #include "GrGLGLSL.h"
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 220
221 if (this->glCaps().shaderCaps()->pathRenderingSupport()) { 221 if (this->glCaps().shaderCaps()->pathRenderingSupport()) {
222 fPathRendering.reset(new GrGLPathRendering(this)); 222 fPathRendering.reset(new GrGLPathRendering(this));
223 } 223 }
224 this->createCopyPrograms(); 224 this->createCopyPrograms();
225 fWireRectProgram.fProgram = 0; 225 fWireRectProgram.fProgram = 0;
226 fWireRectArrayBuffer = 0; 226 fWireRectArrayBuffer = 0;
227 } 227 }
228 228
229 GrGLGpu::~GrGLGpu() { 229 GrGLGpu::~GrGLGpu() {
230 // Delete the path rendering explicitly, since it will need working gpu obje ct to release the
231 // resources the object itself holds.
232 fPathRendering.reset();
233
230 if (0 != fHWProgramID) { 234 if (0 != fHWProgramID) {
231 // detach the current program so there is no confusion on OpenGL's part 235 // detach the current program so there is no confusion on OpenGL's part
232 // that we want it to be deleted 236 // that we want it to be deleted
233 GL_CALL(UseProgram(0)); 237 GL_CALL(UseProgram(0));
234 } 238 }
235 239
236 if (0 != fTempSrcFBOID) { 240 if (0 != fTempSrcFBOID) {
237 GL_CALL(DeleteFramebuffers(1, &fTempSrcFBOID)); 241 GL_CALL(DeleteFramebuffers(1, &fTempSrcFBOID));
238 } 242 }
239 if (0 != fTempDstFBOID) { 243 if (0 != fTempDstFBOID) {
(...skipping 3247 matching lines...) Expand 10 before | Expand all | Expand 10 after
3487 this->setVertexArrayID(gpu, 0); 3491 this->setVertexArrayID(gpu, 0);
3488 } 3492 }
3489 int attrCount = gpu->glCaps().maxVertexAttributes(); 3493 int attrCount = gpu->glCaps().maxVertexAttributes();
3490 if (fDefaultVertexArrayAttribState.count() != attrCount) { 3494 if (fDefaultVertexArrayAttribState.count() != attrCount) {
3491 fDefaultVertexArrayAttribState.resize(attrCount); 3495 fDefaultVertexArrayAttribState.resize(attrCount);
3492 } 3496 }
3493 attribState = &fDefaultVertexArrayAttribState; 3497 attribState = &fDefaultVertexArrayAttribState;
3494 } 3498 }
3495 return attribState; 3499 return attribState;
3496 } 3500 }
OLDNEW
« no previous file with comments | « gyp/gpu.gypi ('k') | src/gpu/gl/GrGLNameAllocator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698