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 "GrGLNameAllocator.h" | 13 #include "GrGLPathRendering.h" |
14 #include "SkTSearch.h" | 14 #include "SkTSearch.h" |
15 | 15 |
16 #ifdef PROGRAM_CACHE_STATS | 16 #ifdef PROGRAM_CACHE_STATS |
17 SK_CONF_DECLARE(bool, c_DisplayCache, "gpu.displayCache", false, | 17 SK_CONF_DECLARE(bool, c_DisplayCache, "gpu.displayCache", false, |
18 "Display program cache usage."); | 18 "Display program cache usage."); |
19 #endif | 19 #endif |
20 | 20 |
21 typedef GrGLProgramDataManager::UniformHandle UniformHandle; | 21 typedef GrGLProgramDataManager::UniformHandle UniformHandle; |
22 | 22 |
23 struct GrGpuGL::ProgramCache::Entry { | 23 struct GrGpuGL::ProgramCache::Entry { |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 ++fCurrLRUStamp; | 196 ++fCurrLRUStamp; |
197 return entry->fProgram; | 197 return entry->fProgram; |
198 } | 198 } |
199 | 199 |
200 //////////////////////////////////////////////////////////////////////////////// | 200 //////////////////////////////////////////////////////////////////////////////// |
201 | 201 |
202 void GrGpuGL::abandonResources(){ | 202 void GrGpuGL::abandonResources(){ |
203 INHERITED::abandonResources(); | 203 INHERITED::abandonResources(); |
204 fProgramCache->abandon(); | 204 fProgramCache->abandon(); |
205 fHWProgramID = 0; | 205 fHWProgramID = 0; |
206 fPathNameAllocator.reset(NULL); | 206 fPathRendering->abandonGpuResources(); |
207 } | 207 } |
208 | 208 |
209 //////////////////////////////////////////////////////////////////////////////// | 209 //////////////////////////////////////////////////////////////////////////////// |
210 | 210 |
211 #define GL_CALL(X) GR_GL_CALL(this->glInterface(), X) | 211 #define GL_CALL(X) GR_GL_CALL(this->glInterface(), X) |
212 | 212 |
213 bool GrGpuGL::flushGraphicsState(DrawType type, const GrDeviceCoordTexture* dstC
opy) { | 213 bool GrGpuGL::flushGraphicsState(DrawType type, const GrDeviceCoordTexture* dstC
opy) { |
214 const GrDrawState& drawState = this->getDrawState(); | 214 const GrDrawState& drawState = this->getDrawState(); |
215 | 215 |
216 // GrGpu::setupClipAndFlushState should have already checked this and bailed
if not true. | 216 // GrGpu::setupClipAndFlushState should have already checked this and bailed
if not true. |
(...skipping 151 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 |