| 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_egl.h" | 5 #include "ui/gl/gl_context_egl.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 if (GLSurfaceEGL::IsCreateContextRobustnessSupported()) { | 63 if (GLSurfaceEGL::IsCreateContextRobustnessSupported()) { |
| 64 DVLOG(1) << "EGL_EXT_create_context_robustness supported."; | 64 DVLOG(1) << "EGL_EXT_create_context_robustness supported."; |
| 65 context_attributes = kContextRobustnessAttributes; | 65 context_attributes = kContextRobustnessAttributes; |
| 66 } else { | 66 } else { |
| 67 // At some point we should require the presence of the robustness | 67 // At some point we should require the presence of the robustness |
| 68 // extension and remove this code path. | 68 // extension and remove this code path. |
| 69 DVLOG(1) << "EGL_EXT_create_context_robustness NOT supported."; | 69 DVLOG(1) << "EGL_EXT_create_context_robustness NOT supported."; |
| 70 context_attributes = kContextAttributes; | 70 context_attributes = kContextAttributes; |
| 71 } | 71 } |
| 72 | 72 |
| 73 if (!eglBindAPI(EGL_OPENGL_ES_API)) { |
| 74 LOG(ERROR) << "eglBindApi failed with error " |
| 75 << GetLastEGLErrorString(); |
| 76 return false; |
| 77 } |
| 78 |
| 79 |
| 73 context_ = eglCreateContext( | 80 context_ = eglCreateContext( |
| 74 display_, | 81 display_, |
| 75 config_, | 82 config_, |
| 76 share_group() ? share_group()->GetHandle() : nullptr, | 83 share_group() ? share_group()->GetHandle() : nullptr, |
| 77 context_attributes); | 84 context_attributes); |
| 78 | 85 |
| 79 if (!context_) { | 86 if (!context_) { |
| 80 LOG(ERROR) << "eglCreateContext failed with error " | 87 LOG(ERROR) << "eglCreateContext failed with error " |
| 81 << GetLastEGLErrorString(); | 88 << GetLastEGLErrorString(); |
| 82 return false; | 89 return false; |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 | 217 |
| 211 bool GLContextEGL::WasAllocatedUsingRobustnessExtension() { | 218 bool GLContextEGL::WasAllocatedUsingRobustnessExtension() { |
| 212 return GLSurfaceEGL::IsCreateContextRobustnessSupported(); | 219 return GLSurfaceEGL::IsCreateContextRobustnessSupported(); |
| 213 } | 220 } |
| 214 | 221 |
| 215 GLContextEGL::~GLContextEGL() { | 222 GLContextEGL::~GLContextEGL() { |
| 216 Destroy(); | 223 Destroy(); |
| 217 } | 224 } |
| 218 | 225 |
| 219 } // namespace gfx | 226 } // namespace gfx |
| OLD | NEW |