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 "GrGLStencilAttachment.h" | 10 #include "GrGLStencilAttachment.h" |
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 idDesc.fMSColorRenderbufferID = 0; | 523 idDesc.fMSColorRenderbufferID = 0; |
524 idDesc.fTexFBOID = GrGLRenderTarget::kUnresolvableFBOID; | 524 idDesc.fTexFBOID = GrGLRenderTarget::kUnresolvableFBOID; |
525 switch (ownership) { | 525 switch (ownership) { |
526 case kAdopt_GrWrapOwnership: | 526 case kAdopt_GrWrapOwnership: |
527 idDesc.fLifeCycle = GrGpuResource::kAdopted_LifeCycle; | 527 idDesc.fLifeCycle = GrGpuResource::kAdopted_LifeCycle; |
528 break; | 528 break; |
529 case kBorrow_GrWrapOwnership: | 529 case kBorrow_GrWrapOwnership: |
530 idDesc.fLifeCycle = GrGpuResource::kBorrowed_LifeCycle; | 530 idDesc.fLifeCycle = GrGpuResource::kBorrowed_LifeCycle; |
531 break; | 531 break; |
532 } | 532 } |
| 533 idDesc.fSampleConfig = GrRenderTarget::kUnified_SampleConfig; |
533 | 534 |
534 GrSurfaceDesc desc; | 535 GrSurfaceDesc desc; |
535 desc.fConfig = wrapDesc.fConfig; | 536 desc.fConfig = wrapDesc.fConfig; |
536 desc.fFlags = kCheckAllocation_GrSurfaceFlag; | 537 desc.fFlags = kCheckAllocation_GrSurfaceFlag; |
537 desc.fWidth = wrapDesc.fWidth; | 538 desc.fWidth = wrapDesc.fWidth; |
538 desc.fHeight = wrapDesc.fHeight; | 539 desc.fHeight = wrapDesc.fHeight; |
539 desc.fSampleCnt = SkTMin(wrapDesc.fSampleCnt, this->caps()->maxSampleCount()
); | 540 desc.fSampleCnt = SkTMin(wrapDesc.fSampleCnt, this->caps()->maxSampleCount()
); |
540 desc.fOrigin = resolve_origin(wrapDesc.fOrigin, true); | 541 desc.fOrigin = resolve_origin(wrapDesc.fOrigin, true); |
541 | 542 |
542 GrRenderTarget* tgt = SkNEW_ARGS(GrGLRenderTarget, (this, desc, idDesc)); | 543 GrRenderTarget* tgt = SkNEW_ARGS(GrGLRenderTarget, (this, desc, idDesc)); |
(...skipping 2553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3096 this->setVertexArrayID(gpu, 0); | 3097 this->setVertexArrayID(gpu, 0); |
3097 } | 3098 } |
3098 int attrCount = gpu->glCaps().maxVertexAttributes(); | 3099 int attrCount = gpu->glCaps().maxVertexAttributes(); |
3099 if (fDefaultVertexArrayAttribState.count() != attrCount) { | 3100 if (fDefaultVertexArrayAttribState.count() != attrCount) { |
3100 fDefaultVertexArrayAttribState.resize(attrCount); | 3101 fDefaultVertexArrayAttribState.resize(attrCount); |
3101 } | 3102 } |
3102 attribState = &fDefaultVertexArrayAttribState; | 3103 attribState = &fDefaultVertexArrayAttribState; |
3103 } | 3104 } |
3104 return attribState; | 3105 return attribState; |
3105 } | 3106 } |
OLD | NEW |