| OLD | NEW |
| 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 Loading... |
| 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 DCHECK(bytes); |
| 40 *bytes = 0; |
| 41 return false; |
| 42 } |
| 43 |
| 38 std::string GLContext::GetExtensions() { | 44 std::string GLContext::GetExtensions() { |
| 39 DCHECK(IsCurrent(NULL)); | 45 DCHECK(IsCurrent(NULL)); |
| 40 const char* ext = reinterpret_cast<const char*>(glGetString(GL_EXTENSIONS)); | 46 const char* ext = reinterpret_cast<const char*>(glGetString(GL_EXTENSIONS)); |
| 41 return std::string(ext ? ext : ""); | 47 return std::string(ext ? ext : ""); |
| 42 } | 48 } |
| 43 | 49 |
| 44 bool GLContext::HasExtension(const char* name) { | 50 bool GLContext::HasExtension(const char* name) { |
| 45 std::string extensions = GetExtensions(); | 51 std::string extensions = GetExtensions(); |
| 46 extensions += " "; | 52 extensions += " "; |
| 47 | 53 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 static bool initialized = false; | 96 static bool initialized = false; |
| 91 if (initialized) | 97 if (initialized) |
| 92 return initialized; | 98 return initialized; |
| 93 initialized = InitializeGLExtensionBindings(GetGLImplementation(), this); | 99 initialized = InitializeGLExtensionBindings(GetGLImplementation(), this); |
| 94 if (!initialized) | 100 if (!initialized) |
| 95 LOG(ERROR) << "Could not initialize extension bindings."; | 101 LOG(ERROR) << "Could not initialize extension bindings."; |
| 96 return initialized; | 102 return initialized; |
| 97 } | 103 } |
| 98 | 104 |
| 99 } // namespace gfx | 105 } // namespace gfx |
| OLD | NEW |