| 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 24 matching lines...) Expand all Loading... |
| 35 SetCurrent(NULL, NULL); | 35 SetCurrent(NULL, NULL); |
| 36 } | 36 } |
| 37 } | 37 } |
| 38 | 38 |
| 39 bool GLContext::GetTotalGpuMemory(size_t* bytes) { | 39 bool GLContext::GetTotalGpuMemory(size_t* bytes) { |
| 40 DCHECK(bytes); | 40 DCHECK(bytes); |
| 41 *bytes = 0; | 41 *bytes = 0; |
| 42 return false; | 42 return false; |
| 43 } | 43 } |
| 44 | 44 |
| 45 void GLContext::SetSafeToForceGpuSwitch() { |
| 46 } |
| 47 |
| 45 std::string GLContext::GetExtensions() { | 48 std::string GLContext::GetExtensions() { |
| 46 DCHECK(IsCurrent(NULL)); | 49 DCHECK(IsCurrent(NULL)); |
| 47 const char* ext = reinterpret_cast<const char*>(glGetString(GL_EXTENSIONS)); | 50 const char* ext = reinterpret_cast<const char*>(glGetString(GL_EXTENSIONS)); |
| 48 return std::string(ext ? ext : ""); | 51 return std::string(ext ? ext : ""); |
| 49 } | 52 } |
| 50 | 53 |
| 51 bool GLContext::HasExtension(const char* name) { | 54 bool GLContext::HasExtension(const char* name) { |
| 52 std::string extensions = GetExtensions(); | 55 std::string extensions = GetExtensions(); |
| 53 extensions += " "; | 56 extensions += " "; |
| 54 | 57 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 void GLContext::OnDestroyVirtualContext(GLContext* virtual_context) { | 126 void GLContext::OnDestroyVirtualContext(GLContext* virtual_context) { |
| 124 if (virtual_gl_api_) | 127 if (virtual_gl_api_) |
| 125 virtual_gl_api_->OnDestroyVirtualContext(virtual_context); | 128 virtual_gl_api_->OnDestroyVirtualContext(virtual_context); |
| 126 } | 129 } |
| 127 | 130 |
| 128 void GLContext::SetRealGLApi() { | 131 void GLContext::SetRealGLApi() { |
| 129 SetGLToRealGLApi(); | 132 SetGLToRealGLApi(); |
| 130 } | 133 } |
| 131 | 134 |
| 132 } // namespace gfx | 135 } // namespace gfx |
| OLD | NEW |