Move multisampleDisableSupport into GrCaps

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
This commit is contained in:
csmartdalton 2016-06-10 14:06:32 -07:00 committed by Commit bot
parent f10637f279
commit 2b5f2cbf0d
5 changed files with 5 additions and 7 deletions

View 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;

View 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]);

View 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"));

View 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;

View 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));