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 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 idDesc.fLifeCycle = GrGpuResource::kAdopted_LifeCycle; | 471 idDesc.fLifeCycle = GrGpuResource::kAdopted_LifeCycle; |
472 break; | 472 break; |
473 case kBorrow_GrWrapOwnership: | 473 case kBorrow_GrWrapOwnership: |
474 idDesc.fLifeCycle = GrGpuResource::kBorrowed_LifeCycle; | 474 idDesc.fLifeCycle = GrGpuResource::kBorrowed_LifeCycle; |
475 break; | 475 break; |
476 } | 476 } |
477 idDesc.fSampleConfig = GrRenderTarget::kUnified_SampleConfig; | 477 idDesc.fSampleConfig = GrRenderTarget::kUnified_SampleConfig; |
478 | 478 |
479 GrSurfaceDesc desc; | 479 GrSurfaceDesc desc; |
480 desc.fConfig = wrapDesc.fConfig; | 480 desc.fConfig = wrapDesc.fConfig; |
481 desc.fFlags = kCheckAllocation_GrSurfaceFlag; | 481 desc.fFlags = kCheckAllocation_GrSurfaceFlag | kRenderTarget_GrSurfaceFlag; |
482 desc.fWidth = wrapDesc.fWidth; | 482 desc.fWidth = wrapDesc.fWidth; |
483 desc.fHeight = wrapDesc.fHeight; | 483 desc.fHeight = wrapDesc.fHeight; |
484 desc.fSampleCnt = SkTMin(wrapDesc.fSampleCnt, this->caps()->maxSampleCount()
); | 484 desc.fSampleCnt = SkTMin(wrapDesc.fSampleCnt, this->caps()->maxSampleCount()
); |
485 desc.fOrigin = resolve_origin(wrapDesc.fOrigin, true); | 485 desc.fOrigin = resolve_origin(wrapDesc.fOrigin, true); |
486 | 486 |
487 GrRenderTarget* tgt = SkNEW_ARGS(GrGLRenderTarget, (this, desc, idDesc)); | 487 GrRenderTarget* tgt = SkNEW_ARGS(GrGLRenderTarget, (this, desc, idDesc)); |
488 if (wrapDesc.fStencilBits) { | 488 if (wrapDesc.fStencilBits) { |
489 GrGLStencilAttachment::IDDesc sbDesc; | 489 GrGLStencilAttachment::IDDesc sbDesc; |
490 GrGLStencilAttachment::Format format; | 490 GrGLStencilAttachment::Format format; |
491 format.fInternalFormat = GrGLStencilAttachment::kUnknownInternalFormat; | 491 format.fInternalFormat = GrGLStencilAttachment::kUnknownInternalFormat; |
(...skipping 2704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3196 this->setVertexArrayID(gpu, 0); | 3196 this->setVertexArrayID(gpu, 0); |
3197 } | 3197 } |
3198 int attrCount = gpu->glCaps().maxVertexAttributes(); | 3198 int attrCount = gpu->glCaps().maxVertexAttributes(); |
3199 if (fDefaultVertexArrayAttribState.count() != attrCount) { | 3199 if (fDefaultVertexArrayAttribState.count() != attrCount) { |
3200 fDefaultVertexArrayAttribState.resize(attrCount); | 3200 fDefaultVertexArrayAttribState.resize(attrCount); |
3201 } | 3201 } |
3202 attribState = &fDefaultVertexArrayAttribState; | 3202 attribState = &fDefaultVertexArrayAttribState; |
3203 } | 3203 } |
3204 return attribState; | 3204 return attribState; |
3205 } | 3205 } |
OLD | NEW |