Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(517)

Unified Diff: ui/gl/gl_context_glx.cc

Issue 10957009: Get real GPU memory values on NV+Linux and OS X (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix GLX build Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« ui/gl/gl_context_cgl.cc ('K') | « ui/gl/gl_context_glx.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_context_glx.cc
diff --git a/ui/gl/gl_context_glx.cc b/ui/gl/gl_context_glx.cc
index d05264485e1a0d70fc015b66b00e218096dc8c33..51c32870a0c471a368ac1272e375ed6bca7ee43b 100644
--- a/ui/gl/gl_context_glx.cc
+++ b/ui/gl/gl_context_glx.cc
@@ -244,6 +244,17 @@ std::string GLContextGLX::GetExtensions() {
return GLContext::GetExtensions();
}
+bool GLContextGLX::GetTotalGpuMemory(size_t& bytes) {
+ bytes = 0;
+ if (HasExtension("GL_NVX_gpu_memory_info")) {
+ GLint kbytes = 0;
+ glGetIntegerv(GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX, &kbytes);
+ bytes = 1024*kbytes;
+ return true;
+ }
+ return false;
+}
+
bool GLContextGLX::WasAllocatedUsingRobustnessExtension() {
return GLSurfaceGLX::IsCreateContextRobustnessSupported();
}
« ui/gl/gl_context_cgl.cc ('K') | « ui/gl/gl_context_glx.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698