| 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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 if (kGL_GrGLStandard == standard) { | 128 if (kGL_GrGLStandard == standard) { |
| 129 fTextureBarrierSupport = version >= GR_GL_VER(4,5) || | 129 fTextureBarrierSupport = version >= GR_GL_VER(4,5) || |
| 130 ctxInfo.hasExtension("GL_ARB_texture_barrier")
|| | 130 ctxInfo.hasExtension("GL_ARB_texture_barrier")
|| |
| 131 ctxInfo.hasExtension("GL_NV_texture_barrier"); | 131 ctxInfo.hasExtension("GL_NV_texture_barrier"); |
| 132 } else { | 132 } else { |
| 133 fTextureBarrierSupport = ctxInfo.hasExtension("GL_NV_texture_barrier"); | 133 fTextureBarrierSupport = ctxInfo.hasExtension("GL_NV_texture_barrier"); |
| 134 } | 134 } |
| 135 | 135 |
| 136 // ARB_texture_rg is part of OpenGL 3.0, but mesa doesn't support GL_RED | 136 // ARB_texture_rg is part of OpenGL 3.0, but mesa doesn't support GL_RED |
| 137 // and GL_RG on FBO textures. | 137 // and GL_RG on FBO textures. |
| 138 if (!ctxInfo.isMesa()) { | 138 if (kMesa_GrGLDriver != ctxInfo.driver()) { |
| 139 if (kGL_GrGLStandard == standard) { | 139 if (kGL_GrGLStandard == standard) { |
| 140 fTextureRedSupport = version >= GR_GL_VER(3,0) || | 140 fTextureRedSupport = version >= GR_GL_VER(3,0) || |
| 141 ctxInfo.hasExtension("GL_ARB_texture_rg"); | 141 ctxInfo.hasExtension("GL_ARB_texture_rg"); |
| 142 } else { | 142 } else { |
| 143 fTextureRedSupport = version >= GR_GL_VER(3,0) || | 143 fTextureRedSupport = version >= GR_GL_VER(3,0) || |
| 144 ctxInfo.hasExtension("GL_EXT_texture_rg"); | 144 ctxInfo.hasExtension("GL_EXT_texture_rg"); |
| 145 } | 145 } |
| 146 } | 146 } |
| 147 fImagingSupport = kGL_GrGLStandard == standard && | 147 fImagingSupport = kGL_GrGLStandard == standard && |
| 148 ctxInfo.hasExtension("GL_ARB_imaging"); | 148 ctxInfo.hasExtension("GL_ARB_imaging"); |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 fMapBufferType = kMapBufferRange_MapBufferType; | 267 fMapBufferType = kMapBufferRange_MapBufferType; |
| 268 } else if (ctxInfo.hasExtension("GL_OES_mapbuffer")) { | 268 } else if (ctxInfo.hasExtension("GL_OES_mapbuffer")) { |
| 269 fMapBufferFlags = kCanMap_MapFlag; | 269 fMapBufferFlags = kCanMap_MapFlag; |
| 270 fMapBufferType = kMapBuffer_MapBufferType; | 270 fMapBufferType = kMapBuffer_MapBufferType; |
| 271 } | 271 } |
| 272 } | 272 } |
| 273 | 273 |
| 274 // On many GPUs, map memory is very expensive, so we effectively disable it
here by setting the | 274 // On many GPUs, map memory is very expensive, so we effectively disable it
here by setting the |
| 275 // threshold to the maximum unless the client gives us a hint that map memor
y is cheap. | 275 // threshold to the maximum unless the client gives us a hint that map memor
y is cheap. |
| 276 if (fGeometryBufferMapThreshold < 0) { | 276 if (fGeometryBufferMapThreshold < 0) { |
| 277 fGeometryBufferMapThreshold = ctxInfo.isChromium() ? 0 : SK_MaxS32; | 277 fGeometryBufferMapThreshold = kChromium_GrGLDriver == ctxInfo.driver() ?
0 : SK_MaxS32; |
| 278 } | 278 } |
| 279 | 279 |
| 280 if (kGL_GrGLStandard == standard) { | 280 if (kGL_GrGLStandard == standard) { |
| 281 SkASSERT(ctxInfo.version() >= GR_GL_VER(2,0) || | 281 SkASSERT(ctxInfo.version() >= GR_GL_VER(2,0) || |
| 282 ctxInfo.hasExtension("GL_ARB_texture_non_power_of_two")); | 282 ctxInfo.hasExtension("GL_ARB_texture_non_power_of_two")); |
| 283 fNPOTTextureTileSupport = true; | 283 fNPOTTextureTileSupport = true; |
| 284 fMipMapSupport = true; | 284 fMipMapSupport = true; |
| 285 } else { | 285 } else { |
| 286 // Unextended ES2 supports NPOT textures with clamp_to_edge and non-mip
filters only | 286 // Unextended ES2 supports NPOT textures with clamp_to_edge and non-mip
filters only |
| 287 // ES3 has no limitations. | 287 // ES3 has no limitations. |
| (...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1121 if (fGeometryShaderSupport) { | 1121 if (fGeometryShaderSupport) { |
| 1122 for (int p = 0; p < kGrSLPrecisionCount; ++p) { | 1122 for (int p = 0; p < kGrSLPrecisionCount; ++p) { |
| 1123 fFloatPrecisions[kGeometry_GrShaderType][p] = fFloatPrecisions[kVert
ex_GrShaderType][p]; | 1123 fFloatPrecisions[kGeometry_GrShaderType][p] = fFloatPrecisions[kVert
ex_GrShaderType][p]; |
| 1124 } | 1124 } |
| 1125 } | 1125 } |
| 1126 } | 1126 } |
| 1127 | 1127 |
| 1128 | 1128 |
| 1129 | 1129 |
| 1130 | 1130 |
| OLD | NEW |