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 26 matching lines...) Expand all Loading... |
37 fUnpackFlipYSupport = false; | 37 fUnpackFlipYSupport = false; |
38 fPackRowLengthSupport = false; | 38 fPackRowLengthSupport = false; |
39 fPackFlipYSupport = false; | 39 fPackFlipYSupport = false; |
40 fTextureUsageSupport = false; | 40 fTextureUsageSupport = false; |
41 fTexStorageSupport = false; | 41 fTexStorageSupport = false; |
42 fTextureRedSupport = false; | 42 fTextureRedSupport = false; |
43 fImagingSupport = false; | 43 fImagingSupport = false; |
44 fTwoFormatLimit = false; | 44 fTwoFormatLimit = false; |
45 fFragCoordsConventionSupport = false; | 45 fFragCoordsConventionSupport = false; |
46 fVertexArrayObjectSupport = false; | 46 fVertexArrayObjectSupport = false; |
| 47 fES2CompatibilitySupport = false; |
47 fUseNonVBOVertexAndIndexDynamicData = false; | 48 fUseNonVBOVertexAndIndexDynamicData = false; |
48 fIsCoreProfile = false; | 49 fIsCoreProfile = false; |
49 fFullClearIsFree = false; | 50 fFullClearIsFree = false; |
50 fDropsTileOnZeroDivide = false; | 51 fDropsTileOnZeroDivide = false; |
51 fFBFetchSupport = false; | 52 fFBFetchSupport = false; |
52 fFBFetchColorName = NULL; | 53 fFBFetchColorName = NULL; |
53 fFBFetchExtensionString = NULL; | 54 fFBFetchExtensionString = NULL; |
54 | 55 |
55 fReadPixelsSupportedCache.reset(); | 56 fReadPixelsSupportedCache.reset(); |
56 } | 57 } |
(...skipping 22 matching lines...) Expand all Loading... |
79 fUnpackFlipYSupport = caps.fUnpackFlipYSupport; | 80 fUnpackFlipYSupport = caps.fUnpackFlipYSupport; |
80 fPackRowLengthSupport = caps.fPackRowLengthSupport; | 81 fPackRowLengthSupport = caps.fPackRowLengthSupport; |
81 fPackFlipYSupport = caps.fPackFlipYSupport; | 82 fPackFlipYSupport = caps.fPackFlipYSupport; |
82 fTextureUsageSupport = caps.fTextureUsageSupport; | 83 fTextureUsageSupport = caps.fTextureUsageSupport; |
83 fTexStorageSupport = caps.fTexStorageSupport; | 84 fTexStorageSupport = caps.fTexStorageSupport; |
84 fTextureRedSupport = caps.fTextureRedSupport; | 85 fTextureRedSupport = caps.fTextureRedSupport; |
85 fImagingSupport = caps.fImagingSupport; | 86 fImagingSupport = caps.fImagingSupport; |
86 fTwoFormatLimit = caps.fTwoFormatLimit; | 87 fTwoFormatLimit = caps.fTwoFormatLimit; |
87 fFragCoordsConventionSupport = caps.fFragCoordsConventionSupport; | 88 fFragCoordsConventionSupport = caps.fFragCoordsConventionSupport; |
88 fVertexArrayObjectSupport = caps.fVertexArrayObjectSupport; | 89 fVertexArrayObjectSupport = caps.fVertexArrayObjectSupport; |
| 90 fES2CompatibilitySupport = caps.fES2CompatibilitySupport; |
89 fUseNonVBOVertexAndIndexDynamicData = caps.fUseNonVBOVertexAndIndexDynamicDa
ta; | 91 fUseNonVBOVertexAndIndexDynamicData = caps.fUseNonVBOVertexAndIndexDynamicDa
ta; |
90 fIsCoreProfile = caps.fIsCoreProfile; | 92 fIsCoreProfile = caps.fIsCoreProfile; |
91 fFullClearIsFree = caps.fFullClearIsFree; | 93 fFullClearIsFree = caps.fFullClearIsFree; |
92 fDropsTileOnZeroDivide = caps.fDropsTileOnZeroDivide; | 94 fDropsTileOnZeroDivide = caps.fDropsTileOnZeroDivide; |
93 fFBFetchSupport = caps.fFBFetchSupport; | 95 fFBFetchSupport = caps.fFBFetchSupport; |
94 fFBFetchColorName = caps.fFBFetchColorName; | 96 fFBFetchColorName = caps.fFBFetchColorName; |
95 fFBFetchExtensionString = caps.fFBFetchExtensionString; | 97 fFBFetchExtensionString = caps.fFBFetchExtensionString; |
96 | 98 |
97 return *this; | 99 return *this; |
98 } | 100 } |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 | 234 |
233 if (kGL_GrGLStandard == standard) { | 235 if (kGL_GrGLStandard == standard) { |
234 fVertexArrayObjectSupport = version >= GR_GL_VER(3, 0) || | 236 fVertexArrayObjectSupport = version >= GR_GL_VER(3, 0) || |
235 ctxInfo.hasExtension("GL_ARB_vertex_array_ob
ject") || | 237 ctxInfo.hasExtension("GL_ARB_vertex_array_ob
ject") || |
236 ctxInfo.hasExtension("GL_APPLE_vertex_array_
object"); | 238 ctxInfo.hasExtension("GL_APPLE_vertex_array_
object"); |
237 } else { | 239 } else { |
238 fVertexArrayObjectSupport = version >= GR_GL_VER(3, 0) || | 240 fVertexArrayObjectSupport = version >= GR_GL_VER(3, 0) || |
239 ctxInfo.hasExtension("GL_OES_vertex_array_ob
ject"); | 241 ctxInfo.hasExtension("GL_OES_vertex_array_ob
ject"); |
240 } | 242 } |
241 | 243 |
| 244 if (kGL_GrGLStandard == standard) { |
| 245 fES2CompatibilitySupport = ctxInfo.hasExtension("GL_ARB_ES2_compatibilit
y"); |
| 246 } |
| 247 else { |
| 248 fES2CompatibilitySupport = true; |
| 249 } |
| 250 |
242 if (kGLES_GrGLStandard == standard) { | 251 if (kGLES_GrGLStandard == standard) { |
243 if (ctxInfo.hasExtension("GL_EXT_shader_framebuffer_fetch")) { | 252 if (ctxInfo.hasExtension("GL_EXT_shader_framebuffer_fetch")) { |
244 fFBFetchSupport = true; | 253 fFBFetchSupport = true; |
245 fFBFetchColorName = "gl_LastFragData[0]"; | 254 fFBFetchColorName = "gl_LastFragData[0]"; |
246 fFBFetchExtensionString = "GL_EXT_shader_framebuffer_fetch"; | 255 fFBFetchExtensionString = "GL_EXT_shader_framebuffer_fetch"; |
247 } else if (ctxInfo.hasExtension("GL_NV_shader_framebuffer_fetch")) { | 256 } else if (ctxInfo.hasExtension("GL_NV_shader_framebuffer_fetch")) { |
248 fFBFetchSupport = true; | 257 fFBFetchSupport = true; |
249 fFBFetchColorName = "gl_LastFragData[0]"; | 258 fFBFetchColorName = "gl_LastFragData[0]"; |
250 fFBFetchExtensionString = "GL_NV_shader_framebuffer_fetch"; | 259 fFBFetchExtensionString = "GL_NV_shader_framebuffer_fetch"; |
251 } else if (ctxInfo.hasExtension("GL_ARM_shader_framebuffer_fetch")) { | 260 } else if (ctxInfo.hasExtension("GL_ARM_shader_framebuffer_fetch")) { |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 } | 513 } |
505 } | 514 } |
506 } | 515 } |
507 | 516 |
508 void GrGLCaps::initConfigTexturableTable(const GrGLContextInfo& ctxInfo, const G
rGLInterface* gli) { | 517 void GrGLCaps::initConfigTexturableTable(const GrGLContextInfo& ctxInfo, const G
rGLInterface* gli) { |
509 GrGLStandard standard = ctxInfo.standard(); | 518 GrGLStandard standard = ctxInfo.standard(); |
510 GrGLVersion version = ctxInfo.version(); | 519 GrGLVersion version = ctxInfo.version(); |
511 | 520 |
512 // Base texture support | 521 // Base texture support |
513 fConfigTextureSupport[kAlpha_8_GrPixelConfig] = true; | 522 fConfigTextureSupport[kAlpha_8_GrPixelConfig] = true; |
514 fConfigTextureSupport[kRGB_565_GrPixelConfig] = true; | 523 fConfigTextureSupport[kRGB_565_GrPixelConfig] = (kGL_GrGLStandard != standar
d || |
| 524 fES2CompatibilitySupport); |
515 fConfigTextureSupport[kRGBA_4444_GrPixelConfig] = true; | 525 fConfigTextureSupport[kRGBA_4444_GrPixelConfig] = true; |
516 fConfigTextureSupport[kRGBA_8888_GrPixelConfig] = true; | 526 fConfigTextureSupport[kRGBA_8888_GrPixelConfig] = true; |
517 | 527 |
518 // Check for 8-bit palette.. | 528 // Check for 8-bit palette.. |
519 GrGLint numFormats; | 529 GrGLint numFormats; |
520 GR_GL_GetIntegerv(gli, GR_GL_NUM_COMPRESSED_TEXTURE_FORMATS, &numFormats); | 530 GR_GL_GetIntegerv(gli, GR_GL_NUM_COMPRESSED_TEXTURE_FORMATS, &numFormats); |
521 if (numFormats) { | 531 if (numFormats) { |
522 SkAutoSTMalloc<10, GrGLint> formats(numFormats); | 532 SkAutoSTMalloc<10, GrGLint> formats(numFormats); |
523 GR_GL_GetIntegerv(gli, GR_GL_COMPRESSED_TEXTURE_FORMATS, formats); | 533 GR_GL_GetIntegerv(gli, GR_GL_COMPRESSED_TEXTURE_FORMATS, formats); |
524 for (int i = 0; i < numFormats; ++i) { | 534 for (int i = 0; i < numFormats; ++i) { |
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
985 r.appendf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); | 995 r.appendf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); |
986 r.appendf("Fragment coord conventions support: %s\n", | 996 r.appendf("Fragment coord conventions support: %s\n", |
987 (fFragCoordsConventionSupport ? "YES": "NO")); | 997 (fFragCoordsConventionSupport ? "YES": "NO")); |
988 r.appendf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ?
"YES": "NO")); | 998 r.appendf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ?
"YES": "NO")); |
989 r.appendf("Use non-VBO for dynamic data: %s\n", | 999 r.appendf("Use non-VBO for dynamic data: %s\n", |
990 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); | 1000 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); |
991 r.appendf("Full screen clear is free: %s\n", (fFullClearIsFree ? "YES" : "NO
")); | 1001 r.appendf("Full screen clear is free: %s\n", (fFullClearIsFree ? "YES" : "NO
")); |
992 r.appendf("Drops tile on zero divide: %s\n", (fDropsTileOnZeroDivide ? "YES"
: "NO")); | 1002 r.appendf("Drops tile on zero divide: %s\n", (fDropsTileOnZeroDivide ? "YES"
: "NO")); |
993 return r; | 1003 return r; |
994 } | 1004 } |
OLD | NEW |