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 if (major) | 146 |
147 *major = 1; | 147 *major = 1; |
148 if (minor) | 148 *minor = 4; |
149 *minor = 4; | |
150 return EglSuccess(EGL_TRUE); | 149 return EglSuccess(EGL_TRUE); |
151 } | 150 } |
152 | 151 |
153 EGLAPI EGLBoolean EGLAPIENTRY eglTerminate(EGLDisplay dpy) { | 152 EGLAPI EGLBoolean EGLAPIENTRY eglTerminate(EGLDisplay dpy) { |
154 EGLint error_code = ValidateDisplay(dpy); | 153 EGLint error_code = ValidateDisplay(dpy); |
155 if (error_code != EGL_SUCCESS) | 154 if (error_code != EGL_SUCCESS) |
156 return EglError(error_code, EGL_FALSE); | 155 return EglError(error_code, EGL_FALSE); |
157 | 156 |
158 egl::Display* display = static_cast<egl::Display*>(dpy); | 157 egl::Display* display = static_cast<egl::Display*>(dpy); |
159 delete display; | 158 delete display; |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
468 return EGL_FALSE; | 467 return EGL_FALSE; |
469 } | 468 } |
470 | 469 |
471 /* Now, define eglGetProcAddress using the generic function ptr. type */ | 470 /* Now, define eglGetProcAddress using the generic function ptr. type */ |
472 EGLAPI __eglMustCastToProperFunctionPointerType EGLAPIENTRY | 471 EGLAPI __eglMustCastToProperFunctionPointerType EGLAPIENTRY |
473 eglGetProcAddress(const char* procname) { | 472 eglGetProcAddress(const char* procname) { |
474 return reinterpret_cast<__eglMustCastToProperFunctionPointerType>( | 473 return reinterpret_cast<__eglMustCastToProperFunctionPointerType>( |
475 gles2::GetGLFunctionPointer(procname)); | 474 gles2::GetGLFunctionPointer(procname)); |
476 } | 475 } |
477 } // extern "C" | 476 } // extern "C" |
OLD | NEW |