| 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 | 8 |
| 9 #include "GrGLGpu.h" | 9 #include "GrGLGpu.h" |
| 10 #include "GrGLGLSL.h" | 10 #include "GrGLGLSL.h" |
| (...skipping 3273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3284 #else | 3284 #else |
| 3285 GrGLuint texID = reinterpret_cast<const GrGLTextureInfo*>(id)->fID; | 3285 GrGLuint texID = reinterpret_cast<const GrGLTextureInfo*>(id)->fID; |
| 3286 #endif | 3286 #endif |
| 3287 | 3287 |
| 3288 GrGLboolean result; | 3288 GrGLboolean result; |
| 3289 GL_CALL_RET(result, IsTexture(texID)); | 3289 GL_CALL_RET(result, IsTexture(texID)); |
| 3290 | 3290 |
| 3291 return (GR_GL_TRUE == result); | 3291 return (GR_GL_TRUE == result); |
| 3292 } | 3292 } |
| 3293 | 3293 |
| 3294 void GrGLGpu::deleteTestingOnlyBackendTexture(GrBackendObject id) const { | 3294 void GrGLGpu::deleteTestingOnlyBackendTexture(GrBackendObject id, bool abandonTe
xture) const { |
| 3295 #ifdef SK_IGNORE_GL_TEXTURE_TARGET | 3295 #ifdef SK_IGNORE_GL_TEXTURE_TARGET |
| 3296 GrGLuint texID = (GrGLuint)id; | 3296 GrGLuint texID = (GrGLuint)id; |
| 3297 #else | 3297 #else |
| 3298 const GrGLTextureInfo* info = reinterpret_cast<const GrGLTextureInfo*>(id); | 3298 const GrGLTextureInfo* info = reinterpret_cast<const GrGLTextureInfo*>(id); |
| 3299 GrGLuint texID = info->fID; | 3299 GrGLuint texID = info->fID; |
| 3300 #endif | 3300 #endif |
| 3301 | 3301 |
| 3302 GL_CALL(DeleteTextures(1, &texID)); | 3302 if (!abandonTexture) { |
| 3303 GL_CALL(DeleteTextures(1, &texID)); |
| 3304 } |
| 3303 | 3305 |
| 3304 #ifndef SK_IGNORE_GL_TEXTURE_TARGET | 3306 #ifndef SK_IGNORE_GL_TEXTURE_TARGET |
| 3305 delete info; | 3307 delete info; |
| 3306 #endif | 3308 #endif |
| 3307 } | 3309 } |
| 3308 | 3310 |
| 3309 /////////////////////////////////////////////////////////////////////////////// | 3311 /////////////////////////////////////////////////////////////////////////////// |
| 3310 GrGLAttribArrayState* GrGLGpu::HWGeometryState::bindArrayAndBuffersToDraw( | 3312 GrGLAttribArrayState* GrGLGpu::HWGeometryState::bindArrayAndBuffersToDraw( |
| 3311 GrGLGpu* gpu, | 3313 GrGLGpu* gpu, |
| 3312 const GrGLVertexBuffer* vbuffer, | 3314 const GrGLVertexBuffer* vbuffer, |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3357 this->setVertexArrayID(gpu, 0); | 3359 this->setVertexArrayID(gpu, 0); |
| 3358 } | 3360 } |
| 3359 int attrCount = gpu->glCaps().maxVertexAttributes(); | 3361 int attrCount = gpu->glCaps().maxVertexAttributes(); |
| 3360 if (fDefaultVertexArrayAttribState.count() != attrCount) { | 3362 if (fDefaultVertexArrayAttribState.count() != attrCount) { |
| 3361 fDefaultVertexArrayAttribState.resize(attrCount); | 3363 fDefaultVertexArrayAttribState.resize(attrCount); |
| 3362 } | 3364 } |
| 3363 attribState = &fDefaultVertexArrayAttribState; | 3365 attribState = &fDefaultVertexArrayAttribState; |
| 3364 } | 3366 } |
| 3365 return attribState; | 3367 return attribState; |
| 3366 } | 3368 } |
| OLD | NEW |