| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 "GrGLCaps.h" | 9 #include "GrGLCaps.h" |
| 10 | 10 |
| (...skipping 763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 774 void GrGLCaps::initFSAASupport(const GrGLContextInfo& ctxInfo, const GrGLInterfa
ce* gli) { | 774 void GrGLCaps::initFSAASupport(const GrGLContextInfo& ctxInfo, const GrGLInterfa
ce* gli) { |
| 775 | 775 |
| 776 fMSFBOType = kNone_MSFBOType; | 776 fMSFBOType = kNone_MSFBOType; |
| 777 if (kGL_GrGLStandard != ctxInfo.standard()) { | 777 if (kGL_GrGLStandard != ctxInfo.standard()) { |
| 778 // We prefer the EXT/IMG extension over ES3 MSAA because we've observed | 778 // We prefer the EXT/IMG extension over ES3 MSAA because we've observed |
| 779 // ES3 driver bugs on at least one device with a tiled GPU (N10). | 779 // ES3 driver bugs on at least one device with a tiled GPU (N10). |
| 780 if (ctxInfo.hasExtension("GL_EXT_multisampled_render_to_texture")) { | 780 if (ctxInfo.hasExtension("GL_EXT_multisampled_render_to_texture")) { |
| 781 fMSFBOType = kES_EXT_MsToTexture_MSFBOType; | 781 fMSFBOType = kES_EXT_MsToTexture_MSFBOType; |
| 782 } else if (ctxInfo.hasExtension("GL_IMG_multisampled_render_to_texture")
) { | 782 } else if (ctxInfo.hasExtension("GL_IMG_multisampled_render_to_texture")
) { |
| 783 fMSFBOType = kES_IMG_MsToTexture_MSFBOType; | 783 fMSFBOType = kES_IMG_MsToTexture_MSFBOType; |
| 784 } else if (ctxInfo.hasExtension("GL_NV_framebuffer_mixed_samples")) { |
| 785 fMSFBOType = kStencil_MSFBOType; |
| 784 } else if (ctxInfo.version() >= GR_GL_VER(3,0)) { | 786 } else if (ctxInfo.version() >= GR_GL_VER(3,0)) { |
| 785 fMSFBOType = GrGLCaps::kES_3_0_MSFBOType; | 787 fMSFBOType = GrGLCaps::kES_3_0_MSFBOType; |
| 786 } else if (ctxInfo.hasExtension("GL_CHROMIUM_framebuffer_multisample"))
{ | 788 } else if (ctxInfo.hasExtension("GL_CHROMIUM_framebuffer_multisample"))
{ |
| 787 // chrome's extension is equivalent to the EXT msaa | 789 // chrome's extension is equivalent to the EXT msaa |
| 788 // and fbo_blit extensions. | 790 // and fbo_blit extensions. |
| 789 fMSFBOType = kDesktop_EXT_MSFBOType; | 791 fMSFBOType = kDesktop_EXT_MSFBOType; |
| 790 } else if (ctxInfo.hasExtension("GL_APPLE_framebuffer_multisample")) { | 792 } else if (ctxInfo.hasExtension("GL_APPLE_framebuffer_multisample")) { |
| 791 fMSFBOType = kES_Apple_MSFBOType; | 793 fMSFBOType = kES_Apple_MSFBOType; |
| 792 } | 794 } |
| 793 } else { | 795 } else { |
| 794 if ((ctxInfo.version() >= GR_GL_VER(3,0)) || | 796 if (ctxInfo.hasExtension("GL_NV_framebuffer_mixed_samples")) { |
| 797 fMSFBOType = kStencil_MSFBOType; |
| 798 } else if ((ctxInfo.version() >= GR_GL_VER(3,0)) || |
| 795 ctxInfo.hasExtension("GL_ARB_framebuffer_object")) { | 799 ctxInfo.hasExtension("GL_ARB_framebuffer_object")) { |
| 796 fMSFBOType = GrGLCaps::kDesktop_ARB_MSFBOType; | 800 fMSFBOType = GrGLCaps::kDesktop_ARB_MSFBOType; |
| 797 } else if (ctxInfo.hasExtension("GL_EXT_framebuffer_multisample") && | 801 } else if (ctxInfo.hasExtension("GL_EXT_framebuffer_multisample") && |
| 798 ctxInfo.hasExtension("GL_EXT_framebuffer_blit")) { | 802 ctxInfo.hasExtension("GL_EXT_framebuffer_blit")) { |
| 799 fMSFBOType = GrGLCaps::kDesktop_EXT_MSFBOType; | 803 fMSFBOType = GrGLCaps::kDesktop_EXT_MSFBOType; |
| 800 } | 804 } |
| 801 } | 805 } |
| 802 } | 806 } |
| 803 | 807 |
| 804 namespace { | 808 namespace { |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 996 } | 1000 } |
| 997 | 1001 |
| 998 static const char* kMSFBOExtStr[] = { | 1002 static const char* kMSFBOExtStr[] = { |
| 999 "None", | 1003 "None", |
| 1000 "ARB", | 1004 "ARB", |
| 1001 "EXT", | 1005 "EXT", |
| 1002 "ES 3.0", | 1006 "ES 3.0", |
| 1003 "Apple", | 1007 "Apple", |
| 1004 "IMG MS To Texture", | 1008 "IMG MS To Texture", |
| 1005 "EXT MS To Texture", | 1009 "EXT MS To Texture", |
| 1010 "Stencil", |
| 1006 }; | 1011 }; |
| 1007 GR_STATIC_ASSERT(0 == kNone_MSFBOType); | 1012 GR_STATIC_ASSERT(0 == kNone_MSFBOType); |
| 1008 GR_STATIC_ASSERT(1 == kDesktop_ARB_MSFBOType); | 1013 GR_STATIC_ASSERT(1 == kDesktop_ARB_MSFBOType); |
| 1009 GR_STATIC_ASSERT(2 == kDesktop_EXT_MSFBOType); | 1014 GR_STATIC_ASSERT(2 == kDesktop_EXT_MSFBOType); |
| 1010 GR_STATIC_ASSERT(3 == kES_3_0_MSFBOType); | 1015 GR_STATIC_ASSERT(3 == kES_3_0_MSFBOType); |
| 1011 GR_STATIC_ASSERT(4 == kES_Apple_MSFBOType); | 1016 GR_STATIC_ASSERT(4 == kES_Apple_MSFBOType); |
| 1012 GR_STATIC_ASSERT(5 == kES_IMG_MsToTexture_MSFBOType); | 1017 GR_STATIC_ASSERT(5 == kES_IMG_MsToTexture_MSFBOType); |
| 1013 GR_STATIC_ASSERT(6 == kES_EXT_MsToTexture_MSFBOType); | 1018 GR_STATIC_ASSERT(6 == kES_EXT_MsToTexture_MSFBOType); |
| 1019 GR_STATIC_ASSERT(7 == kStencil_MSFBOType); |
| 1014 GR_STATIC_ASSERT(SK_ARRAY_COUNT(kMSFBOExtStr) == kLast_MSFBOType + 1); | 1020 GR_STATIC_ASSERT(SK_ARRAY_COUNT(kMSFBOExtStr) == kLast_MSFBOType + 1); |
| 1015 | 1021 |
| 1016 static const char* kInvalidateFBTypeStr[] = { | 1022 static const char* kInvalidateFBTypeStr[] = { |
| 1017 "None", | 1023 "None", |
| 1018 "Discard", | 1024 "Discard", |
| 1019 "Invalidate", | 1025 "Invalidate", |
| 1020 }; | 1026 }; |
| 1021 GR_STATIC_ASSERT(0 == kNone_InvalidateFBType); | 1027 GR_STATIC_ASSERT(0 == kNone_InvalidateFBType); |
| 1022 GR_STATIC_ASSERT(1 == kDiscard_InvalidateFBType); | 1028 GR_STATIC_ASSERT(1 == kDiscard_InvalidateFBType); |
| 1023 GR_STATIC_ASSERT(2 == kInvalidate_InvalidateFBType); | 1029 GR_STATIC_ASSERT(2 == kInvalidate_InvalidateFBType); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1061 r.appendf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); | 1067 r.appendf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); |
| 1062 r.appendf("Fragment coord conventions support: %s\n", | 1068 r.appendf("Fragment coord conventions support: %s\n", |
| 1063 (fFragCoordsConventionSupport ? "YES": "NO")); | 1069 (fFragCoordsConventionSupport ? "YES": "NO")); |
| 1064 r.appendf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ?
"YES": "NO")); | 1070 r.appendf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ?
"YES": "NO")); |
| 1065 r.appendf("Use non-VBO for dynamic data: %s\n", | 1071 r.appendf("Use non-VBO for dynamic data: %s\n", |
| 1066 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); | 1072 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); |
| 1067 r.appendf("Full screen clear is free: %s\n", (fFullClearIsFree ? "YES" : "NO
")); | 1073 r.appendf("Full screen clear is free: %s\n", (fFullClearIsFree ? "YES" : "NO
")); |
| 1068 r.appendf("Drops tile on zero divide: %s\n", (fDropsTileOnZeroDivide ? "YES"
: "NO")); | 1074 r.appendf("Drops tile on zero divide: %s\n", (fDropsTileOnZeroDivide ? "YES"
: "NO")); |
| 1069 return r; | 1075 return r; |
| 1070 } | 1076 } |
| OLD | NEW |