Chromium Code Reviews| Index: src/gpu/gl/GrGLGpu.cpp |
| diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp |
| index ecb576f0c5578ea8d99e170e26d46fece00b6844..9d9569ed677f536037db5b7abbb1532925355064 100644 |
| --- a/src/gpu/gl/GrGLGpu.cpp |
| +++ b/src/gpu/gl/GrGLGpu.cpp |
| @@ -913,8 +913,6 @@ bool GrGLGpu::createRenderTargetObjects(const GrSurfaceDesc& desc, |
| GrGLenum status; |
| - GrGLenum msColorFormat = 0; // suppress warning |
| - |
| if (desc.fSampleCnt > 0 && GrGLCaps::kNone_MSFBOType == this->glCaps().msFBOType()) { |
| goto FAILED; |
| } |
| @@ -924,6 +922,7 @@ bool GrGLGpu::createRenderTargetObjects(const GrSurfaceDesc& desc, |
| goto FAILED; |
| } |
| + GrGLenum colorRenderbufferFormat = 0; // suppress warning |
|
jvanverth1
2015/12/18 15:20:43
Putting this back where it was will fix the compil
bsalomon
2015/12/18 15:25:27
ah.. windows doesn't mind the goto past this init.
|
| // If we are using multisampling we will create two FBOS. We render to one and then resolve to |
| // the texture bound to the other. The exception is the IMG multisample extension. With this |
| @@ -933,15 +932,15 @@ bool GrGLGpu::createRenderTargetObjects(const GrSurfaceDesc& desc, |
| GL_CALL(GenFramebuffers(1, &idDesc->fRTFBOID)); |
| GL_CALL(GenRenderbuffers(1, &idDesc->fMSColorRenderbufferID)); |
| if (!idDesc->fRTFBOID || |
| - !idDesc->fMSColorRenderbufferID || |
| - !this->configToGLFormats(desc.fConfig, |
| - // ES2 and ES3 require sized internal formats for rb storage. |
| - kGLES_GrGLStandard == this->glStandard(), |
| - &msColorFormat, |
| - nullptr, |
| - nullptr)) { |
| + !idDesc->fMSColorRenderbufferID) { |
| goto FAILED; |
| } |
| + // All ES versions (thus far) require sized internal formats for render buffers. |
| + // TODO: Always use sized internal format? |
| + // If this rule gets more complicated, add a field to ConfigEntry rather than logic here. |
| + colorRenderbufferFormat = kGLES_GrGLStandard == this->glStandard() ? |
| + fConfigTable[desc.fConfig].fSizedInternalFormat : |
| + fConfigTable[desc.fConfig].fBaseInternalFormat; |
| } else { |
| idDesc->fRTFBOID = idDesc->fTexFBOID; |
| } |
| @@ -953,7 +952,7 @@ bool GrGLGpu::createRenderTargetObjects(const GrSurfaceDesc& desc, |
| GL_CALL(BindRenderbuffer(GR_GL_RENDERBUFFER, idDesc->fMSColorRenderbufferID)); |
| if (!renderbuffer_storage_msaa(*fGLContext, |
| desc.fSampleCnt, |
| - msColorFormat, |
| + colorRenderbufferFormat, |
| desc.fWidth, desc.fHeight)) { |
| goto FAILED; |
| } |
| @@ -2755,32 +2754,6 @@ void GrGLGpu::generateConfigTable() { |
| #endif |
| } |
| -bool GrGLGpu::configToGLFormats(GrPixelConfig config, |
| - bool getSizedInternalFormat, |
| - GrGLenum* internalFormat, |
| - GrGLenum* externalFormat, |
| - GrGLenum* externalType) const { |
| - if(!this->glCaps().isConfigTexturable(config)) { |
| - return false; |
| - } |
| - |
| - if (nullptr != internalFormat) { |
| - if (getSizedInternalFormat) { |
| - *internalFormat = fConfigTable[config].fSizedInternalFormat; |
| - } else { |
| - *internalFormat = fConfigTable[config].fBaseInternalFormat; |
| - } |
| - } |
| - if (nullptr != externalFormat) { |
| - *externalFormat = fConfigTable[config].fExternalFormat; |
| - } |
| - if (nullptr != externalType) { |
| - *externalType = fConfigTable[config].fExternalType; |
| - } |
| - |
| - return true; |
| -} |
| - |
| void GrGLGpu::setTextureUnit(int unit) { |
| SkASSERT(unit >= 0 && unit < fHWBoundTextureUniqueIDs.count()); |
| if (unit != fHWActiveTextureUnitIdx) { |