Index: src/gpu/gl/GrGLGpu.cpp |
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp |
index aff40ccc85a4627071927037b3bd48e053987f74..ea54d1e64dc8a2997dbb4e94bb04ece6c5a56bf3 100644 |
--- a/src/gpu/gl/GrGLGpu.cpp |
+++ b/src/gpu/gl/GrGLGpu.cpp |
@@ -301,6 +301,7 @@ void GrGLGpu::onResetContext(uint32_t resetBits) { |
if (resetBits & kMSAAEnable_GrGLBackendState) { |
fMSAAEnabled = kUnknown_TriState; |
+ fCoverageModulationEnabled = kUnknown_TriState; |
} |
fHWActiveTextureUnitIdx = -1; // invalid |
@@ -435,6 +436,8 @@ GrRenderTarget* GrGLGpu::onWrapBackendRenderTarget(const GrBackendRenderTargetDe |
idDesc.fRTFBOID = static_cast<GrGLuint>(wrapDesc.fRenderTargetHandle); |
idDesc.fMSColorRenderbufferID = 0; |
idDesc.fTexFBOID = GrGLRenderTarget::kUnresolvableFBOID; |
+ idDesc.fSampleConfig = (wrapDesc.fFlags & kStencilMSAAOnly_GrBackendRenderTargetFlags) ? |
+ GrRenderTarget::kStencil_SampleConfig : GrRenderTarget::kUnified_SampleConfig; |
Chris Dalton
2015/04/07 23:48:23
Looks like we broke 100 columns...
vbuzinov
2015/04/08 12:05:30
Done.
|
idDesc.fLifeCycle = GrGpuResource::kWrapped_LifeCycle; |
GrSurfaceDesc desc; |
@@ -782,6 +785,7 @@ static bool renderbuffer_storage_msaa(GrGLContext& ctx, |
switch (ctx.caps()->msFBOType()) { |
case GrGLCaps::kDesktop_ARB_MSFBOType: |
case GrGLCaps::kDesktop_EXT_MSFBOType: |
+ case GrGLCaps::kMixedSamples_MSFBOType: |
case GrGLCaps::kES_3_0_MSFBOType: |
GL_ALLOC_CALL(ctx.interface(), |
RenderbufferStorageMultisample(GR_GL_RENDERBUFFER, |
@@ -818,6 +822,9 @@ bool GrGLGpu::createRenderTargetObjects(const GrSurfaceDesc& desc, bool budgeted |
idDesc->fTexFBOID = 0; |
idDesc->fLifeCycle = budgeted ? GrGpuResource::kCached_LifeCycle : |
GrGpuResource::kUncached_LifeCycle; |
+ idDesc->fSampleConfig = GrGLCaps::kMixedSamples_MSFBOType == |
+ this->glCaps().msFBOType() ? GrRenderTarget::kStencil_SampleConfig : |
+ GrRenderTarget::kUnified_SampleConfig; |
GrGLenum status; |
@@ -1139,7 +1146,7 @@ bool GrGLGpu::createStencilBufferForRenderTarget(GrRenderTarget* rt, int width, |
SkASSERT(width >= rt->width()); |
SkASSERT(height >= rt->height()); |
- int samples = rt->numSamples(); |
+ int samples = rt->numSamples(GrRenderTarget::BufferBits::kStencil_BufferBit); |
GrGLStencilBuffer::IDDesc sbDesc; |
int stencilFmtCnt = this->glCaps().stencilFormats().count(); |
@@ -2096,9 +2103,10 @@ void GrGLGpu::flushStencil(const GrStencilSettings& stencilSettings) { |
} |
void GrGLGpu::flushHWAAState(GrRenderTarget* rt, bool useHWAA) { |
- SkASSERT(!useHWAA || rt->isMultisampled()); |
+ SkASSERT(!useHWAA || rt->isMultisampled(GrRenderTarget::BufferBits::kAny_BufferBits)); |
- if (kGL_GrGLStandard == this->glStandard()) { |
+ if (kGL_GrGLStandard == this->glStandard() || |
+ this->glCaps().fbMixedSamplesSupport()) { |
if (useHWAA) { |
if (kYes_TriState != fMSAAEnabled) { |
GL_CALL(Enable(GR_GL_MULTISAMPLE)); |
Mark Kilgard
2015/04/08 03:20:09
warning: enabling/disabling GL_MULTISAMPLE is not
vbuzinov
2015/04/08 12:05:30
Doesn't look like there was an explicit check for
|
@@ -2111,6 +2119,19 @@ void GrGLGpu::flushHWAAState(GrRenderTarget* rt, bool useHWAA) { |
} |
} |
} |
+ if (this->glCaps().fbMixedSamplesSupport()) { |
+ if (useHWAA && GrRenderTarget::kStencil_SampleConfig == rt->sampleConfig()) { |
+ if (kYes_TriState != fCoverageModulationEnabled) { |
Mark Kilgard
2015/04/08 03:20:09
...technically this mode isn't an enable though Sk
|
+ GL_CALL(CoverageModulation(GR_GL_RGBA)); |
+ fCoverageModulationEnabled = kYes_TriState; |
+ } |
+ } else { |
+ if (kNo_TriState != fCoverageModulationEnabled) { |
+ GL_CALL(CoverageModulation(GR_GL_NONE)); |
+ fCoverageModulationEnabled = kNo_TriState; |
+ } |
+ } |
+ } |
} |
void GrGLGpu::flushBlend(const GrXferProcessor::BlendInfo& blendInfo) { |