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

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

Issue 707953004: cleaning up geometry handling in gpu (Closed) Base URL: https://skia.googlesource.com/skia.git@solo_gpu
Patch Set: rebase try 2 Created 6 years, 1 month 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/GrInOrderDrawBuffer.cpp ('k') | src/gpu/gl/GrGpuGL_program.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 * 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 "GrGpuGL.h" 9 #include "GrGpuGL.h"
10 #include "GrGLStencilBuffer.h" 10 #include "GrGLStencilBuffer.h"
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 157
158 GrGpuGL::~GrGpuGL() { 158 GrGpuGL::~GrGpuGL() {
159 if (0 != fHWProgramID) { 159 if (0 != fHWProgramID) {
160 // detach the current program so there is no confusion on OpenGL's part 160 // detach the current program so there is no confusion on OpenGL's part
161 // that we want it to be deleted 161 // that we want it to be deleted
162 SkASSERT(fHWProgramID == fCurrentProgram->programID()); 162 SkASSERT(fHWProgramID == fCurrentProgram->programID());
163 GL_CALL(UseProgram(0)); 163 GL_CALL(UseProgram(0));
164 } 164 }
165 165
166 delete fProgramCache; 166 delete fProgramCache;
167
168 // This must be called by before the GrDrawTarget destructor
169 this->releaseGeometry();
170 } 167 }
171 168
172 void GrGpuGL::contextAbandoned() { 169 void GrGpuGL::contextAbandoned() {
173 INHERITED::contextAbandoned(); 170 INHERITED::contextAbandoned();
174 fProgramCache->abandon(); 171 fProgramCache->abandon();
175 fHWProgramID = 0; 172 fHWProgramID = 0;
176 if (this->glCaps().pathRenderingSupport()) { 173 if (this->glCaps().pathRenderingSupport()) {
177 this->glPathRendering()->abandonGpuResources(); 174 this->glPathRendering()->abandonGpuResources();
178 } 175 }
179 } 176 }
(...skipping 2377 matching lines...) Expand 10 before | Expand all | Expand 10 after
2557 this->setVertexArrayID(gpu, 0); 2554 this->setVertexArrayID(gpu, 0);
2558 } 2555 }
2559 int attrCount = gpu->glCaps().maxVertexAttributes(); 2556 int attrCount = gpu->glCaps().maxVertexAttributes();
2560 if (fDefaultVertexArrayAttribState.count() != attrCount) { 2557 if (fDefaultVertexArrayAttribState.count() != attrCount) {
2561 fDefaultVertexArrayAttribState.resize(attrCount); 2558 fDefaultVertexArrayAttribState.resize(attrCount);
2562 } 2559 }
2563 attribState = &fDefaultVertexArrayAttribState; 2560 attribState = &fDefaultVertexArrayAttribState;
2564 } 2561 }
2565 return attribState; 2562 return attribState;
2566 } 2563 }
OLDNEW
« no previous file with comments | « src/gpu/GrInOrderDrawBuffer.cpp ('k') | src/gpu/gl/GrGpuGL_program.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698