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 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 * GrCaps fields | 299 * GrCaps fields |
300 **************************************************************************/ | 300 **************************************************************************/ |
301 | 301 |
302 // We need dual source blending and the ability to disable multisample in or
der to support mixed | 302 // We need dual source blending and the ability to disable multisample in or
der to support mixed |
303 // samples in every corner case. | 303 // samples in every corner case. |
304 if (fMultisampleDisableSupport && | 304 if (fMultisampleDisableSupport && |
305 glslCaps->dualSourceBlendingSupport() && | 305 glslCaps->dualSourceBlendingSupport() && |
306 fShaderCaps->pathRenderingSupport()) { | 306 fShaderCaps->pathRenderingSupport()) { |
307 fUsesMixedSamples = ctxInfo.hasExtension("GL_NV_framebuffer_mixed_sample
s") || | 307 fUsesMixedSamples = ctxInfo.hasExtension("GL_NV_framebuffer_mixed_sample
s") || |
308 ctxInfo.hasExtension("GL_CHROMIUM_framebuffer_mixed_samples"); | 308 ctxInfo.hasExtension("GL_CHROMIUM_framebuffer_mixed_samples"); |
309 // Workaround NVIDIA bug related to glInvalidateFramebuffer and mixed sa
mples. | 309 if (fUsesMixedSamples) { |
310 if (fUsesMixedSamples && (kNVIDIA_GrGLDriver == ctxInfo.driver() || | 310 if (kNVIDIA_GrGLDriver == ctxInfo.driver() || |
311 kChromium_GrGLDriver == ctxInfo.driver())) { | 311 kChromium_GrGLDriver == ctxInfo.driver()) { |
312 fDiscardRenderTargetSupport = false; | 312 // Workaround NVIDIA bug related to glInvalidateFramebuffer and
mixed samples. |
313 fInvalidateFBType = kNone_InvalidateFBType; | 313 fDiscardRenderTargetSupport = false; |
| 314 fInvalidateFBType = kNone_InvalidateFBType; |
| 315 } |
| 316 // Raster multisample is only useful to us when coverage modulation
is also supported, |
| 317 // as defined by mixed samples. |
| 318 fRasterMultisampleSupport = ctxInfo.hasExtension("GL_EXT_raster_mult
isample"); |
| 319 if (fRasterMultisampleSupport) { |
| 320 GR_GL_GetIntegerv(gli, GR_GL_MAX_RASTER_SAMPLES, &fMaxRasterSamp
les); |
| 321 } |
314 } | 322 } |
315 } | 323 } |
316 | 324 |
317 // fUsesMixedSamples must be set before calling initFSAASupport. | 325 // fUsesMixedSamples must be set before calling initFSAASupport. |
318 this->initFSAASupport(ctxInfo, gli); | 326 this->initFSAASupport(ctxInfo, gli); |
319 this->initBlendEqationSupport(ctxInfo); | 327 this->initBlendEqationSupport(ctxInfo); |
320 this->initStencilFormats(ctxInfo); | 328 this->initStencilFormats(ctxInfo); |
321 | 329 |
322 if (kGL_GrGLStandard == standard) { | 330 if (kGL_GrGLStandard == standard) { |
323 // we could also look for GL_ATI_separate_stencil extension or | 331 // we could also look for GL_ATI_separate_stencil extension or |
(...skipping 1311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1635 for (int j = 0; j < kExternalFormatUsageCnt; ++j) { | 1643 for (int j = 0; j < kExternalFormatUsageCnt; ++j) { |
1636 SkASSERT(defaultEntry.fFormats.fExternalFormat[j] != | 1644 SkASSERT(defaultEntry.fFormats.fExternalFormat[j] != |
1637 fConfigTable[i].fFormats.fExternalFormat[j]); | 1645 fConfigTable[i].fFormats.fExternalFormat[j]); |
1638 } | 1646 } |
1639 SkASSERT(defaultEntry.fFormats.fExternalType != fConfigTable[i].fFormats
.fExternalType); | 1647 SkASSERT(defaultEntry.fFormats.fExternalType != fConfigTable[i].fFormats
.fExternalType); |
1640 } | 1648 } |
1641 #endif | 1649 #endif |
1642 } | 1650 } |
1643 | 1651 |
1644 void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {} | 1652 void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {} |
OLD | NEW |