| 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 696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 707 } | 707 } |
| 708 return succeeded; | 708 return succeeded; |
| 709 } | 709 } |
| 710 | 710 |
| 711 static bool renderbuffer_storage_msaa(GrGLContext& ctx, | 711 static bool renderbuffer_storage_msaa(GrGLContext& ctx, |
| 712 int sampleCount, | 712 int sampleCount, |
| 713 GrGLenum format, | 713 GrGLenum format, |
| 714 int width, int height) { | 714 int width, int height) { |
| 715 CLEAR_ERROR_BEFORE_ALLOC(ctx.interface()); | 715 CLEAR_ERROR_BEFORE_ALLOC(ctx.interface()); |
| 716 SkASSERT(GrGLCaps::kNone_MSFBOType != ctx.caps()->msFBOType()); | 716 SkASSERT(GrGLCaps::kNone_MSFBOType != ctx.caps()->msFBOType()); |
| 717 #if GR_GL_IGNORE_ES3_MSAA | |
| 718 GL_ALLOC_CALL(ctx.interface(), | |
| 719 RenderbufferStorageMultisample(GR_GL_RENDERBUFFER, | |
| 720 sampleCount, | |
| 721 format, | |
| 722 width, height)); | |
| 723 #else | |
| 724 switch (ctx.caps()->msFBOType()) { | 717 switch (ctx.caps()->msFBOType()) { |
| 725 case GrGLCaps::kDesktop_ARB_MSFBOType: | 718 case GrGLCaps::kDesktop_ARB_MSFBOType: |
| 726 case GrGLCaps::kDesktop_EXT_MSFBOType: | 719 case GrGLCaps::kDesktop_EXT_MSFBOType: |
| 727 case GrGLCaps::kES_3_0_MSFBOType: | 720 case GrGLCaps::kES_3_0_MSFBOType: |
| 728 GL_ALLOC_CALL(ctx.interface(), | 721 GL_ALLOC_CALL(ctx.interface(), |
| 729 RenderbufferStorageMultisample(GR_GL_RENDERBUFFER, | 722 RenderbufferStorageMultisample(GR_GL_RENDERBUFFER, |
| 730 sampleCount, | 723 sampleCount, |
| 731 format, | 724 format, |
| 732 width, height)); | 725 width, height)); |
| 733 break; | 726 break; |
| 734 case GrGLCaps::kES_Apple_MSFBOType: | 727 case GrGLCaps::kES_Apple_MSFBOType: |
| 735 GL_ALLOC_CALL(ctx.interface(), | 728 GL_ALLOC_CALL(ctx.interface(), |
| 736 RenderbufferStorageMultisampleES2APPLE(GR_GL_RENDERB
UFFER, | 729 RenderbufferStorageMultisampleES2APPLE(GR_GL_RENDERB
UFFER, |
| 737 sampleCount, | 730 sampleCount, |
| 738 format, | 731 format, |
| 739 width, heigh
t)); | 732 width, heigh
t)); |
| 740 break; | 733 break; |
| 741 case GrGLCaps::kES_EXT_MsToTexture_MSFBOType: | 734 case GrGLCaps::kES_EXT_MsToTexture_MSFBOType: |
| 742 case GrGLCaps::kES_IMG_MsToTexture_MSFBOType: | 735 case GrGLCaps::kES_IMG_MsToTexture_MSFBOType: |
| 743 GL_ALLOC_CALL(ctx.interface(), | 736 GL_ALLOC_CALL(ctx.interface(), |
| 744 RenderbufferStorageMultisampleES2EXT(GR_GL_RENDERBUF
FER, | 737 RenderbufferStorageMultisampleES2EXT(GR_GL_RENDERBUF
FER, |
| 745 sampleCount, | 738 sampleCount, |
| 746 format, | 739 format, |
| 747 width, height)); | 740 width, height)); |
| 748 break; | 741 break; |
| 749 case GrGLCaps::kNone_MSFBOType: | 742 case GrGLCaps::kNone_MSFBOType: |
| 750 GrCrash("Shouldn't be here if we don't support multisampled renderbu
ffers."); | 743 GrCrash("Shouldn't be here if we don't support multisampled renderbu
ffers."); |
| 751 break; | 744 break; |
| 752 } | 745 } |
| 753 #endif | |
| 754 return (GR_GL_NO_ERROR == CHECK_ALLOC_ERROR(ctx.interface()));; | 746 return (GR_GL_NO_ERROR == CHECK_ALLOC_ERROR(ctx.interface()));; |
| 755 } | 747 } |
| 756 | 748 |
| 757 bool GrGpuGL::createRenderTargetObjects(int width, int height, | 749 bool GrGpuGL::createRenderTargetObjects(int width, int height, |
| 758 GrGLuint texID, | 750 GrGLuint texID, |
| 759 GrGLRenderTarget::Desc* desc) { | 751 GrGLRenderTarget::Desc* desc) { |
| 760 desc->fMSColorRenderbufferID = 0; | 752 desc->fMSColorRenderbufferID = 0; |
| 761 desc->fRTFBOID = 0; | 753 desc->fRTFBOID = 0; |
| 762 desc->fTexFBOID = 0; | 754 desc->fTexFBOID = 0; |
| 763 desc->fIsWrapped = false; | 755 desc->fIsWrapped = false; |
| (...skipping 1932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2696 this->setVertexArrayID(gpu, 0); | 2688 this->setVertexArrayID(gpu, 0); |
| 2697 } | 2689 } |
| 2698 int attrCount = gpu->glCaps().maxVertexAttributes(); | 2690 int attrCount = gpu->glCaps().maxVertexAttributes(); |
| 2699 if (fDefaultVertexArrayAttribState.count() != attrCount) { | 2691 if (fDefaultVertexArrayAttribState.count() != attrCount) { |
| 2700 fDefaultVertexArrayAttribState.resize(attrCount); | 2692 fDefaultVertexArrayAttribState.resize(attrCount); |
| 2701 } | 2693 } |
| 2702 attribState = &fDefaultVertexArrayAttribState; | 2694 attribState = &fDefaultVertexArrayAttribState; |
| 2703 } | 2695 } |
| 2704 return attribState; | 2696 return attribState; |
| 2705 } | 2697 } |
| OLD | NEW |