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 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
470 return texture; | 470 return texture; |
471 } | 471 } |
472 | 472 |
473 GrRenderTarget* GrGpuGL::onWrapBackendRenderTarget(const GrBackendRenderTargetDe sc& desc) { | 473 GrRenderTarget* GrGpuGL::onWrapBackendRenderTarget(const GrBackendRenderTargetDe sc& desc) { |
474 GrGLRenderTarget::Desc glDesc; | 474 GrGLRenderTarget::Desc glDesc; |
475 glDesc.fConfig = desc.fConfig; | 475 glDesc.fConfig = desc.fConfig; |
476 glDesc.fRTFBOID = static_cast<GrGLuint>(desc.fRenderTargetHandle); | 476 glDesc.fRTFBOID = static_cast<GrGLuint>(desc.fRenderTargetHandle); |
477 glDesc.fMSColorRenderbufferID = 0; | 477 glDesc.fMSColorRenderbufferID = 0; |
478 glDesc.fTexFBOID = GrGLRenderTarget::kUnresolvableFBOID; | 478 glDesc.fTexFBOID = GrGLRenderTarget::kUnresolvableFBOID; |
479 glDesc.fSampleCnt = desc.fSampleCnt; | 479 glDesc.fSampleCnt = desc.fSampleCnt; |
480 glDesc.fIsWrapped = true; | 480 glDesc.fIsWrapped = true; |
robertphillips
2013/05/14 19:22:15
I don't think we should delete the copy of 'fOrigi
bsalomon
2013/05/14 19:34:56
take a look at the next line:
glDesc.fOrigin = res
| |
481 glDesc.fOrigin = desc.fOrigin; | |
482 if (glDesc.fRTFBOID == 0) { | |
483 GrAssert(desc.fOrigin == kBottomLeft_GrSurfaceOrigin); | |
484 } | |
485 | 481 |
486 glDesc.fOrigin = resolve_origin(desc.fOrigin, true); | 482 glDesc.fOrigin = resolve_origin(desc.fOrigin, true); |
487 GrGLIRect viewport; | 483 GrGLIRect viewport; |
488 viewport.fLeft = 0; | 484 viewport.fLeft = 0; |
489 viewport.fBottom = 0; | 485 viewport.fBottom = 0; |
490 viewport.fWidth = desc.fWidth; | 486 viewport.fWidth = desc.fWidth; |
491 viewport.fHeight = desc.fHeight; | 487 viewport.fHeight = desc.fHeight; |
492 | 488 |
493 GrRenderTarget* tgt = SkNEW_ARGS(GrGLRenderTarget, | 489 GrRenderTarget* tgt = SkNEW_ARGS(GrGLRenderTarget, |
494 (this, glDesc, viewport)); | 490 (this, glDesc, viewport)); |
(...skipping 2012 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2507 this->setVertexArrayID(gpu, 0); | 2503 this->setVertexArrayID(gpu, 0); |
2508 } | 2504 } |
2509 int attrCount = gpu->glCaps().maxVertexAttributes(); | 2505 int attrCount = gpu->glCaps().maxVertexAttributes(); |
2510 if (fDefaultVertexArrayAttribState.count() != attrCount) { | 2506 if (fDefaultVertexArrayAttribState.count() != attrCount) { |
2511 fDefaultVertexArrayAttribState.resize(attrCount); | 2507 fDefaultVertexArrayAttribState.resize(attrCount); |
2512 } | 2508 } |
2513 attribState = &fDefaultVertexArrayAttribState; | 2509 attribState = &fDefaultVertexArrayAttribState; |
2514 } | 2510 } |
2515 return attribState; | 2511 return attribState; |
2516 } | 2512 } |
OLD | NEW |