| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 fBaseInstanceSupport = false; | 43 fBaseInstanceSupport = false; |
| 44 fUseNonVBOVertexAndIndexDynamicData = false; | 44 fUseNonVBOVertexAndIndexDynamicData = false; |
| 45 fIsCoreProfile = false; | 45 fIsCoreProfile = false; |
| 46 fBindFragDataLocationSupport = false; | 46 fBindFragDataLocationSupport = false; |
| 47 fRectangleTextureSupport = false; | 47 fRectangleTextureSupport = false; |
| 48 fTextureSwizzleSupport = false; | 48 fTextureSwizzleSupport = false; |
| 49 fRGBA8888PixelsOpsAreSlow = false; | 49 fRGBA8888PixelsOpsAreSlow = false; |
| 50 fPartialFBOReadIsSlow = false; | 50 fPartialFBOReadIsSlow = false; |
| 51 fMipMapLevelAndLodControlSupport = false; | 51 fMipMapLevelAndLodControlSupport = false; |
| 52 fRGBAToBGRAReadbackConversionsAreSlow = false; | 52 fRGBAToBGRAReadbackConversionsAreSlow = false; |
| 53 fDoManualMipmapping = false; |
| 53 | 54 |
| 54 fBlitFramebufferSupport = kNone_BlitFramebufferSupport; | 55 fBlitFramebufferSupport = kNone_BlitFramebufferSupport; |
| 55 | 56 |
| 56 fShaderCaps.reset(new GrGLSLCaps(contextOptions)); | 57 fShaderCaps.reset(new GrGLSLCaps(contextOptions)); |
| 57 | 58 |
| 58 this->init(contextOptions, ctxInfo, glInterface); | 59 this->init(contextOptions, ctxInfo, glInterface); |
| 59 } | 60 } |
| 60 | 61 |
| 61 void GrGLCaps::init(const GrContextOptions& contextOptions, | 62 void GrGLCaps::init(const GrContextOptions& contextOptions, |
| 62 const GrGLContextInfo& ctxInfo, | 63 const GrGLContextInfo& ctxInfo, |
| (...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 | 537 |
| 537 if (kGL_GrGLStandard == standard) { | 538 if (kGL_GrGLStandard == standard) { |
| 538 if ((version >= GR_GL_VER(4, 0) || ctxInfo.hasExtension("GL_ARB_sample_s
hading")) && | 539 if ((version >= GR_GL_VER(4, 0) || ctxInfo.hasExtension("GL_ARB_sample_s
hading")) && |
| 539 ctxInfo.vendor() != kIntel_GrGLVendor) { | 540 ctxInfo.vendor() != kIntel_GrGLVendor) { |
| 540 fSampleShadingSupport = true; | 541 fSampleShadingSupport = true; |
| 541 } | 542 } |
| 542 } else if (ctxInfo.hasExtension("GL_OES_sample_shading")) { | 543 } else if (ctxInfo.hasExtension("GL_OES_sample_shading")) { |
| 543 fSampleShadingSupport = true; | 544 fSampleShadingSupport = true; |
| 544 } | 545 } |
| 545 | 546 |
| 547 // Manual mip-mapping requires mip-level sampling control. |
| 548 // Additionally, Adreno330 will produce empty mip-maps for the very smallest
mips with |
| 549 // our manual (draw-call) implementation. |
| 550 if (fMipMapLevelAndLodControlSupport && |
| 551 kAdreno3xx_GrGLRenderer != ctxInfo.renderer()) { |
| 552 fDoManualMipmapping = true; |
| 553 } |
| 554 |
| 546 // Requires fTextureRedSupport, fTextureSwizzleSupport, msaa support, ES com
patibility have | 555 // Requires fTextureRedSupport, fTextureSwizzleSupport, msaa support, ES com
patibility have |
| 547 // already been detected. | 556 // already been detected. |
| 548 this->initConfigTable(ctxInfo, gli, glslCaps); | 557 this->initConfigTable(ctxInfo, gli, glslCaps); |
| 549 | 558 |
| 550 this->applyOptionsOverrides(contextOptions); | 559 this->applyOptionsOverrides(contextOptions); |
| 551 glslCaps->applyOptionsOverrides(contextOptions); | 560 glslCaps->applyOptionsOverrides(contextOptions); |
| 552 } | 561 } |
| 553 | 562 |
| 554 const char* get_glsl_version_decl_string(GrGLStandard standard, GrGLSLGeneration
generation, | 563 const char* get_glsl_version_decl_string(GrGLStandard standard, GrGLSLGeneration
generation, |
| 555 bool isCoreProfile) { | 564 bool isCoreProfile) { |
| (...skipping 1354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1910 for (int j = 0; j < kExternalFormatUsageCnt; ++j) { | 1919 for (int j = 0; j < kExternalFormatUsageCnt; ++j) { |
| 1911 SkASSERT(defaultEntry.fFormats.fExternalFormat[j] != | 1920 SkASSERT(defaultEntry.fFormats.fExternalFormat[j] != |
| 1912 fConfigTable[i].fFormats.fExternalFormat[j]); | 1921 fConfigTable[i].fFormats.fExternalFormat[j]); |
| 1913 } | 1922 } |
| 1914 SkASSERT(defaultEntry.fFormats.fExternalType != fConfigTable[i].fFormats
.fExternalType); | 1923 SkASSERT(defaultEntry.fFormats.fExternalType != fConfigTable[i].fFormats
.fExternalType); |
| 1915 } | 1924 } |
| 1916 #endif | 1925 #endif |
| 1917 } | 1926 } |
| 1918 | 1927 |
| 1919 void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {} | 1928 void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {} |
| OLD | NEW |