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

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

Issue 481443002: Add GrResourceCache2. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix leaks 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/GrGpuGL.cpp ('k') | no next file » | 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 #include "GrGpuGL.h" 8 #include "GrGpuGL.h"
9 9
10 #include "GrEffect.h" 10 #include "GrEffect.h"
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 for (int i = 0; i < fCount; ++i) { 192 for (int i = 0; i < fCount; ++i) {
193 fEntries[i]->fLRUStamp = 0; 193 fEntries[i]->fLRUStamp = 0;
194 } 194 }
195 } 195 }
196 ++fCurrLRUStamp; 196 ++fCurrLRUStamp;
197 return entry->fProgram; 197 return entry->fProgram;
198 } 198 }
199 199
200 //////////////////////////////////////////////////////////////////////////////// 200 ////////////////////////////////////////////////////////////////////////////////
201 201
202 void GrGpuGL::abandonResources(){
203 INHERITED::abandonResources();
204 fProgramCache->abandon();
205 fHWProgramID = 0;
206 if (this->glCaps().pathRenderingSupport()) {
207 this->glPathRendering()->abandonGpuResources();
208 }
209 }
210
211 ////////////////////////////////////////////////////////////////////////////////
212
213 #define GL_CALL(X) GR_GL_CALL(this->glInterface(), X) 202 #define GL_CALL(X) GR_GL_CALL(this->glInterface(), X)
214 203
215 bool GrGpuGL::flushGraphicsState(DrawType type, const GrDeviceCoordTexture* dstC opy) { 204 bool GrGpuGL::flushGraphicsState(DrawType type, const GrDeviceCoordTexture* dstC opy) {
216 const GrDrawState& drawState = this->getDrawState(); 205 const GrDrawState& drawState = this->getDrawState();
217 206
218 // GrGpu::setupClipAndFlushState should have already checked this and bailed if not true. 207 // GrGpu::setupClipAndFlushState should have already checked this and bailed if not true.
219 SkASSERT(NULL != drawState.getRenderTarget()); 208 SkASSERT(NULL != drawState.getRenderTarget());
220 209
221 if (kStencilPath_DrawType == type) { 210 if (kStencilPath_DrawType == type) {
222 const GrRenderTarget* rt = this->getDrawState().getRenderTarget(); 211 const GrRenderTarget* rt = this->getDrawState().getRenderTarget();
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 GrGLAttribTypeToLayout(attribType).fType, 359 GrGLAttribTypeToLayout(attribType).fType,
371 GrGLAttribTypeToLayout(attribType).fNormalized, 360 GrGLAttribTypeToLayout(attribType).fNormalized,
372 stride, 361 stride,
373 reinterpret_cast<GrGLvoid*>( 362 reinterpret_cast<GrGLvoid*>(
374 vertexOffsetInBytes + vertexAttrib->fOffset)); 363 vertexOffsetInBytes + vertexAttrib->fOffset));
375 } 364 }
376 } 365 }
377 attribState->disableUnusedArrays(this, usedAttribArraysMask); 366 attribState->disableUnusedArrays(this, usedAttribArraysMask);
378 } 367 }
379 } 368 }
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGpuGL.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698