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 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 // We support manual mip-map generation (via iterative downsampling draw cal
ls). This fixes | 549 // We support manual mip-map generation (via iterative downsampling draw cal
ls). This fixes |
550 // bugs on some cards/drivers that produce incorrect mip-maps for sRGB textu
res when using | 550 // bugs on some cards/drivers that produce incorrect mip-maps for sRGB textu
res when using |
551 // glGenerateMipmap. Our implementation requires mip-level sampling control.
Additionally, | 551 // glGenerateMipmap. Our implementation requires mip-level sampling control.
Additionally, |
552 // it can be much slower (especially on mobile GPUs), so we opt-in only when
necessary: | 552 // it can be much slower (especially on mobile GPUs), so we opt-in only when
necessary: |
553 if (fMipMapLevelAndLodControlSupport && | 553 if (fMipMapLevelAndLodControlSupport && |
554 ((kIntel_GrGLVendor == ctxInfo.vendor()) || | 554 (contextOptions.fDoManualMipmapping || |
| 555 (kIntel_GrGLVendor == ctxInfo.vendor()) || |
555 (kNVIDIA_GrGLDriver == ctxInfo.driver() && isMAC) || | 556 (kNVIDIA_GrGLDriver == ctxInfo.driver() && isMAC) || |
556 (kATI_GrGLVendor == ctxInfo.vendor()))) { | 557 (kATI_GrGLVendor == ctxInfo.vendor()))) { |
557 fDoManualMipmapping = true; | 558 fDoManualMipmapping = true; |
558 } | 559 } |
559 | 560 |
560 // Requires fTextureRedSupport, fTextureSwizzleSupport, msaa support, ES com
patibility have | 561 // Requires fTextureRedSupport, fTextureSwizzleSupport, msaa support, ES com
patibility have |
561 // already been detected. | 562 // already been detected. |
562 this->initConfigTable(ctxInfo, gli, glslCaps); | 563 this->initConfigTable(ctxInfo, gli, glslCaps); |
563 | 564 |
564 this->applyOptionsOverrides(contextOptions); | 565 this->applyOptionsOverrides(contextOptions); |
(...skipping 1359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1924 for (int j = 0; j < kExternalFormatUsageCnt; ++j) { | 1925 for (int j = 0; j < kExternalFormatUsageCnt; ++j) { |
1925 SkASSERT(defaultEntry.fFormats.fExternalFormat[j] != | 1926 SkASSERT(defaultEntry.fFormats.fExternalFormat[j] != |
1926 fConfigTable[i].fFormats.fExternalFormat[j]); | 1927 fConfigTable[i].fFormats.fExternalFormat[j]); |
1927 } | 1928 } |
1928 SkASSERT(defaultEntry.fFormats.fExternalType != fConfigTable[i].fFormats
.fExternalType); | 1929 SkASSERT(defaultEntry.fFormats.fExternalType != fConfigTable[i].fFormats
.fExternalType); |
1929 } | 1930 } |
1930 #endif | 1931 #endif |
1931 } | 1932 } |
1932 | 1933 |
1933 void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {} | 1934 void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {} |
OLD | NEW |