Chromium Code Reviews| 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 "ui/gl/gl_context.h" | 5 #include "ui/gl/gl_context.h" |
| 6 | 6 |
| 7 #include "base/android/sys_utils.h" | 7 #include "base/android/sys_utils.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/sys_info.h" | 10 #include "base/sys_info.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 47 GLNonOwnedContext::GLNonOwnedContext(GLShareGroup* share_group) | 47 GLNonOwnedContext::GLNonOwnedContext(GLShareGroup* share_group) |
| 48 : GLContextReal(share_group) {} | 48 : GLContextReal(share_group) {} |
| 49 | 49 |
| 50 bool GLNonOwnedContext::MakeCurrent(GLSurface* surface) { | 50 bool GLNonOwnedContext::MakeCurrent(GLSurface* surface) { |
| 51 SetCurrent(surface); | 51 SetCurrent(surface); |
| 52 SetRealGLApi(); | 52 SetRealGLApi(); |
| 53 return true; | 53 return true; |
| 54 } | 54 } |
| 55 | 55 |
| 56 std::string GLNonOwnedContext::GetExtensions() { | 56 std::string GLNonOwnedContext::GetExtensions() { |
| 57 return GLContext::GetExtensions(); | 57 const char* extensions = |
| 58 eglQueryString(eglGetDisplay(EGL_DEFAULT_DISPLAY), EGL_EXTENSIONS); | |
|
no sievers
2013/09/09 16:59:23
use |display_|
boliu
2013/09/09 17:49:37
This doesn't inherit from GLContextEGL, even thoug
| |
| 59 if (!extensions) | |
| 60 return GLContext::GetExtensions(); | |
| 61 | |
| 62 return GLContext::GetExtensions() + " " + extensions; | |
| 58 } | 63 } |
| 59 | 64 |
| 60 } // anonymous namespace | 65 } // anonymous namespace |
| 61 | 66 |
| 62 // static | 67 // static |
| 63 scoped_refptr<GLContext> GLContext::CreateGLContext( | 68 scoped_refptr<GLContext> GLContext::CreateGLContext( |
| 64 GLShareGroup* share_group, | 69 GLShareGroup* share_group, |
| 65 GLSurface* compatible_surface, | 70 GLSurface* compatible_surface, |
| 66 GpuPreference gpu_preference) { | 71 GpuPreference gpu_preference) { |
| 67 if (GetGLImplementation() == kGLImplementationMockGL) | 72 if (GetGLImplementation() == kGLImplementationMockGL) |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 116 } else { | 121 } else { |
| 117 limit_bytes = physical_memory_mb / 32; | 122 limit_bytes = physical_memory_mb / 32; |
| 118 } | 123 } |
| 119 limit_bytes = limit_bytes * 1024 * 1024; | 124 limit_bytes = limit_bytes * 1024 * 1024; |
| 120 } | 125 } |
| 121 *bytes = limit_bytes; | 126 *bytes = limit_bytes; |
| 122 return true; | 127 return true; |
| 123 } | 128 } |
| 124 | 129 |
| 125 } | 130 } |
| OLD | NEW |