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 #ifndef GrGpuGL_DEFINED | 8 #ifndef GrGpuGL_DEFINED |
9 #define GrGpuGL_DEFINED | 9 #define GrGpuGL_DEFINED |
10 | 10 |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 | 192 |
193 void abandon(); | 193 void abandon(); |
194 GrGLProgram* getProgram(const GrGLProgramDesc& desc, | 194 GrGLProgram* getProgram(const GrGLProgramDesc& desc, |
195 const GrEffectStage* colorStages[], | 195 const GrEffectStage* colorStages[], |
196 const GrEffectStage* coverageStages[]); | 196 const GrEffectStage* coverageStages[]); |
197 | 197 |
198 private: | 198 private: |
199 enum { | 199 enum { |
200 // We may actually have kMaxEntries+1 shaders in the GL context beca
use we create a new | 200 // We may actually have kMaxEntries+1 shaders in the GL context beca
use we create a new |
201 // shader before evicting from the cache. | 201 // shader before evicting from the cache. |
202 kMaxEntries = 32, | 202 kMaxEntries = 128, |
203 kHashBits = 6, | 203 kHashBits = 6, |
204 }; | 204 }; |
205 | 205 |
206 struct Entry; | 206 struct Entry; |
207 | 207 |
208 struct ProgDescLess; | 208 struct ProgDescLess; |
209 | 209 |
210 // binary search for entry matching desc. returns index into fEntries th
at matches desc or ~ | 210 // binary search for entry matching desc. returns index into fEntries th
at matches desc or ~ |
211 // of the index of where it should be inserted. | 211 // of the index of where it should be inserted. |
212 int search(const GrGLProgramDesc& desc) const; | 212 int search(const GrGLProgramDesc& desc) const; |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 ///@} | 454 ///@} |
455 | 455 |
456 // we record what stencil format worked last time to hopefully exit early | 456 // we record what stencil format worked last time to hopefully exit early |
457 // from our loop that tries stencil formats and calls check fb status. | 457 // from our loop that tries stencil formats and calls check fb status. |
458 int fLastSuccessfulStencilFmtIdx; | 458 int fLastSuccessfulStencilFmtIdx; |
459 | 459 |
460 typedef GrGpu INHERITED; | 460 typedef GrGpu INHERITED; |
461 }; | 461 }; |
462 | 462 |
463 #endif | 463 #endif |
OLD | NEW |