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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 // argc, argv in CommandLine::Init(argc, argv). | 136 // argc, argv in CommandLine::Init(argc, argv). |
137 command_line->InitFromArgv(argv); | 137 command_line->InitFromArgv(argv); |
138 if (!command_line->HasSwitch(switches::kDisableGpuDriverBugWorkarounds)) { | 138 if (!command_line->HasSwitch(switches::kDisableGpuDriverBugWorkarounds)) { |
139 gpu::GPUInfo gpu_info; | 139 gpu::GPUInfo gpu_info; |
140 gpu::CollectBasicGraphicsInfo(&gpu_info); | 140 gpu::CollectBasicGraphicsInfo(&gpu_info); |
141 gpu::ApplyGpuDriverBugWorkarounds(gpu_info, command_line); | 141 gpu::ApplyGpuDriverBugWorkarounds(gpu_info, command_line); |
142 } | 142 } |
143 | 143 |
144 gfx::GLSurface::InitializeOneOff(); | 144 gfx::GLSurface::InitializeOneOff(); |
145 } | 145 } |
146 | 146 if (major) |
147 *major = 1; | 147 *major = 1; |
148 *minor = 4; | 148 if (minor) |
| 149 *minor = 4; |
149 return EglSuccess(EGL_TRUE); | 150 return EglSuccess(EGL_TRUE); |
150 } | 151 } |
151 | 152 |
152 EGLAPI EGLBoolean EGLAPIENTRY eglTerminate(EGLDisplay dpy) { | 153 EGLAPI EGLBoolean EGLAPIENTRY eglTerminate(EGLDisplay dpy) { |
153 EGLint error_code = ValidateDisplay(dpy); | 154 EGLint error_code = ValidateDisplay(dpy); |
154 if (error_code != EGL_SUCCESS) | 155 if (error_code != EGL_SUCCESS) |
155 return EglError(error_code, EGL_FALSE); | 156 return EglError(error_code, EGL_FALSE); |
156 | 157 |
157 egl::Display* display = static_cast<egl::Display*>(dpy); | 158 egl::Display* display = static_cast<egl::Display*>(dpy); |
158 delete display; | 159 delete display; |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 return EGL_FALSE; | 468 return EGL_FALSE; |
468 } | 469 } |
469 | 470 |
470 /* Now, define eglGetProcAddress using the generic function ptr. type */ | 471 /* Now, define eglGetProcAddress using the generic function ptr. type */ |
471 EGLAPI __eglMustCastToProperFunctionPointerType EGLAPIENTRY | 472 EGLAPI __eglMustCastToProperFunctionPointerType EGLAPIENTRY |
472 eglGetProcAddress(const char* procname) { | 473 eglGetProcAddress(const char* procname) { |
473 return reinterpret_cast<__eglMustCastToProperFunctionPointerType>( | 474 return reinterpret_cast<__eglMustCastToProperFunctionPointerType>( |
474 gles2::GetGLFunctionPointer(procname)); | 475 gles2::GetGLFunctionPointer(procname)); |
475 } | 476 } |
476 } // extern "C" | 477 } // extern "C" |
OLD | NEW |