| 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 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 #endif | 447 #endif |
| 448 if (GR_GL_TEXTURE_EXTERNAL == idDesc.fInfo.fTarget) { | 448 if (GR_GL_TEXTURE_EXTERNAL == idDesc.fInfo.fTarget) { |
| 449 if (renderTarget) { | 449 if (renderTarget) { |
| 450 // This combination is not supported. | 450 // This combination is not supported. |
| 451 return nullptr; | 451 return nullptr; |
| 452 } | 452 } |
| 453 if (!this->glCaps().externalTextureSupport()) { | 453 if (!this->glCaps().externalTextureSupport()) { |
| 454 return nullptr; | 454 return nullptr; |
| 455 } | 455 } |
| 456 } | 456 } |
| 457 // Sample count is interpretted to mean the number of samples that Gr code s
hould allocate |
| 458 // for a render buffer that resolves to the texture. We don't support MSAA t
extures. |
| 459 if (desc.fSampleCnt && !renderTarget) { |
| 460 return nullptr; |
| 461 } |
| 457 | 462 |
| 458 switch (ownership) { | 463 switch (ownership) { |
| 459 case kAdopt_GrWrapOwnership: | 464 case kAdopt_GrWrapOwnership: |
| 460 idDesc.fLifeCycle = GrGpuResource::kAdopted_LifeCycle; | 465 idDesc.fLifeCycle = GrGpuResource::kAdopted_LifeCycle; |
| 461 break; | 466 break; |
| 462 case kBorrow_GrWrapOwnership: | 467 case kBorrow_GrWrapOwnership: |
| 463 idDesc.fLifeCycle = GrGpuResource::kBorrowed_LifeCycle; | 468 idDesc.fLifeCycle = GrGpuResource::kBorrowed_LifeCycle; |
| 464 break; | 469 break; |
| 465 } | 470 } |
| 466 | 471 |
| (...skipping 2926 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3393 this->setVertexArrayID(gpu, 0); | 3398 this->setVertexArrayID(gpu, 0); |
| 3394 } | 3399 } |
| 3395 int attrCount = gpu->glCaps().maxVertexAttributes(); | 3400 int attrCount = gpu->glCaps().maxVertexAttributes(); |
| 3396 if (fDefaultVertexArrayAttribState.count() != attrCount) { | 3401 if (fDefaultVertexArrayAttribState.count() != attrCount) { |
| 3397 fDefaultVertexArrayAttribState.resize(attrCount); | 3402 fDefaultVertexArrayAttribState.resize(attrCount); |
| 3398 } | 3403 } |
| 3399 attribState = &fDefaultVertexArrayAttribState; | 3404 attribState = &fDefaultVertexArrayAttribState; |
| 3400 } | 3405 } |
| 3401 return attribState; | 3406 return attribState; |
| 3402 } | 3407 } |
| OLD | NEW |