diff options
author | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-08-01 08:58:59 +0200 |
---|---|---|
committer | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-08-01 08:58:59 +0200 |
commit | 0d315d5c02260ff04fd2eccaabcad49e501679fb (patch) | |
tree | 939f31b2484c41ec415e9eb56aee1c2934752e65 /gfx | |
parent | afb56291d998171913afa6e1305c020bfecefdd1 (diff) | |
download | uxp-0d315d5c02260ff04fd2eccaabcad49e501679fb.tar.gz |
Bug 1335296 - Expand about:support WebGL information
Diffstat (limited to 'gfx')
-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 f205630705..c82efcedaf 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 12da90aeed..1a29f3d155 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 86e9a5b98b..df25d0f1e5 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 9755ecfe79..64b9b13fbe 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 ca476baec0..1f2cee08da 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 0b8add435a..ceab3046cb 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 784a3e29e0..507616e2fa 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 098662200d..7979f3bf0b 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 d804f95aff..5560357e11 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 c9c3f0a54d..35957259de 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 9d270bf52d..839b10aa78 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; } |