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

Side by Side Diff: src/gpu/gl/GrGpuGL_program.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/GrTexture.cpp ('k') | src/gpu/gl/SkGLContextHelper.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 #include "GrGpuGL.h" 8 #include "GrGpuGL.h"
9 9
10 #include "GrEffect.h" 10 #include "GrEffect.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 SkDebugf("Hash miss %%: %f\n", (cacheHits > 0) ? 100.f * fHashMisses / c acheHits : 0.f); 72 SkDebugf("Hash miss %%: %f\n", (cacheHits > 0) ? 100.f * fHashMisses / c acheHits : 0.f);
73 SkDebugf("---------------------\n"); 73 SkDebugf("---------------------\n");
74 } 74 }
75 #endif 75 #endif
76 } 76 }
77 77
78 void GrGpuGL::ProgramCache::abandon() { 78 void GrGpuGL::ProgramCache::abandon() {
79 for (int i = 0; i < fCount; ++i) { 79 for (int i = 0; i < fCount; ++i) {
80 SkASSERT(NULL != fEntries[i]->fProgram.get()); 80 SkASSERT(NULL != fEntries[i]->fProgram.get());
81 fEntries[i]->fProgram->abandon(); 81 fEntries[i]->fProgram->abandon();
82 fEntries[i]->fProgram.reset(NULL); 82 SkDELETE(fEntries[i]);
83 } 83 }
84 fCount = 0; 84 fCount = 0;
85 } 85 }
86 86
87 int GrGpuGL::ProgramCache::search(const GrGLProgramDesc& desc) const { 87 int GrGpuGL::ProgramCache::search(const GrGLProgramDesc& desc) const {
88 ProgDescLess less; 88 ProgDescLess less;
89 return SkTSearch(fEntries, fCount, desc, sizeof(Entry*), less); 89 return SkTSearch(fEntries, fCount, desc, sizeof(Entry*), less);
90 } 90 }
91 91
92 GrGLProgram* GrGpuGL::ProgramCache::getProgram(const GrGLProgramDesc& desc, 92 GrGLProgram* GrGpuGL::ProgramCache::getProgram(const GrGLProgramDesc& desc,
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 GrGLAttribTypeToLayout(attribType).fType, 368 GrGLAttribTypeToLayout(attribType).fType,
369 GrGLAttribTypeToLayout(attribType).fNormalized, 369 GrGLAttribTypeToLayout(attribType).fNormalized,
370 stride, 370 stride,
371 reinterpret_cast<GrGLvoid*>( 371 reinterpret_cast<GrGLvoid*>(
372 vertexOffsetInBytes + vertexAttrib->fOffset)); 372 vertexOffsetInBytes + vertexAttrib->fOffset));
373 } 373 }
374 } 374 }
375 attribState->disableUnusedArrays(this, usedAttribArraysMask); 375 attribState->disableUnusedArrays(this, usedAttribArraysMask);
376 } 376 }
377 } 377 }
OLDNEW
« no previous file with comments | « src/gpu/GrTexture.cpp ('k') | src/gpu/gl/SkGLContextHelper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698