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

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

Issue 1217573002: remove SkInstCnt (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Created 5 years, 5 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/GrGLCreateNullInterface.cpp ('k') | src/gpu/gl/GrGLProgram.h » ('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 "GrGLGpu.h" 8 #include "GrGLGpu.h"
9 9
10 #include "builders/GrGLProgramBuilder.h" 10 #include "builders/GrGLProgramBuilder.h"
11 #include "GrProcessor.h" 11 #include "GrProcessor.h"
12 #include "GrGLProcessor.h" 12 #include "GrGLProcessor.h"
13 #include "GrGLPathRendering.h" 13 #include "GrGLPathRendering.h"
14 #include "SkRTConf.h" 14 #include "SkRTConf.h"
15 #include "SkTSearch.h" 15 #include "SkTSearch.h"
16 16
17 #ifdef PROGRAM_CACHE_STATS 17 #ifdef PROGRAM_CACHE_STATS
18 SK_CONF_DECLARE(bool, c_DisplayCache, "gpu.displayCache", false, 18 SK_CONF_DECLARE(bool, c_DisplayCache, "gpu.displayCache", false,
19 "Display program cache usage."); 19 "Display program cache usage.");
20 #endif 20 #endif
21 21
22 typedef GrGLProgramDataManager::UniformHandle UniformHandle; 22 typedef GrGLProgramDataManager::UniformHandle UniformHandle;
23 23
24 struct GrGLGpu::ProgramCache::Entry { 24 struct GrGLGpu::ProgramCache::Entry {
25 SK_DECLARE_INST_COUNT(Entry); 25
26 Entry() : fProgram(NULL), fLRUStamp(0) {} 26 Entry() : fProgram(NULL), fLRUStamp(0) {}
27 27
28 SkAutoTUnref<GrGLProgram> fProgram; 28 SkAutoTUnref<GrGLProgram> fProgram;
29 unsigned int fLRUStamp; 29 unsigned int fLRUStamp;
30 }; 30 };
31 31
32 struct GrGLGpu::ProgramCache::ProgDescLess { 32 struct GrGLGpu::ProgramCache::ProgDescLess {
33 bool operator() (const GrProgramDesc& desc, const Entry* entry) { 33 bool operator() (const GrProgramDesc& desc, const Entry* entry) {
34 SkASSERT(entry->fProgram.get()); 34 SkASSERT(entry->fProgram.get());
35 return GrProgramDesc::Less(desc, entry->fProgram->getDesc()); 35 return GrProgramDesc::Less(desc, entry->fProgram->getDesc());
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 188
189 if (SK_MaxU32 == fCurrLRUStamp) { 189 if (SK_MaxU32 == fCurrLRUStamp) {
190 // wrap around! just trash our LRU, one time hit. 190 // wrap around! just trash our LRU, one time hit.
191 for (int i = 0; i < fCount; ++i) { 191 for (int i = 0; i < fCount; ++i) {
192 fEntries[i]->fLRUStamp = 0; 192 fEntries[i]->fLRUStamp = 0;
193 } 193 }
194 } 194 }
195 ++fCurrLRUStamp; 195 ++fCurrLRUStamp;
196 return SkRef(entry->fProgram.get()); 196 return SkRef(entry->fProgram.get());
197 } 197 }
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLCreateNullInterface.cpp ('k') | src/gpu/gl/GrGLProgram.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698