| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |