Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(308)

Unified Diff: src/gpu/gl/GrGLGpu.cpp

Issue 1533903004: Remove GrGLGpu::configToGLFormats (Closed) Base URL: https://skia.googlesource.com/skia.git@rmc2glcalls
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/gl/GrGLGpu.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « src/gpu/gl/GrGLGpu.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698