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 #include "GrGLContext.h" | 10 #include "GrGLContext.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 fVertexArrayObjectSupport = caps.fVertexArrayObjectSupport; | 83 fVertexArrayObjectSupport = caps.fVertexArrayObjectSupport; |
84 fUseNonVBOVertexAndIndexDynamicData = caps.fUseNonVBOVertexAndIndexDynamicDa
ta; | 84 fUseNonVBOVertexAndIndexDynamicData = caps.fUseNonVBOVertexAndIndexDynamicDa
ta; |
85 fIsCoreProfile = caps.fIsCoreProfile; | 85 fIsCoreProfile = caps.fIsCoreProfile; |
86 fFullClearIsFree = caps.fFullClearIsFree; | 86 fFullClearIsFree = caps.fFullClearIsFree; |
87 fDropsTileOnZeroDivide = caps.fDropsTileOnZeroDivide; | 87 fDropsTileOnZeroDivide = caps.fDropsTileOnZeroDivide; |
88 fMapSubSupport = caps.fMapSubSupport; | 88 fMapSubSupport = caps.fMapSubSupport; |
89 | 89 |
90 return *this; | 90 return *this; |
91 } | 91 } |
92 | 92 |
93 void GrGLCaps::init(const GrGLContextInfo& ctxInfo, const GrGLInterface* gli) { | 93 bool GrGLCaps::init(const GrGLContextInfo& ctxInfo, const GrGLInterface* gli) { |
94 | 94 |
95 this->reset(); | 95 this->reset(); |
96 if (!ctxInfo.isInitialized()) { | 96 if (!ctxInfo.isInitialized()) { |
97 return; | 97 return false; |
98 } | 98 } |
99 | 99 |
100 GrGLStandard standard = ctxInfo.standard(); | 100 GrGLStandard standard = ctxInfo.standard(); |
101 GrGLVersion version = ctxInfo.version(); | 101 GrGLVersion version = ctxInfo.version(); |
102 | 102 |
103 /************************************************************************** | 103 /************************************************************************** |
104 * Caps specific to GrGLCaps | 104 * Caps specific to GrGLCaps |
105 **************************************************************************/ | 105 **************************************************************************/ |
106 | 106 |
107 if (kGLES_GrGLStandard == standard) { | 107 if (kGLES_GrGLStandard == standard) { |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 fShaderDerivativeSupport = ctxInfo.hasExtension("GL_OES_standard_derivat
ives"); | 346 fShaderDerivativeSupport = ctxInfo.hasExtension("GL_OES_standard_derivat
ives"); |
347 } | 347 } |
348 | 348 |
349 if (GrGLCaps::kES_IMG_MsToTexture_MSFBOType == fMSFBOType) { | 349 if (GrGLCaps::kES_IMG_MsToTexture_MSFBOType == fMSFBOType) { |
350 GR_GL_GetIntegerv(gli, GR_GL_MAX_SAMPLES_IMG, &fMaxSampleCount); | 350 GR_GL_GetIntegerv(gli, GR_GL_MAX_SAMPLES_IMG, &fMaxSampleCount); |
351 } else if (GrGLCaps::kNone_MSFBOType != fMSFBOType) { | 351 } else if (GrGLCaps::kNone_MSFBOType != fMSFBOType) { |
352 GR_GL_GetIntegerv(gli, GR_GL_MAX_SAMPLES, &fMaxSampleCount); | 352 GR_GL_GetIntegerv(gli, GR_GL_MAX_SAMPLES, &fMaxSampleCount); |
353 } | 353 } |
354 | 354 |
355 this->initConfigRenderableTable(ctxInfo); | 355 this->initConfigRenderableTable(ctxInfo); |
| 356 |
| 357 return true; |
356 } | 358 } |
357 | 359 |
358 void GrGLCaps::initConfigRenderableTable(const GrGLContextInfo& ctxInfo) { | 360 void GrGLCaps::initConfigRenderableTable(const GrGLContextInfo& ctxInfo) { |
359 | 361 |
360 // OpenGL < 3.0 | 362 // OpenGL < 3.0 |
361 // no support for render targets unless the GL_ARB_framebuffer_object | 363 // no support for render targets unless the GL_ARB_framebuffer_object |
362 // extension is supported (in which case we get ALPHA, RED, RG, RGB, | 364 // extension is supported (in which case we get ALPHA, RED, RG, RGB, |
363 // RGBA (ALPHA8, RGBA4, RGBA8) for OpenGL > 1.1). Note that we | 365 // RGBA (ALPHA8, RGBA4, RGBA8) for OpenGL > 1.1). Note that we |
364 // probably don't get R8 in this case. | 366 // probably don't get R8 in this case. |
365 | 367 |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
679 r.appendf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); | 681 r.appendf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); |
680 r.appendf("Fragment coord conventions support: %s\n", | 682 r.appendf("Fragment coord conventions support: %s\n", |
681 (fFragCoordsConventionSupport ? "YES": "NO")); | 683 (fFragCoordsConventionSupport ? "YES": "NO")); |
682 r.appendf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ?
"YES": "NO")); | 684 r.appendf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ?
"YES": "NO")); |
683 r.appendf("Use non-VBO for dynamic data: %s\n", | 685 r.appendf("Use non-VBO for dynamic data: %s\n", |
684 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); | 686 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); |
685 r.appendf("Full screen clear is free: %s\n", (fFullClearIsFree ? "YES" : "NO
")); | 687 r.appendf("Full screen clear is free: %s\n", (fFullClearIsFree ? "YES" : "NO
")); |
686 r.appendf("Drops tile on zero divide: %s\n", (fDropsTileOnZeroDivide ? "YES"
: "NO")); | 688 r.appendf("Drops tile on zero divide: %s\n", (fDropsTileOnZeroDivide ? "YES"
: "NO")); |
687 return r; | 689 return r; |
688 } | 690 } |
OLD | NEW |