Chromium Code Reviews| Index: src/gpu/gl/GrGpuGL.cpp |
| =================================================================== |
| --- src/gpu/gl/GrGpuGL.cpp (revision 8907) |
| +++ src/gpu/gl/GrGpuGL.cpp (working copy) |
| @@ -781,6 +781,10 @@ |
| GrGLenum msColorFormat = 0; // suppress warning |
|
robertphillips
2013/05/01 15:36:55
Is there an extra space after the &&?
bsalomon
2013/05/03 13:30:53
Done.
|
| + if (desc->fSampleCnt > 0 && GrGLCaps::kNone_MSFBOType == this->glCaps().msFBOType()) { |
| + goto FAILED; |
| + } |
| + |
| GL_CALL(GenFramebuffers(1, &desc->fTexFBOID)); |
| if (!desc->fTexFBOID) { |
| goto FAILED; |
| @@ -791,18 +795,15 @@ |
| // 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 |
| // rendered from. |
| - if (desc->fSampleCnt > 0 && GrGLCaps::kImaginationES_MSFBOType != this->glCaps().msFBOType()) { |
| - if (GrGLCaps::kNone_MSFBOType == this->glCaps().msFBOType()) { |
| - goto FAILED; |
| - } |
| + if (desc->fSampleCnt > 0 && this->glCaps().usesMSAARenderBuffers()) { |
| GL_CALL(GenFramebuffers(1, &desc->fRTFBOID)); |
| GL_CALL(GenRenderbuffers(1, &desc->fMSColorRenderbufferID)); |
| if (!desc->fRTFBOID || |
| !desc->fMSColorRenderbufferID || |
| !this->configToGLFormats(desc->fConfig, |
|
robertphillips
2013/05/01 15:36:55
What's up with this indentation?
bsalomon
2013/05/03 13:30:53
Done.
|
| - // GLES requires sized internal formats |
| - kES2_GrGLBinding == this->glBinding(), |
| - &msColorFormat, NULL, NULL)) { |
| + // GLES requires sized internal formats |
| + kES2_GrGLBinding == this->glBinding(), |
| + &msColorFormat, NULL, NULL)) { |
| goto FAILED; |
| } |
| } else { |
| @@ -836,7 +837,7 @@ |
| } |
| GL_CALL(BindFramebuffer(GR_GL_FRAMEBUFFER, desc->fTexFBOID)); |
| - if (GrGLCaps::kImaginationES_MSFBOType == this->glCaps().msFBOType() && desc->fSampleCnt > 0) { |
| + if (this->glCaps().usesImplicitMSAAResolve() && desc->fSampleCnt > 0) { |
| GL_CALL(FramebufferTexture2DMultisample(GR_GL_FRAMEBUFFER, |
| GR_GL_COLOR_ATTACHMENT0, |
| GR_GL_TEXTURE_2D, |
| @@ -1681,9 +1682,8 @@ |
| void GrGpuGL::onResolveRenderTarget(GrRenderTarget* target) { |
| GrGLRenderTarget* rt = static_cast<GrGLRenderTarget*>(target); |
| if (rt->needsResolve()) { |
| - // The IMG extension automatically resolves the texture when it is read. |
| - if (GrGLCaps::kImaginationES_MSFBOType != this->glCaps().msFBOType()) { |
| - GrAssert(GrGLCaps::kNone_MSFBOType != this->glCaps().msFBOType()); |
| + // Some extensions automatically resolves the texture when it is read. |
| + if (this->glCaps().usesMSAARenderBuffers()) { |
| GrAssert(rt->textureFBOID() != rt->renderFBOID()); |
| GL_CALL(BindFramebuffer(GR_GL_READ_FRAMEBUFFER, rt->renderFBOID())); |
| GL_CALL(BindFramebuffer(GR_GL_DRAW_FRAMEBUFFER, rt->textureFBOID())); |
| @@ -1697,7 +1697,7 @@ |
| dirtyRect.width(), dirtyRect.height(), target->origin()); |
| GrAutoTRestore<ScissorState> asr; |
| - if (GrGLCaps::kAppleES_MSFBOType == this->glCaps().msFBOType()) { |
| + if (GrGLCaps::kES_Apple_MSFBOType == this->glCaps().msFBOType()) { |
| // Apple's extension uses the scissor as the blit bounds. |
| asr.reset(&fScissorState); |
| fScissorState.fEnabled = true; |
| @@ -1705,9 +1705,8 @@ |
| this->flushScissor(); |
| GL_CALL(ResolveMultisampleFramebuffer()); |
| } else { |
| - if (GrGLCaps::kDesktopARB_MSFBOType != this->glCaps().msFBOType()) { |
| + if (GrGLCaps::kDesktop_EXT_MSFBOType == this->glCaps().msFBOType()) { |
| // this respects the scissor during the blit, so disable it. |
| - GrAssert(GrGLCaps::kDesktopEXT_MSFBOType == this->glCaps().msFBOType()); |
| asr.reset(&fScissorState); |
| fScissorState.fEnabled = false; |
| this->flushScissor(); |
| @@ -2233,9 +2232,9 @@ |
| const GrSurface* src, |
| const GrGpuGL* gpu, |
| bool* wouldNeedTempFBO = NULL) { |
| - if (gpu->isConfigRenderable(dst->config()) && gpu->isConfigRenderable(src->config()) && |
| - (GrGLCaps::kDesktopEXT_MSFBOType == gpu->glCaps().msFBOType() || |
| - GrGLCaps::kDesktopARB_MSFBOType == gpu->glCaps().msFBOType())) { |
| + if (gpu->isConfigRenderable(dst->config()) && |
| + gpu->isConfigRenderable(src->config()) && |
| + gpu->glCaps().usesMSAARenderBuffers()) { |
| if (NULL != wouldNeedTempFBO) { |
| *wouldNeedTempFBO = NULL == dst->asRenderTarget() || NULL == src->asRenderTarget(); |
| } |
| @@ -2411,7 +2410,7 @@ |
| dst->origin()); |
| GrAutoTRestore<ScissorState> asr; |
| - if (GrGLCaps::kDesktopEXT_MSFBOType == this->glCaps().msFBOType()) { |
| + if (GrGLCaps::kDesktop_EXT_MSFBOType == this->glCaps().msFBOType()) { |
| // The EXT version applies the scissor during the blit, so disable it. |
| asr.reset(&fScissorState); |
| fScissorState.fEnabled = false; |