| Index: src/gpu/gl/GrGLGpu.cpp
|
| diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
|
| index 0793d7b0475079cdbb5615b1d89bc7dbbe8d5172..ccaed03a46f97b110cdceb9eda94dfcc8df777c6 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,7 @@ GrRenderTarget* GrGLGpu::onWrapBackendRenderTarget(const GrBackendRenderTargetDe
|
| idDesc.fRTFBOID = static_cast<GrGLuint>(wrapDesc.fRenderTargetHandle);
|
| idDesc.fMSColorRenderbufferID = 0;
|
| idDesc.fTexFBOID = GrGLRenderTarget::kUnresolvableFBOID;
|
| + idDesc.fSampleConfig = wrapDesc.fSampleConfig;
|
| idDesc.fLifeCycle = GrGpuResource::kWrapped_LifeCycle;
|
|
|
| GrSurfaceDesc desc;
|
| @@ -782,6 +784,7 @@ static bool renderbuffer_storage_msaa(GrGLContext& ctx,
|
| switch (ctx.caps()->msFBOType()) {
|
| case GrGLCaps::kDesktop_ARB_MSFBOType:
|
| case GrGLCaps::kDesktop_EXT_MSFBOType:
|
| + case GrGLCaps::kStencil_MSFBOType:
|
| case GrGLCaps::kES_3_0_MSFBOType:
|
| GL_ALLOC_CALL(ctx.interface(),
|
| RenderbufferStorageMultisample(GR_GL_RENDERBUFFER,
|
| @@ -818,6 +821,9 @@ bool GrGLGpu::createRenderTargetObjects(const GrSurfaceDesc& desc, bool budgeted
|
| idDesc->fTexFBOID = 0;
|
| idDesc->fLifeCycle = budgeted ? GrGpuResource::kCached_LifeCycle :
|
| GrGpuResource::kUncached_LifeCycle;
|
| + idDesc->fSampleConfig = GrGLCaps::kStencil_MSFBOType ==
|
| + this->glCaps().msFBOType() ? kStencil_GrSampleConfig :
|
| + kUnified_GrSampleConfig;
|
|
|
| GrGLenum status;
|
|
|
| @@ -1139,7 +1145,7 @@ bool GrGLGpu::createStencilBufferForRenderTarget(GrRenderTarget* rt, int width,
|
| SkASSERT(width >= rt->width());
|
| SkASSERT(height >= rt->height());
|
|
|
| - int samples = rt->numSamples();
|
| + int samples = rt->numSamples(kStencilBuffer_GrPipelineStage);
|
| GrGLStencilBuffer::IDDesc sbDesc;
|
|
|
| int stencilFmtCnt = this->glCaps().stencilFormats().count();
|
| @@ -2076,9 +2082,10 @@ void GrGLGpu::flushStencil(const GrStencilSettings& stencilSettings) {
|
| }
|
|
|
| void GrGLGpu::flushHWAAState(GrRenderTarget* rt, bool useHWAA) {
|
| - SkASSERT(!useHWAA || rt->isMultisampled());
|
| + SkASSERT(!useHWAA || rt->isMultisampled(kAnywhere_GrPipelineStage));
|
|
|
| - 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));
|
| @@ -2091,6 +2098,19 @@ void GrGLGpu::flushHWAAState(GrRenderTarget* rt, bool useHWAA) {
|
| }
|
| }
|
| }
|
| + if (this->glCaps().fbMixedSamplesSupport()) {
|
| + if (useHWAA && kStencil_GrSampleConfig == rt->sampleConfig()) {
|
| + if (kYes_TriState != fCoverageModulationEnabled) {
|
| + 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) {
|
|
|