Make mixed samples contingent on auxiliary extensions

Moves the cap for mixed samples into GrShaderCaps and does not enable
it unless we have support for both dual source blending and
multisample disable.

Creates a dedicated cap for multisample disable.

Reconfigures the mixed samples cap to indicate the collective
capability of three different extensions:

  GL_NV_framebuffer_mixed_samples
  GL_NV_sample_mask_override_coverage
  GL_EXT_raster_multisample

Imports tokens and procedures for GL_EXT_raster_multisample.

BUG=skia:

Review URL: https://codereview.chromium.org/1151793002
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index ea6b83f..85a7260 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -44,10 +44,10 @@
     fFragCoordsConventionSupport = false;
     fVertexArrayObjectSupport = false;
     fES2CompatibilitySupport = false;
+    fMultisampleDisableSupport = false;
     fUseNonVBOVertexAndIndexDynamicData = false;
     fIsCoreProfile = false;
     fFullClearIsFree = false;
-    fFBMixedSamplesSupport = false;
 
     fReadPixelsSupportedCache.reset();
 
@@ -86,10 +86,10 @@
     fFragCoordsConventionSupport = caps.fFragCoordsConventionSupport;
     fVertexArrayObjectSupport = caps.fVertexArrayObjectSupport;
     fES2CompatibilitySupport = caps.fES2CompatibilitySupport;
+    fMultisampleDisableSupport = caps.fMultisampleDisableSupport;
     fUseNonVBOVertexAndIndexDynamicData = caps.fUseNonVBOVertexAndIndexDynamicData;
     fIsCoreProfile = caps.fIsCoreProfile;
     fFullClearIsFree = caps.fFullClearIsFree;
-    fFBMixedSamplesSupport = caps.fFBMixedSamplesSupport;
 
     *(reinterpret_cast<GrGLSLCaps*>(fShaderCaps.get())) = 
                                           *(reinterpret_cast<GrGLSLCaps*>(caps.fShaderCaps.get()));
@@ -252,6 +252,12 @@
         fES2CompatibilitySupport = true;
     }
 
+    if (kGL_GrGLStandard == standard) {
+        fMultisampleDisableSupport = true;
+    } else {
+        fMultisampleDisableSupport = false;
+    }
+
     this->initFSAASupport(ctxInfo, gli);
     this->initStencilFormats(ctxInfo);
 
@@ -336,8 +342,6 @@
     // attachment, hence this min:
     fMaxRenderTargetSize = SkTMin(fMaxTextureSize, fMaxRenderTargetSize);
 
-    fFBMixedSamplesSupport = ctxInfo.hasExtension("GL_NV_framebuffer_mixed_samples");
-
     fGpuTracingSupport = ctxInfo.hasExtension("GL_EXT_debug_marker");
 
     // Disable scratch texture reuse on Mali and Adreno devices
@@ -935,6 +939,7 @@
     r.appendf("Fragment coord conventions support: %s\n",
              (fFragCoordsConventionSupport ? "YES": "NO"));
     r.appendf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ? "YES": "NO"));
+    r.appendf("Multisample disable support: %s\n", (fMultisampleDisableSupport ? "YES" : "NO"));
     r.appendf("Use non-VBO for dynamic data: %s\n",
              (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO"));
     r.appendf("Full screen clear is free: %s\n", (fFullClearIsFree ? "YES" : "NO"));
@@ -1054,6 +1059,15 @@
             ctxInfo.hasExtension("GL_OES_standard_derivatives");
     }
 
+    // We need dual source blending and the ability to disable multisample in order to support mixed
+    // samples in every corner case.
+    if (fDualSourceBlendingSupport && glCaps.multisampleDisableSupport()) {
+        // We understand "mixed samples" to mean the collective capability of 3 different extensions
+        fMixedSamplesSupport = ctxInfo.hasExtension("GL_NV_framebuffer_mixed_samples") &&
+                               ctxInfo.hasExtension("GL_NV_sample_mask_override_coverage") &&
+                               ctxInfo.hasExtension("GL_EXT_raster_multisample");
+    }
+
     if (glCaps.advancedBlendEquationSupport()) {
         bool coherent = glCaps.advancedCoherentBlendEquationSupport();
         if (ctxInfo.hasExtension(coherent ? "GL_NV_blend_equation_advanced_coherent"