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 <EGL/egl.h> | 5 #include <EGL/egl.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 | 7 |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/environment.h" | 9 #include "base/environment.h" |
10 #include "base/strings/string_split.h" | 10 #include "base/strings/string_split.h" |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 } | 141 } |
142 | 142 |
143 EGLAPI EGLBoolean EGLAPIENTRY eglTerminate(EGLDisplay dpy) { | 143 EGLAPI EGLBoolean EGLAPIENTRY eglTerminate(EGLDisplay dpy) { |
144 EGLint error_code = ValidateDisplay(dpy); | 144 EGLint error_code = ValidateDisplay(dpy); |
145 if (error_code != EGL_SUCCESS) | 145 if (error_code != EGL_SUCCESS) |
146 return EglError(error_code, EGL_FALSE); | 146 return EglError(error_code, EGL_FALSE); |
147 | 147 |
148 egl::Display* display = static_cast<egl::Display*>(dpy); | 148 egl::Display* display = static_cast<egl::Display*>(dpy); |
149 delete display; | 149 delete display; |
150 | 150 |
| 151 // TODO: EGL specifies that the objects are marked for deletion and they will |
| 152 // remain alive as long as "contexts or surfaces associated with display is |
| 153 // current to any thread". |
| 154 // Currently we delete the display here, and may also call exit handlers. |
| 155 |
151 return EglSuccess(EGL_TRUE); | 156 return EglSuccess(EGL_TRUE); |
152 } | 157 } |
153 | 158 |
154 EGLAPI const char* EGLAPIENTRY eglQueryString(EGLDisplay dpy, EGLint name) { | 159 EGLAPI const char* EGLAPIENTRY eglQueryString(EGLDisplay dpy, EGLint name) { |
155 EGLint error_code = ValidateDisplay(dpy); | 160 EGLint error_code = ValidateDisplay(dpy); |
156 if (error_code != EGL_SUCCESS) | 161 if (error_code != EGL_SUCCESS) |
157 return EglError(error_code, static_cast<const char*>(NULL)); | 162 return EglError(error_code, static_cast<const char*>(NULL)); |
158 | 163 |
159 switch (name) { | 164 switch (name) { |
160 case EGL_CLIENT_APIS: | 165 case EGL_CLIENT_APIS: |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 return EGL_FALSE; | 458 return EGL_FALSE; |
454 } | 459 } |
455 | 460 |
456 /* Now, define eglGetProcAddress using the generic function ptr. type */ | 461 /* Now, define eglGetProcAddress using the generic function ptr. type */ |
457 EGLAPI __eglMustCastToProperFunctionPointerType EGLAPIENTRY | 462 EGLAPI __eglMustCastToProperFunctionPointerType EGLAPIENTRY |
458 eglGetProcAddress(const char* procname) { | 463 eglGetProcAddress(const char* procname) { |
459 return reinterpret_cast<__eglMustCastToProperFunctionPointerType>( | 464 return reinterpret_cast<__eglMustCastToProperFunctionPointerType>( |
460 gles2::GetGLFunctionPointer(procname)); | 465 gles2::GetGLFunctionPointer(procname)); |
461 } | 466 } |
462 } // extern "C" | 467 } // extern "C" |
OLD | NEW |