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" |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 for (int i = 0; i < fCount; ++i) { | 192 for (int i = 0; i < fCount; ++i) { |
193 fEntries[i]->fLRUStamp = 0; | 193 fEntries[i]->fLRUStamp = 0; |
194 } | 194 } |
195 } | 195 } |
196 ++fCurrLRUStamp; | 196 ++fCurrLRUStamp; |
197 return entry->fProgram; | 197 return entry->fProgram; |
198 } | 198 } |
199 | 199 |
200 //////////////////////////////////////////////////////////////////////////////// | 200 //////////////////////////////////////////////////////////////////////////////// |
201 | 201 |
| 202 void GrGpuGL::abandonResources(){ |
| 203 INHERITED::abandonResources(); |
| 204 fProgramCache->abandon(); |
| 205 fHWProgramID = 0; |
| 206 if (this->glCaps().pathRenderingSupport()) { |
| 207 fPathRendering->abandonGpuResources(); |
| 208 } |
| 209 } |
| 210 |
| 211 //////////////////////////////////////////////////////////////////////////////// |
| 212 |
202 #define GL_CALL(X) GR_GL_CALL(this->glInterface(), X) | 213 #define GL_CALL(X) GR_GL_CALL(this->glInterface(), X) |
203 | 214 |
204 bool GrGpuGL::flushGraphicsState(DrawType type, const GrDeviceCoordTexture* dstC
opy) { | 215 bool GrGpuGL::flushGraphicsState(DrawType type, const GrDeviceCoordTexture* dstC
opy) { |
205 const GrDrawState& drawState = this->getDrawState(); | 216 const GrDrawState& drawState = this->getDrawState(); |
206 | 217 |
207 // GrGpu::setupClipAndFlushState should have already checked this and bailed
if not true. | 218 // GrGpu::setupClipAndFlushState should have already checked this and bailed
if not true. |
208 SkASSERT(NULL != drawState.getRenderTarget()); | 219 SkASSERT(NULL != drawState.getRenderTarget()); |
209 | 220 |
210 if (kStencilPath_DrawType == type) { | 221 if (kStencilPath_DrawType == type) { |
211 const GrRenderTarget* rt = this->getDrawState().getRenderTarget(); | 222 const GrRenderTarget* rt = this->getDrawState().getRenderTarget(); |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 GrGLAttribTypeToLayout(attribType).fType, | 370 GrGLAttribTypeToLayout(attribType).fType, |
360 GrGLAttribTypeToLayout(attribType).fNormalized, | 371 GrGLAttribTypeToLayout(attribType).fNormalized, |
361 stride, | 372 stride, |
362 reinterpret_cast<GrGLvoid*>( | 373 reinterpret_cast<GrGLvoid*>( |
363 vertexOffsetInBytes + vertexAttrib->fOffset)); | 374 vertexOffsetInBytes + vertexAttrib->fOffset)); |
364 } | 375 } |
365 } | 376 } |
366 attribState->disableUnusedArrays(this, usedAttribArraysMask); | 377 attribState->disableUnusedArrays(this, usedAttribArraysMask); |
367 } | 378 } |
368 } | 379 } |
OLD | NEW |