diff options
author | bsalomon <bsalomon@google.com> | 2015-12-18 07:59:41 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-12-18 07:59:42 -0800 |
commit | a11e5fce33f8d6f38c3324d639ca76ddf12598ba (patch) | |
tree | fca42586d036e88acfc0ad3f45a6647e12b8e539 /src/gpu/gl/GrGLGpu.cpp | |
parent | a2b6fdd10237386d1f1ad1fb32a95a933903f887 (diff) |
Remove GrGLGpu::configToGLFormats
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1533903004
Review URL: https://codereview.chromium.org/1533903004
Diffstat (limited to 'src/gpu/gl/GrGLGpu.cpp')
-rw-r--r-- | src/gpu/gl/GrGLGpu.cpp | 45 |
1 files changed, 9 insertions, 36 deletions
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp index ecb576f0c5..f3d7ae3b9b 100644 --- a/src/gpu/gl/GrGLGpu.cpp +++ b/src/gpu/gl/GrGLGpu.cpp @@ -913,7 +913,7 @@ bool GrGLGpu::createRenderTargetObjects(const GrSurfaceDesc& desc, GrGLenum status; - GrGLenum msColorFormat = 0; // suppress warning + GrGLenum colorRenderbufferFormat = 0; // suppress warning if (desc.fSampleCnt > 0 && GrGLCaps::kNone_MSFBOType == this->glCaps().msFBOType()) { goto FAILED; @@ -924,7 +924,6 @@ bool GrGLGpu::createRenderTargetObjects(const GrSurfaceDesc& desc, goto FAILED; } - // 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 // extension the texture is multisampled when rendered to and then auto-resolves it when it is @@ -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) { |