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

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: Incorporate review feedback 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
« no previous file with comments | « ui/gl/gl_context_glx.h ('k') | ui/gl/gl_context_mac.mm » ('j') | 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..dc8226b4b50eb224baba5eb5603a150f18eb79a1 100644
--- a/ui/gl/gl_context_glx.cc
+++ b/ui/gl/gl_context_glx.cc
@@ -244,6 +244,18 @@ std::string GLContextGLX::GetExtensions() {
return GLContext::GetExtensions();
}
+bool GLContextGLX::GetTotalGpuMemory(size_t* bytes) {
+ DCHECK(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();
}
« no previous file with comments | « ui/gl/gl_context_glx.h ('k') | ui/gl/gl_context_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698