summaryrefslogtreecommitdiffstats
path: root/gfx/gl
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-08-01 08:58:59 +0200
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-08-01 08:58:59 +0200
commite7f7100ba6759f30295dbc49f819ebb9c4785298 (patch)
tree939f31b2484c41ec415e9eb56aee1c2934752e65 /gfx/gl
parentddb2b976802181e05cb37a94480e9fb42ae6708a (diff)
downloadUXP-e7f7100ba6759f30295dbc49f819ebb9c4785298.tar
UXP-e7f7100ba6759f30295dbc49f819ebb9c4785298.tar.gz
UXP-e7f7100ba6759f30295dbc49f819ebb9c4785298.tar.lz
UXP-e7f7100ba6759f30295dbc49f819ebb9c4785298.tar.xz
UXP-e7f7100ba6759f30295dbc49f819ebb9c4785298.zip
Bug 1335296 - Expand about:support WebGL information
Diffstat (limited to 'gfx/gl')
-rw-r--r--gfx/gl/GLContext.h2
-rw-r--r--gfx/gl/GLContextCGL.h2
-rw-r--r--gfx/gl/GLContextEAGL.h2
-rw-r--r--gfx/gl/GLContextEGL.h2
-rw-r--r--gfx/gl/GLContextGLX.h2
-rw-r--r--gfx/gl/GLContextProviderCGL.mm5
-rw-r--r--gfx/gl/GLContextProviderEAGL.mm5
-rw-r--r--gfx/gl/GLContextProviderEGL.cpp18
-rw-r--r--gfx/gl/GLContextProviderGLX.cpp21
-rw-r--r--gfx/gl/GLContextProviderWGL.cpp7
-rw-r--r--gfx/gl/GLContextWGL.h2
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; }