summaryrefslogtreecommitdiff
path: root/gfx
diff options
context:
space:
mode:
Diffstat (limited to 'gfx')
-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 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; }