Move multisampleDisableSupport into GrCaps
authorcsmartdalton <csmartdalton@google.com>
Fri, 10 Jun 2016 21:06:32 +0000 (14:06 -0700)
committerCommit bot <commit-bot@chromium.org>
Fri, 10 Jun 2016 21:06:32 +0000 (14:06 -0700)
Non-platform code needs this information in order to make rendering
decisions.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2062443002

Review-Url: https://codereview.chromium.org/2062443002

include/gpu/GrCaps.h
src/gpu/GrCaps.cpp
src/gpu/gl/GrGLCaps.cpp
src/gpu/gl/GrGLCaps.h
src/gpu/gl/GrGLGpu.cpp

index 9fe727c42540713786a825cdb59cb01136681bde..35e2c2ca302657a744cbb90af50afe8e08d66320 100644 (file)
@@ -158,6 +158,7 @@ public:
     bool oversizedStencilSupport() const { return fOversizedStencilSupport; }
     bool textureBarrierSupport() const { return fTextureBarrierSupport; }
     bool sampleLocationsSupport() const { return fSampleLocationsSupport; }
+    bool multisampleDisableSupport() const { return fMultisampleDisableSupport; }
     bool usesMixedSamples() const { return fUsesMixedSamples; }
 
     bool useDrawInsteadOfClear() const { return fUseDrawInsteadOfClear; }
@@ -294,6 +295,7 @@ protected:
     bool fOversizedStencilSupport                    : 1;
     bool fTextureBarrierSupport                      : 1;
     bool fSampleLocationsSupport                     : 1;
+    bool fMultisampleDisableSupport                  : 1;
     bool fUsesMixedSamples                           : 1;
     bool fSupportsInstancedDraws                     : 1;
     bool fFullClearIsFree                            : 1;
index b524e3ff11c21a598985a77033550c0588199224..a5e46de4b4136fabc327a566cb8dd0b7b6a2d217 100644 (file)
@@ -96,6 +96,7 @@ GrCaps::GrCaps(const GrContextOptions& options) {
     fOversizedStencilSupport = false;
     fTextureBarrierSupport = false;
     fSampleLocationsSupport = false;
+    fMultisampleDisableSupport = false;
     fUsesMixedSamples = false;
     fSupportsInstancedDraws = false;
     fFullClearIsFree = false;
@@ -173,6 +174,7 @@ SkString GrCaps::dump() const {
     r.appendf("Oversized Stencil Support          : %s\n", gNY[fOversizedStencilSupport]);
     r.appendf("Texture Barrier Support            : %s\n", gNY[fTextureBarrierSupport]);
     r.appendf("Sample Locations Support           : %s\n", gNY[fSampleLocationsSupport]);
+    r.appendf("Multisample disable support        : %s\n", gNY[fMultisampleDisableSupport]);
     r.appendf("Uses Mixed Samples                 : %s\n", gNY[fUsesMixedSamples]);
     r.appendf("Supports instanced draws           : %s\n", gNY[fSupportsInstancedDraws]);
     r.appendf("Full screen clear is free          : %s\n", gNY[fFullClearIsFree]);
index 7ca2bf9a47e13f58dbd379af152b8261e54a5289..5370f792c6beac6ae2fddb8760dfdc53610f5c08 100644 (file)
@@ -37,7 +37,6 @@ GrGLCaps::GrGLCaps(const GrContextOptions& contextOptions,
     fDirectStateAccessSupport = false;
     fDebugSupport = false;
     fES2CompatibilitySupport = false;
-    fMultisampleDisableSupport = false;
     fDrawIndirectSupport = false;
     fMultiDrawIndirectSupport = false;
     fBaseInstanceSupport = false;
@@ -1107,7 +1106,6 @@ SkString GrGLCaps::dump() const {
     r.appendf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ? "YES": "NO"));
     r.appendf("Direct state access support: %s\n", (fDirectStateAccessSupport ? "YES": "NO"));
     r.appendf("Debug support: %s\n", (fDebugSupport ? "YES": "NO"));
-    r.appendf("Multisample disable support: %s\n", (fMultisampleDisableSupport ? "YES" : "NO"));
     r.appendf("Draw indirect support: %s\n", (fDrawIndirectSupport ? "YES" : "NO"));
     r.appendf("Multi draw indirect support: %s\n", (fMultiDrawIndirectSupport ? "YES" : "NO"));
     r.appendf("Base instance support: %s\n", (fBaseInstanceSupport ? "YES" : "NO"));
index 58bf98c2d0b700570128cab2e0bf4db105678f83..0cb353aa9f78703654d17c3731027054b5e36a5a 100644 (file)
@@ -296,9 +296,6 @@ public:
     /// Is there support for ES2 compatability?
     bool ES2CompatibilitySupport() const { return fES2CompatibilitySupport; }
 
-    /// Can we call glDisable(GL_MULTISAMPLE)?
-    bool multisampleDisableSupport() const { return fMultisampleDisableSupport; }
-
     /// Is there support for glDraw*Indirect? Note that the baseInstance fields of indirect draw
     /// commands cannot be used unless we have base instance support.
     bool drawIndirectSupport() const { return fDrawIndirectSupport; }
@@ -398,7 +395,6 @@ private:
     bool fDirectStateAccessSupport : 1;
     bool fDebugSupport : 1;
     bool fES2CompatibilitySupport : 1;
-    bool fMultisampleDisableSupport : 1;
     bool fDrawIndirectSupport : 1;
     bool fMultiDrawIndirectSupport : 1;
     bool fBaseInstanceSupport : 1;
index 5d6b7ac2e78024997342950bcb12e349a7b04158..de60be6b06b3a43ef52aac00be60ba6177242148 100644 (file)
@@ -2991,7 +2991,7 @@ void GrGLGpu::flushHWAAState(GrRenderTarget* rt, bool useHWAA, bool stencilEnabl
     SkASSERT(rt || !useHWAA);
     SkASSERT(!useHWAA || rt->isStencilBufferMultisampled());
 
-    if (this->glCaps().multisampleDisableSupport()) {
+    if (this->caps()->multisampleDisableSupport()) {
         if (useHWAA) {
             if (kYes_TriState != fMSAAEnabled) {
                 GL_CALL(Enable(GR_GL_MULTISAMPLE));