diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-08-05 11:35:53 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-08-05 11:35:53 +0200 |
commit | 6bd66b1728eeddb058066edda740aaeb2ceaec23 (patch) | |
tree | 985faf01c526763515731569fa01a99f4dbef36e /gfx/gl | |
parent | e0a8dcfed131ffa58a5e2cb1d30fe48c745c2fdc (diff) | |
parent | 559824514dc95e02fbe81f1786e6ac13ee8e9d55 (diff) | |
download | UXP-6bd66b1728eeddb058066edda740aaeb2ceaec23.tar UXP-6bd66b1728eeddb058066edda740aaeb2ceaec23.tar.gz UXP-6bd66b1728eeddb058066edda740aaeb2ceaec23.tar.lz UXP-6bd66b1728eeddb058066edda740aaeb2ceaec23.tar.xz UXP-6bd66b1728eeddb058066edda740aaeb2ceaec23.zip |
Merge branch 'master' into js-modules
Diffstat (limited to 'gfx/gl')
-rw-r--r-- | gfx/gl/GLContext.h | 2 | ||||
-rw-r--r-- | gfx/gl/GLContextCGL.h | 2 | ||||
-rw-r--r-- | gfx/gl/GLContextEAGL.h | 2 | ||||
-rw-r--r-- | gfx/gl/GLContextEGL.h | 2 | ||||
-rw-r--r-- | gfx/gl/GLContextGLX.h | 2 | ||||
-rw-r--r-- | gfx/gl/GLContextProviderCGL.mm | 5 | ||||
-rw-r--r-- | gfx/gl/GLContextProviderEAGL.mm | 5 | ||||
-rw-r--r-- | gfx/gl/GLContextProviderEGL.cpp | 18 | ||||
-rw-r--r-- | gfx/gl/GLContextProviderGLX.cpp | 21 | ||||
-rw-r--r-- | gfx/gl/GLContextProviderWGL.cpp | 7 | ||||
-rw-r--r-- | gfx/gl/GLContextWGL.h | 2 |
11 files changed, 68 insertions, 0 deletions
diff --git a/gfx/gl/GLContext.h b/gfx/gl/GLContext.h index f20563070..c82efceda 100644 --- a/gfx/gl/GLContext.h +++ b/gfx/gl/GLContext.h @@ -221,6 +221,8 @@ public: return false; } + virtual void GetWSIInfo(nsCString* const out) const = 0; + /** * Return true if we are running on a OpenGL core profile context */ diff --git a/gfx/gl/GLContextCGL.h b/gfx/gl/GLContextCGL.h index 12da90aee..1a29f3d15 100644 --- a/gfx/gl/GLContextCGL.h +++ b/gfx/gl/GLContextCGL.h @@ -58,6 +58,8 @@ public: virtual bool SupportsRobustness() const override { return false; } virtual bool SwapBuffers() override; + + virtual void GetWSIInfo(nsCString* const out) const override; }; } // namespace gl diff --git a/gfx/gl/GLContextEAGL.h b/gfx/gl/GLContextEAGL.h index 86e9a5b98..df25d0f1e 100644 --- a/gfx/gl/GLContextEAGL.h +++ b/gfx/gl/GLContextEAGL.h @@ -55,6 +55,8 @@ public: virtual bool SwapBuffers() override; + virtual void GetWSIInfo(nsCString* const out) const override; + virtual GLuint GetDefaultFramebuffer() override { return mBackbufferFB; } diff --git a/gfx/gl/GLContextEGL.h b/gfx/gl/GLContextEGL.h index 9755ecfe7..64b9b13fb 100644 --- a/gfx/gl/GLContextEGL.h +++ b/gfx/gl/GLContextEGL.h @@ -89,6 +89,8 @@ public: virtual bool SwapBuffers() override; + virtual void GetWSIInfo(nsCString* const out) const override; + // hold a reference to the given surface // for the lifetime of this context. void HoldSurface(gfxASurface* aSurf); diff --git a/gfx/gl/GLContextGLX.h b/gfx/gl/GLContextGLX.h index ca476baec..1f2cee08d 100644 --- a/gfx/gl/GLContextGLX.h +++ b/gfx/gl/GLContextGLX.h @@ -59,6 +59,8 @@ public: virtual bool SwapBuffers() override; + virtual void GetWSIInfo(nsCString* const out) const override; + // Overrides the current GLXDrawable backing the context and makes the // context current. bool OverrideDrawable(GLXDrawable drawable); diff --git a/gfx/gl/GLContextProviderCGL.mm b/gfx/gl/GLContextProviderCGL.mm index 0b8add435..ceab3046c 100644 --- a/gfx/gl/GLContextProviderCGL.mm +++ b/gfx/gl/GLContextProviderCGL.mm @@ -166,6 +166,11 @@ GLContextCGL::SwapBuffers() return true; } +void +GLContextCGL::GetWSIInfo(nsCString* const out) const +{ + out->AppendLiteral("CGL"); +} already_AddRefed<GLContext> GLContextProviderCGL::CreateWrappingExisting(void*, void*) diff --git a/gfx/gl/GLContextProviderEAGL.mm b/gfx/gl/GLContextProviderEAGL.mm index 784a3e29e..507616e2f 100644 --- a/gfx/gl/GLContextProviderEAGL.mm +++ b/gfx/gl/GLContextProviderEAGL.mm @@ -155,6 +155,11 @@ GLContextEAGL::SwapBuffers() return true; } +void +GLContextEAGL::GetWSIInfo(nsCString* const out) const +{ + out->AppendLiteral("EAGL"); +} already_AddRefed<GLContext> GLContextProviderEAGL::CreateWrappingExisting(void*, void*) diff --git a/gfx/gl/GLContextProviderEGL.cpp b/gfx/gl/GLContextProviderEGL.cpp index 098662200..7979f3bf0 100644 --- a/gfx/gl/GLContextProviderEGL.cpp +++ b/gfx/gl/GLContextProviderEGL.cpp @@ -418,6 +418,24 @@ GLContextEGL::SwapBuffers() } } +void +GLContextEGL::GetWSIInfo(nsCString* const out) const +{ + out->AppendLiteral("EGL_VENDOR: "); + out->Append((const char*)sEGLLibrary.fQueryString(EGL_DISPLAY(), LOCAL_EGL_VENDOR)); + + out->AppendLiteral("\nEGL_VERSION: "); + out->Append((const char*)sEGLLibrary.fQueryString(EGL_DISPLAY(), LOCAL_EGL_VERSION)); + + out->AppendLiteral("\nEGL_EXTENSIONS: "); + out->Append((const char*)sEGLLibrary.fQueryString(EGL_DISPLAY(), LOCAL_EGL_EXTENSIONS)); + +#ifndef ANDROID // This query will crash some old android. + out->AppendLiteral("\nEGL_EXTENSIONS(nullptr): "); + out->Append((const char*)sEGLLibrary.fQueryString(nullptr, LOCAL_EGL_EXTENSIONS)); +#endif +} + // hold a reference to the given surface // for the lifetime of this context. void diff --git a/gfx/gl/GLContextProviderGLX.cpp b/gfx/gl/GLContextProviderGLX.cpp index d804f95af..5560357e1 100644 --- a/gfx/gl/GLContextProviderGLX.cpp +++ b/gfx/gl/GLContextProviderGLX.cpp @@ -994,6 +994,27 @@ GLContextGLX::SwapBuffers() return true; } +void +GLContextGLX::GetWSIInfo(nsCString* const out) const +{ + Display* display = DefaultXDisplay(); + int screen = DefaultScreen(display); + + int majorVersion, minorVersion; + sGLXLibrary.xQueryVersion(display, &majorVersion, &minorVersion); + + out->Append(nsPrintfCString("GLX %u.%u", majorVersion, minorVersion)); + + out->AppendLiteral("\nGLX_VENDOR(client): "); + out->Append(sGLXLibrary.xGetClientString(display, LOCAL_GLX_VENDOR)); + + out->AppendLiteral("\nGLX_VENDOR(server): "); + out->Append(sGLXLibrary.xQueryServerString(display, screen, LOCAL_GLX_VENDOR)); + + out->AppendLiteral("\nExtensions: "); + out->Append(sGLXLibrary.xQueryExtensionsString(display, screen)); +} + bool GLContextGLX::OverrideDrawable(GLXDrawable drawable) { diff --git a/gfx/gl/GLContextProviderWGL.cpp b/gfx/gl/GLContextProviderWGL.cpp index c9c3f0a54..35957259d 100644 --- a/gfx/gl/GLContextProviderWGL.cpp +++ b/gfx/gl/GLContextProviderWGL.cpp @@ -373,6 +373,13 @@ GLContextWGL::SwapBuffers() { return ::SwapBuffers(mDC); } +void +GLContextWGL::GetWSIInfo(nsCString* const out) const +{ + out->AppendLiteral("wglGetExtensionsString: "); + out->Append(sWGLLib.fGetExtensionsString(mDC)); +} + bool GLContextWGL::SetupLookupFunction() { diff --git a/gfx/gl/GLContextWGL.h b/gfx/gl/GLContextWGL.h index 9d270bf52..839b10aa7 100644 --- a/gfx/gl/GLContextWGL.h +++ b/gfx/gl/GLContextWGL.h @@ -57,6 +57,8 @@ public: virtual bool SwapBuffers() override; + virtual void GetWSIInfo(nsCString* const out) const override; + virtual bool SetupLookupFunction() override; HGLRC Context() { return mContext; } |