| Index: src/gpu/gl/GrGLCaps.cpp
|
| diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
|
| index d95e10ba64d80d3c53ad73e48e725db38d299161..7af3576dfeca6abbd8b119af722de8a42d0bf5ee 100644
|
| --- a/src/gpu/gl/GrGLCaps.cpp
|
| +++ b/src/gpu/gl/GrGLCaps.cpp
|
| @@ -306,11 +306,16 @@ void GrGLCaps::init(const GrContextOptions& contextOptions,
|
| fShaderCaps->pathRenderingSupport()) {
|
| fUsesMixedSamples = ctxInfo.hasExtension("GL_NV_framebuffer_mixed_samples") ||
|
| ctxInfo.hasExtension("GL_CHROMIUM_framebuffer_mixed_samples");
|
| - // Workaround NVIDIA bug related to glInvalidateFramebuffer and mixed samples.
|
| - if (fUsesMixedSamples && (kNVIDIA_GrGLDriver == ctxInfo.driver() ||
|
| - kChromium_GrGLDriver == ctxInfo.driver())) {
|
| - fDiscardRenderTargetSupport = false;
|
| - fInvalidateFBType = kNone_InvalidateFBType;
|
| + if (fUsesMixedSamples) {
|
| + if (kNVIDIA_GrGLDriver == ctxInfo.driver() ||
|
| + kChromium_GrGLDriver == ctxInfo.driver()) {
|
| + // Workaround NVIDIA bug related to glInvalidateFramebuffer and mixed samples.
|
| + fDiscardRenderTargetSupport = false;
|
| + fInvalidateFBType = kNone_InvalidateFBType;
|
| + }
|
| + // Raster multisample is only useful to us when coverage modulation is also supported,
|
| + // as defined by mixed samples.
|
| + fRasterMultisampleSupport = ctxInfo.hasExtension("GL_EXT_raster_multisample");
|
| }
|
| }
|
|
|
| @@ -423,11 +428,17 @@ void GrGLCaps::init(const GrContextOptions& contextOptions,
|
|
|
| // initFSAASupport() must have been called before this point
|
| if (GrGLCaps::kES_IMG_MsToTexture_MSFBOType == fMSFBOType) {
|
| - GR_GL_GetIntegerv(gli, GR_GL_MAX_SAMPLES_IMG, &fMaxColorSampleCount);
|
| + GR_GL_GetIntegerv(gli, GR_GL_MAX_SAMPLES_IMG, &fMaxStencilSampleCount);
|
| } else if (GrGLCaps::kNone_MSFBOType != fMSFBOType) {
|
| - GR_GL_GetIntegerv(gli, GR_GL_MAX_SAMPLES, &fMaxColorSampleCount);
|
| + GR_GL_GetIntegerv(gli, GR_GL_MAX_SAMPLES, &fMaxStencilSampleCount);
|
| + }
|
| + if (fRasterMultisampleSupport) {
|
| + GR_GL_GetIntegerv(gli, GR_GL_MAX_RASTER_SAMPLES, &fMaxRasterSamples);
|
| + // This is to guard against platforms that may not support as many samples for
|
| + // glRasterSamples as they do for framebuffers.
|
| + fMaxStencilSampleCount = SkTMin(fMaxStencilSampleCount, fMaxRasterSamples);
|
| }
|
| - fMaxStencilSampleCount = fMaxColorSampleCount;
|
| + fMaxColorSampleCount = fMaxStencilSampleCount;
|
|
|
| if (kPowerVR54x_GrGLRenderer == ctxInfo.renderer() ||
|
| kPowerVRRogue_GrGLRenderer == ctxInfo.renderer() ||
|
|
|