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

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

Issue 2215433003: Revert of SkRTConf: reduce functionality to what we use, increase simplicity (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 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
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 "GrGLPathRendering.h" 12 #include "GrGLPathRendering.h"
13 #include "glsl/GrGLSLFragmentProcessor.h" 13 #include "glsl/GrGLSLFragmentProcessor.h"
14 #include "glsl/GrGLSLProgramDataManager.h" 14 #include "glsl/GrGLSLProgramDataManager.h"
15 #include "glsl/GrGLSLProgramDesc.h" 15 #include "glsl/GrGLSLProgramDesc.h"
16 #include "SkRTConf.h"
16 #include "SkTSearch.h" 17 #include "SkTSearch.h"
17 18
18 #ifdef PROGRAM_CACHE_STATS 19 #ifdef PROGRAM_CACHE_STATS
19 // Display program cache usage 20 SK_CONF_DECLARE(bool, c_DisplayCache, "gpu.displayCache", false,
20 static const bool c_DisplayCache{false}; 21 "Display program cache usage.");
21 #endif 22 #endif
22 23
23 typedef GrGLSLProgramDataManager::UniformHandle UniformHandle; 24 typedef GrGLSLProgramDataManager::UniformHandle UniformHandle;
24 25
25 struct GrGLGpu::ProgramCache::Entry { 26 struct GrGLGpu::ProgramCache::Entry {
26 27
27 Entry() : fProgram(nullptr), fLRUStamp(0) {} 28 Entry() : fProgram(nullptr), fLRUStamp(0) {}
28 29
29 SkAutoTUnref<GrGLProgram> fProgram; 30 SkAutoTUnref<GrGLProgram> fProgram;
30 unsigned int fLRUStamp; 31 unsigned int fLRUStamp;
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 212
212 if (SK_MaxU32 == fCurrLRUStamp) { 213 if (SK_MaxU32 == fCurrLRUStamp) {
213 // wrap around! just trash our LRU, one time hit. 214 // wrap around! just trash our LRU, one time hit.
214 for (int i = 0; i < fCount; ++i) { 215 for (int i = 0; i < fCount; ++i) {
215 fEntries[i]->fLRUStamp = 0; 216 fEntries[i]->fLRUStamp = 0;
216 } 217 }
217 } 218 }
218 ++fCurrLRUStamp; 219 ++fCurrLRUStamp;
219 return SkRef(entry->fProgram.get()); 220 return SkRef(entry->fProgram.get());
220 } 221 }
OLDNEW
« no previous file with comments | « src/gpu/batches/GrAADistanceFieldPathRenderer.cpp ('k') | src/gpu/gl/builders/GrGLProgramBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698