| OLD | NEW |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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 "gpu/gles2_conform_support/egl/thread_state.h" | 5 #include "gpu/gles2_conform_support/egl/thread_state.h" |
| 6 | 6 |
| 7 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
| 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/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 argv.insert(argv.begin(), "dummy"); | 74 argv.insert(argv.begin(), "dummy"); |
| 75 #endif | 75 #endif |
| 76 base::CommandLine::Init(0, nullptr); | 76 base::CommandLine::Init(0, nullptr); |
| 77 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 77 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 78 // Need to call both Init and InitFromArgv, since Windows does not use | 78 // Need to call both Init and InitFromArgv, since Windows does not use |
| 79 // argc, argv in CommandLine::Init(argc, argv). | 79 // argc, argv in CommandLine::Init(argc, argv). |
| 80 command_line->InitFromArgv(argv); | 80 command_line->InitFromArgv(argv); |
| 81 if (!command_line->HasSwitch(switches::kDisableGpuDriverBugWorkarounds)) { | 81 if (!command_line->HasSwitch(switches::kDisableGpuDriverBugWorkarounds)) { |
| 82 gpu::GPUInfo gpu_info; | 82 gpu::GPUInfo gpu_info; |
| 83 gpu::CollectBasicGraphicsInfo(&gpu_info); | 83 gpu::CollectBasicGraphicsInfo(&gpu_info); |
| 84 gpu::ApplyGpuDriverBugWorkarounds(gpu_info, command_line); | 84 gpu::ApplyGpuDriverBugWorkarounds(gpu_info, std::string(), |
| 85 command_line); |
| 85 } | 86 } |
| 86 | 87 |
| 87 gl::init::InitializeGLOneOff(); | 88 gl::init::InitializeGLOneOff(); |
| 88 } | 89 } |
| 89 | 90 |
| 90 g_egl_default_display = new egl::Display(); | 91 g_egl_default_display = new egl::Display(); |
| 91 g_egl_thread_state_key = gpu::ThreadLocalAlloc(); | 92 g_egl_thread_state_key = gpu::ThreadLocalAlloc(); |
| 92 } | 93 } |
| 93 egl::ThreadState* thread_state = static_cast<egl::ThreadState*>( | 94 egl::ThreadState* thread_state = static_cast<egl::ThreadState*>( |
| 94 gpu::ThreadLocalGetValue(g_egl_thread_state_key)); | 95 gpu::ThreadLocalGetValue(g_egl_thread_state_key)); |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 Context::ApplyContextReleased(); | 191 Context::ApplyContextReleased(); |
| 191 } | 192 } |
| 192 } | 193 } |
| 193 | 194 |
| 194 void ThreadState::AutoCurrentContextRestore::SetCurrent(Surface* surface, | 195 void ThreadState::AutoCurrentContextRestore::SetCurrent(Surface* surface, |
| 195 Context* context) { | 196 Context* context) { |
| 196 thread_state_->SetCurrent(surface, context); | 197 thread_state_->SetCurrent(surface, context); |
| 197 } | 198 } |
| 198 | 199 |
| 199 } // namespace egl | 200 } // namespace egl |
| OLD | NEW |