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 "GrGpuGL.h" | 9 #include "GrGpuGL.h" |
10 #include "GrGLStencilBuffer.h" | 10 #include "GrGLStencilBuffer.h" |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 } | 427 } |
428 | 428 |
429 return texture; | 429 return texture; |
430 } | 430 } |
431 | 431 |
432 GrRenderTarget* GrGLGpu::onWrapBackendRenderTarget(const GrBackendRenderTargetDe
sc& wrapDesc) {QQQ(); | 432 GrRenderTarget* GrGLGpu::onWrapBackendRenderTarget(const GrBackendRenderTargetDe
sc& wrapDesc) {QQQ(); |
433 GrGLRenderTarget::IDDesc idDesc; | 433 GrGLRenderTarget::IDDesc idDesc; |
434 idDesc.fRTFBOID = static_cast<GrGLuint>(wrapDesc.fRenderTargetHandle); | 434 idDesc.fRTFBOID = static_cast<GrGLuint>(wrapDesc.fRenderTargetHandle); |
435 idDesc.fMSColorRenderbufferID = 0; | 435 idDesc.fMSColorRenderbufferID = 0; |
436 idDesc.fTexFBOID = GrGLRenderTarget::kUnresolvableFBOID; | 436 idDesc.fTexFBOID = GrGLRenderTarget::kUnresolvableFBOID; |
| 437 idDesc.fIsWrapped = true; |
437 | 438 |
438 GrSurfaceDesc desc; | 439 GrSurfaceDesc desc; |
439 desc.fConfig = wrapDesc.fConfig; | 440 desc.fConfig = wrapDesc.fConfig; |
440 desc.fFlags = kCheckAllocation_GrSurfaceFlag; | 441 desc.fFlags = kCheckAllocation_GrSurfaceFlag; |
441 desc.fWidth = wrapDesc.fWidth; | 442 desc.fWidth = wrapDesc.fWidth; |
442 desc.fHeight = wrapDesc.fHeight; | 443 desc.fHeight = wrapDesc.fHeight; |
443 desc.fSampleCnt = wrapDesc.fSampleCnt; | 444 desc.fSampleCnt = wrapDesc.fSampleCnt; |
444 desc.fOrigin = resolve_origin(wrapDesc.fOrigin, true); | 445 desc.fOrigin = resolve_origin(wrapDesc.fOrigin, true); |
445 | 446 |
446 GrRenderTarget* tgt = SkNEW_ARGS(GrGLRenderTarget, (this, desc, idDesc)); | 447 GrRenderTarget* tgt = SkNEW_ARGS(GrGLRenderTarget, (this, desc, idDesc)); |
(...skipping 2306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2753 this->setVertexArrayID(gpu, 0); | 2754 this->setVertexArrayID(gpu, 0); |
2754 } | 2755 } |
2755 int attrCount = gpu->glCaps().maxVertexAttributes(); | 2756 int attrCount = gpu->glCaps().maxVertexAttributes(); |
2756 if (fDefaultVertexArrayAttribState.count() != attrCount) { | 2757 if (fDefaultVertexArrayAttribState.count() != attrCount) { |
2757 fDefaultVertexArrayAttribState.resize(attrCount); | 2758 fDefaultVertexArrayAttribState.resize(attrCount); |
2758 } | 2759 } |
2759 attribState = &fDefaultVertexArrayAttribState; | 2760 attribState = &fDefaultVertexArrayAttribState; |
2760 } | 2761 } |
2761 return attribState; | 2762 return attribState; |
2762 } | 2763 } |
OLD | NEW |