diff --git a/gfx/thebes/GLContext.cpp b/gfx/thebes/GLContext.cpp index 0d11d01d78e2..24c29e21e8a1 100644 --- a/gfx/thebes/GLContext.cpp +++ b/gfx/thebes/GLContext.cpp @@ -389,6 +389,18 @@ GLContext::InitWithPrefix(const char *prefix, bool trygl) mInitialized = false; } } + + if (IsExtensionSupported(GLContext::ANGLE_framebuffer_multisample) || + IsExtensionSupported(GLContext::EXT_framebuffer_multisample)) { + SymLoadStruct auxSymbols[] = { + { (PRFuncPtr*) &mSymbols.fRenderbufferStorageMultisample, { "RenderbufferStorageMultisample", "RenderbufferStorageMultisampleEXT", "RenderbufferStorageMultisampleANGLE", NULL } }, + { NULL, { NULL } }, + }; + if (!LoadSymbols(&auxSymbols[0], trygl, prefix)) { + NS_RUNTIMEABORT("GL supports framebuffer_multisample without supplying glRenderbufferStorageMultisample"); + mInitialized = false; + } + } } if (mInitialized) { @@ -455,6 +467,8 @@ static const char *sExtensionNames[] = { "GL_OES_standard_derivatives", "GL_EXT_framebuffer_blit", "GL_ANGLE_framebuffer_blit", + "GL_EXT_framebuffer_multisample", + "GL_ANGLE_framebuffer_multisample", NULL }; diff --git a/gfx/thebes/GLContext.h b/gfx/thebes/GLContext.h index 3a0a53b7bbe1..77244e9f3289 100644 --- a/gfx/thebes/GLContext.h +++ b/gfx/thebes/GLContext.h @@ -792,6 +792,10 @@ public: return mOffscreenTexture; } + virtual bool SupportsFramebufferMultisample() { + return IsExtensionSupported(EXT_framebuffer_multisample) || IsExtensionSupported(ANGLE_framebuffer_multisample); + } + virtual bool SupportsOffscreenSplit() { return IsExtensionSupported(EXT_framebuffer_blit) || IsExtensionSupported(ANGLE_framebuffer_blit); } @@ -1234,6 +1238,8 @@ public: OES_standard_derivatives, EXT_framebuffer_blit, ANGLE_framebuffer_blit, + EXT_framebuffer_multisample, + ANGLE_framebuffer_multisample, Extensions_Max }; @@ -2333,6 +2339,12 @@ public: AFTER_GL_CALL; } + void fRenderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height) { + BEFORE_GL_CALL; + mSymbols.fRenderbufferStorageMultisample(target, samples, internalFormat, width, height); + AFTER_GL_CALL; + } + void fDepthRange(GLclampf a, GLclampf b) { BEFORE_GL_CALL; if (mIsGLES2) { diff --git a/gfx/thebes/GLContextSymbols.h b/gfx/thebes/GLContextSymbols.h index 9b5373b75de6..77af7297ac85 100644 --- a/gfx/thebes/GLContextSymbols.h +++ b/gfx/thebes/GLContextSymbols.h @@ -309,6 +309,8 @@ struct GLContextSymbols typedef void (GLAPIENTRY * PFNGLBLITFRAMEBUFFER) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); PFNGLBLITFRAMEBUFFER fBlitFramebuffer; + typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLE) (GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height); + PFNGLRENDERBUFFERSTORAGEMULTISAMPLE fRenderbufferStorageMultisample; /* These are different between GLES2 and desktop GL; we hide those differences, use the GL