| 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 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 | 539 |
| 540 if (kGL_GrGLStandard == standard) { | 540 if (kGL_GrGLStandard == standard) { |
| 541 if ((version >= GR_GL_VER(4, 0) || ctxInfo.hasExtension("GL_ARB_sample_s
hading")) && | 541 if ((version >= GR_GL_VER(4, 0) || ctxInfo.hasExtension("GL_ARB_sample_s
hading")) && |
| 542 ctxInfo.vendor() != kIntel_GrGLVendor) { | 542 ctxInfo.vendor() != kIntel_GrGLVendor) { |
| 543 fSampleShadingSupport = true; | 543 fSampleShadingSupport = true; |
| 544 } | 544 } |
| 545 } else if (ctxInfo.hasExtension("GL_OES_sample_shading")) { | 545 } else if (ctxInfo.hasExtension("GL_OES_sample_shading")) { |
| 546 fSampleShadingSupport = true; | 546 fSampleShadingSupport = true; |
| 547 } | 547 } |
| 548 | 548 |
| 549 // Manual mip-mapping requires mip-level sampling control. | 549 // We support manual mip-map generation (via iterative downsampling draw cal
ls). This fixes |
| 550 // Additionally, Adreno330 will produce empty mip-maps for the very smallest
mips with | 550 // bugs on some cards/drivers that produce incorrect mip-maps for sRGB textu
res when using |
| 551 // our manual (draw-call) implementation. | 551 // glGenerateMipmap. Our implementation requires mip-level sampling control.
Additionally, |
| 552 // At least some Mali chips (T604 in Nexus10) produces incorrect (wrt sRGB)
mips using draws | 552 // it can be much slower (especially on mobile GPUs), so we opt-in only when
necessary: |
| 553 if (fMipMapLevelAndLodControlSupport && | 553 if (fMipMapLevelAndLodControlSupport && |
| 554 kAdreno3xx_GrGLRenderer != ctxInfo.renderer() && | 554 ((kIntel_GrGLVendor == ctxInfo.vendor()) || |
| 555 kARM_GrGLVendor != ctxInfo.vendor()) { | 555 (kNVIDIA_GrGLDriver == ctxInfo.driver() && isMAC) || |
| 556 (kATI_GrGLVendor == ctxInfo.vendor()))) { |
| 556 fDoManualMipmapping = true; | 557 fDoManualMipmapping = true; |
| 557 } | 558 } |
| 558 | 559 |
| 559 // Requires fTextureRedSupport, fTextureSwizzleSupport, msaa support, ES com
patibility have | 560 // Requires fTextureRedSupport, fTextureSwizzleSupport, msaa support, ES com
patibility have |
| 560 // already been detected. | 561 // already been detected. |
| 561 this->initConfigTable(ctxInfo, gli, glslCaps); | 562 this->initConfigTable(ctxInfo, gli, glslCaps); |
| 562 | 563 |
| 563 this->applyOptionsOverrides(contextOptions); | 564 this->applyOptionsOverrides(contextOptions); |
| 564 glslCaps->applyOptionsOverrides(contextOptions); | 565 glslCaps->applyOptionsOverrides(contextOptions); |
| 565 } | 566 } |
| (...skipping 1357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1923 for (int j = 0; j < kExternalFormatUsageCnt; ++j) { | 1924 for (int j = 0; j < kExternalFormatUsageCnt; ++j) { |
| 1924 SkASSERT(defaultEntry.fFormats.fExternalFormat[j] != | 1925 SkASSERT(defaultEntry.fFormats.fExternalFormat[j] != |
| 1925 fConfigTable[i].fFormats.fExternalFormat[j]); | 1926 fConfigTable[i].fFormats.fExternalFormat[j]); |
| 1926 } | 1927 } |
| 1927 SkASSERT(defaultEntry.fFormats.fExternalType != fConfigTable[i].fFormats
.fExternalType); | 1928 SkASSERT(defaultEntry.fFormats.fExternalType != fConfigTable[i].fFormats
.fExternalType); |
| 1928 } | 1929 } |
| 1929 #endif | 1930 #endif |
| 1930 } | 1931 } |
| 1931 | 1932 |
| 1932 void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {} | 1933 void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {} |
| OLD | NEW |