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" |
11 #include "GrGLEffect.h" | 11 #include "GrGLEffect.h" |
12 #include "SkRTConf.h" | 12 #include "SkRTConf.h" |
13 #include "SkTSearch.h" | 13 #include "SkTSearch.h" |
14 | 14 |
15 #ifdef PROGRAM_CACHE_STATS | 15 #ifdef PROGRAM_CACHE_STATS |
16 SK_CONF_DECLARE(bool, c_DisplayCache, "gpu.displayCache", false, | 16 SK_CONF_DECLARE(bool, c_DisplayCache, "gpu.displayCache", false, |
17 "Display program cache usage."); | 17 "Display program cache usage."); |
18 #endif | 18 #endif |
19 | 19 |
20 typedef GrGLUniformManager::UniformHandle UniformHandle; | 20 typedef GrGLUniformManager::UniformHandle UniformHandle; |
21 | 21 |
22 struct GrGpuGL::ProgramCache::Entry { | 22 struct GrGpuGL::ProgramCache::Entry { |
23 SK_DECLARE_INST_COUNT_ROOT(Entry); | 23 SK_DECLARE_INST_COUNT_ROOT(Entry); |
24 Entry() : fProgram(NULL), fLRUStamp(0) {} | 24 Entry() : fProgram(NULL), fLRUStamp(0) {} |
25 | 25 |
26 SkAutoTUnref<GrGLProgram> fProgram; | 26 SkAutoTUnref<GrGLProgram> fProgram; |
27 unsigned int fLRUStamp; | 27 unsigned int fLRUStamp; |
28 }; | 28 }; |
29 | 29 |
30 SK_DEFINE_INST_COUNT(GrGpuGL::ProgramCache::Entry); | |
31 | |
32 struct GrGpuGL::ProgramCache::ProgDescLess { | 30 struct GrGpuGL::ProgramCache::ProgDescLess { |
33 bool operator() (const GrGLProgramDesc& desc, const Entry* entry) { | 31 bool operator() (const GrGLProgramDesc& desc, const Entry* entry) { |
34 SkASSERT(NULL != entry->fProgram.get()); | 32 SkASSERT(NULL != entry->fProgram.get()); |
35 return GrGLProgramDesc::Less(desc, entry->fProgram->getDesc()); | 33 return GrGLProgramDesc::Less(desc, entry->fProgram->getDesc()); |
36 } | 34 } |
37 | 35 |
38 bool operator() (const Entry* entry, const GrGLProgramDesc& desc) { | 36 bool operator() (const Entry* entry, const GrGLProgramDesc& desc) { |
39 SkASSERT(NULL != entry->fProgram.get()); | 37 SkASSERT(NULL != entry->fProgram.get()); |
40 return GrGLProgramDesc::Less(entry->fProgram->getDesc(), desc); | 38 return GrGLProgramDesc::Less(entry->fProgram->getDesc(), desc); |
41 } | 39 } |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 GrGLAttribTypeToLayout(attribType).fType, | 372 GrGLAttribTypeToLayout(attribType).fType, |
375 GrGLAttribTypeToLayout(attribType).fNormalized, | 373 GrGLAttribTypeToLayout(attribType).fNormalized, |
376 stride, | 374 stride, |
377 reinterpret_cast<GrGLvoid*>( | 375 reinterpret_cast<GrGLvoid*>( |
378 vertexOffsetInBytes + vertexAttrib->fOffset)); | 376 vertexOffsetInBytes + vertexAttrib->fOffset)); |
379 } | 377 } |
380 | 378 |
381 attribState->disableUnusedArrays(this, usedAttribArraysMask, false); | 379 attribState->disableUnusedArrays(this, usedAttribArraysMask, false); |
382 } | 380 } |
383 } | 381 } |
OLD | NEW |