| 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 this->glPathRendering()->abandonGpuResources(); | |
| 208 } | |
| 209 } | |
| 210 | |
| 211 //////////////////////////////////////////////////////////////////////////////// | |
| 212 | |
| 213 #define GL_CALL(X) GR_GL_CALL(this->glInterface(), X) | 202 #define GL_CALL(X) GR_GL_CALL(this->glInterface(), X) |
| 214 | 203 |
| 215 bool GrGpuGL::flushGraphicsState(DrawType type, const GrDeviceCoordTexture* dstC
opy) { | 204 bool GrGpuGL::flushGraphicsState(DrawType type, const GrDeviceCoordTexture* dstC
opy) { |
| 216 const GrDrawState& drawState = this->getDrawState(); | 205 const GrDrawState& drawState = this->getDrawState(); |
| 217 | 206 |
| 218 // GrGpu::setupClipAndFlushState should have already checked this and bailed
if not true. | 207 // GrGpu::setupClipAndFlushState should have already checked this and bailed
if not true. |
| 219 SkASSERT(NULL != drawState.getRenderTarget()); | 208 SkASSERT(NULL != drawState.getRenderTarget()); |
| 220 | 209 |
| 221 if (kStencilPath_DrawType == type) { | 210 if (kStencilPath_DrawType == type) { |
| 222 const GrRenderTarget* rt = this->getDrawState().getRenderTarget(); | 211 const GrRenderTarget* rt = this->getDrawState().getRenderTarget(); |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 GrGLAttribTypeToLayout(attribType).fType, | 359 GrGLAttribTypeToLayout(attribType).fType, |
| 371 GrGLAttribTypeToLayout(attribType).fNormalized, | 360 GrGLAttribTypeToLayout(attribType).fNormalized, |
| 372 stride, | 361 stride, |
| 373 reinterpret_cast<GrGLvoid*>( | 362 reinterpret_cast<GrGLvoid*>( |
| 374 vertexOffsetInBytes + vertexAttrib->fOffset)); | 363 vertexOffsetInBytes + vertexAttrib->fOffset)); |
| 375 } | 364 } |
| 376 } | 365 } |
| 377 attribState->disableUnusedArrays(this, usedAttribArraysMask); | 366 attribState->disableUnusedArrays(this, usedAttribArraysMask); |
| 378 } | 367 } |
| 379 } | 368 } |
| OLD | NEW |