| 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 args = base::SplitString(env_args, " ", base::TRIM_WHITESPACE, | 119 args = base::SplitString(env_args, " ", base::TRIM_WHITESPACE, |
| 120 base::SPLIT_WANT_NONEMPTY); | 120 base::SPLIT_WANT_NONEMPTY); |
| 121 } | 121 } |
| 122 if (args.empty()) { | 122 if (args.empty()) { |
| 123 args.push_back("dummy"); | 123 args.push_back("dummy"); |
| 124 } | 124 } |
| 125 scoped_ptr<const char* []> argv(new const char*[args.size()]); | 125 scoped_ptr<const char* []> argv(new const char*[args.size()]); |
| 126 for (size_t i = 0; i < args.size(); ++i) { | 126 for (size_t i = 0; i < args.size(); ++i) { |
| 127 argv[i] = args[i].c_str(); | 127 argv[i] = args[i].c_str(); |
| 128 } | 128 } |
| 129 base::CommandLine::Init(args.size(), argv.get()); | 129 base::CommandLine::Init(static_cast<int>(args.size()), argv.get()); |
| 130 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 130 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 131 if (!command_line->HasSwitch(switches::kDisableGpuDriverBugWorkarounds)) { | 131 if (!command_line->HasSwitch(switches::kDisableGpuDriverBugWorkarounds)) { |
| 132 gpu::ApplyGpuDriverBugWorkarounds(command_line); | 132 gpu::ApplyGpuDriverBugWorkarounds(command_line); |
| 133 } | 133 } |
| 134 | 134 |
| 135 gfx::GLSurface::InitializeOneOff(); | 135 gfx::GLSurface::InitializeOneOff(); |
| 136 } | 136 } |
| 137 | 137 |
| 138 *major = 1; | 138 *major = 1; |
| 139 *minor = 4; | 139 *minor = 4; |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 return EGL_FALSE; | 453 return EGL_FALSE; |
| 454 } | 454 } |
| 455 | 455 |
| 456 /* Now, define eglGetProcAddress using the generic function ptr. type */ | 456 /* Now, define eglGetProcAddress using the generic function ptr. type */ |
| 457 EGLAPI __eglMustCastToProperFunctionPointerType EGLAPIENTRY | 457 EGLAPI __eglMustCastToProperFunctionPointerType EGLAPIENTRY |
| 458 eglGetProcAddress(const char* procname) { | 458 eglGetProcAddress(const char* procname) { |
| 459 return reinterpret_cast<__eglMustCastToProperFunctionPointerType>( | 459 return reinterpret_cast<__eglMustCastToProperFunctionPointerType>( |
| 460 gles2::GetGLFunctionPointer(procname)); | 460 gles2::GetGLFunctionPointer(procname)); |
| 461 } | 461 } |
| 462 } // extern "C" | 462 } // extern "C" |
| OLD | NEW |