Chromium Code Reviews| Index: src/gpu/gl/GrGLGpu.cpp |
| diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp |
| index b7901400fbd68c132c4b448e20874b9bb64ba291..f819117377397bb9e7d4e9d960cddcc5110f216e 100644 |
| --- a/src/gpu/gl/GrGLGpu.cpp |
| +++ b/src/gpu/gl/GrGLGpu.cpp |
| @@ -350,6 +350,9 @@ void GrGLGpu::onResetContext(uint32_t resetBits) { |
| if (this->caps()->pathRenderingSupport()) { |
| this->glPathRendering()->resetContext(); |
| } |
| + if (this->glCaps().fbMixedSamplesSupport()) { |
| + GL_CALL(CoverageModulation(GR_GL_RGBA)); |
|
Chris Dalton
2015/03/12 07:43:35
Let's verify there isn't a performance penalty to
Chris Dalton
2015/03/12 08:04:52
One more thing:
The coverage modulation we use ma
vbuzinov
2015/03/13 13:37:22
1-Done. 2-Not done
|
| + } |
| } |
| // we assume these values |
| @@ -447,6 +450,7 @@ GrRenderTarget* GrGLGpu::onWrapBackendRenderTarget(const GrBackendRenderTargetDe |
| GrGLuint fboID = static_cast<GrGLuint>(wrapDesc.fRenderTargetHandle); |
| idDesc.fRenderFBO.reset(SkNEW_ARGS(GrGLFBO, (fboID))); |
| idDesc.fMSColorRenderbufferID = 0; |
| + idDesc.fSampleConfig = wrapDesc.fSampleConfig; |
| idDesc.fLifeCycle = GrGpuResource::kWrapped_LifeCycle; |
| GrSurfaceDesc desc; |
| @@ -794,6 +798,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, |
| @@ -828,6 +833,9 @@ bool GrGLGpu::createRenderTargetObjects(const GrSurfaceDesc& desc, bool budgeted |
| idDesc->fMSColorRenderbufferID = 0; |
| idDesc->fLifeCycle = budgeted ? GrGpuResource::kCached_LifeCycle : |
| GrGpuResource::kUncached_LifeCycle; |
| + idDesc->fSampleConfig = GrGLCaps::kStencil_MSFBOType == |
| + this->glCaps().msFBOType() ? kStencil_GrSampleConfig : |
| + kUnified_GrSampleConfig; |
| GrGLenum status; |
| @@ -1147,7 +1155,7 @@ bool GrGLGpu::createStencilBufferForRenderTarget(GrRenderTarget* rt, int width, |
| SkASSERT(width >= rt->width()); |
| SkASSERT(height >= rt->height()); |
| - int samples = rt->numSamples(); |
| + int samples = rt->numSamples(kStencil_GrSampleConfig); |
| GrGLStencilBuffer::IDDesc sbDesc; |
| int stencilFmtCnt = this->glCaps().stencilFormats().count(); |
| @@ -2101,7 +2109,7 @@ void GrGLGpu::flushHWAAState(GrRenderTarget* rt, bool useHWAA, bool isLineDraw) |
| // Replace RT_HAS_MSAA with this definition once this driver bug is no longer a relevant concern |
| #define RT_HAS_MSAA rt->isMultisampled() |
| #else |
| - #define RT_HAS_MSAA (rt->isMultisampled() || isLineDraw) |
| + #define RT_HAS_MSAA (rt->isMultisampled(kStencil_GrSampleConfig) || isLineDraw) |
|
Chris Dalton
2015/03/12 07:43:35
This feels awkward to check the stencil. Ideally t
|
| #endif |
| if (kGL_GrGLStandard == this->glStandard()) { |