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

Side by Side Diff: ui/gl/gl_context.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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <string> 5 #include <string>
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/threading/thread_local.h" 10 #include "base/threading/thread_local.h"
(...skipping 17 matching lines...) Expand all
28 share_group_->AddContext(this); 28 share_group_->AddContext(this);
29 } 29 }
30 30
31 GLContext::~GLContext() { 31 GLContext::~GLContext() {
32 share_group_->RemoveContext(this); 32 share_group_->RemoveContext(this);
33 if (GetCurrent() == this) { 33 if (GetCurrent() == this) {
34 SetCurrent(NULL, NULL); 34 SetCurrent(NULL, NULL);
35 } 35 }
36 } 36 }
37 37
38 bool GLContext::GetTotalGpuMemory(size_t& bytes) {
39 bytes = 0;
40 return false;
41 }
42
38 std::string GLContext::GetExtensions() { 43 std::string GLContext::GetExtensions() {
39 DCHECK(IsCurrent(NULL)); 44 DCHECK(IsCurrent(NULL));
40 const char* ext = reinterpret_cast<const char*>(glGetString(GL_EXTENSIONS)); 45 const char* ext = reinterpret_cast<const char*>(glGetString(GL_EXTENSIONS));
41 return std::string(ext ? ext : ""); 46 return std::string(ext ? ext : "");
42 } 47 }
43 48
44 bool GLContext::HasExtension(const char* name) { 49 bool GLContext::HasExtension(const char* name) {
45 std::string extensions = GetExtensions(); 50 std::string extensions = GetExtensions();
46 extensions += " "; 51 extensions += " ";
47 52
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 static bool initialized = false; 95 static bool initialized = false;
91 if (initialized) 96 if (initialized)
92 return initialized; 97 return initialized;
93 initialized = InitializeGLExtensionBindings(GetGLImplementation(), this); 98 initialized = InitializeGLExtensionBindings(GetGLImplementation(), this);
94 if (!initialized) 99 if (!initialized)
95 LOG(ERROR) << "Could not initialize extension bindings."; 100 LOG(ERROR) << "Could not initialize extension bindings.";
96 return initialized; 101 return initialized;
97 } 102 }
98 103
99 } // namespace gfx 104 } // namespace gfx
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698