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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 #if defined(COMMAND_BUFFER_GLES_LIB_SUPPORT_ONLY) | 50 #if defined(COMMAND_BUFFER_GLES_LIB_SUPPORT_ONLY) |
51 #if defined(COMPONENT_BUILD) | 51 #if defined(COMPONENT_BUILD) |
52 if (!g_command_buffer_gles_has_atexit_manager) | 52 if (!g_command_buffer_gles_has_atexit_manager) |
53 g_exit_manager = new base::AtExitManager; | 53 g_exit_manager = new base::AtExitManager; |
54 #else | 54 #else |
55 g_exit_manager = new base::AtExitManager; | 55 g_exit_manager = new base::AtExitManager; |
56 #endif | 56 #endif |
57 #endif | 57 #endif |
58 gles2::Initialize(); | 58 gles2::Initialize(); |
59 | 59 |
60 if (gfx::GetGLImplementation() == gfx::kGLImplementationNone) { | 60 if (gl::GetGLImplementation() == gl::kGLImplementationNone) { |
61 base::CommandLine::StringVector argv; | 61 base::CommandLine::StringVector argv; |
62 std::unique_ptr<base::Environment> env(base::Environment::Create()); | 62 std::unique_ptr<base::Environment> env(base::Environment::Create()); |
63 std::string env_string; | 63 std::string env_string; |
64 env->GetVar("CHROME_COMMAND_BUFFER_GLES2_ARGS", &env_string); | 64 env->GetVar("CHROME_COMMAND_BUFFER_GLES2_ARGS", &env_string); |
65 #if defined(OS_WIN) | 65 #if defined(OS_WIN) |
66 argv = base::SplitString(base::UTF8ToUTF16(env_string), | 66 argv = base::SplitString(base::UTF8ToUTF16(env_string), |
67 base::kWhitespaceUTF16, base::TRIM_WHITESPACE, | 67 base::kWhitespaceUTF16, base::TRIM_WHITESPACE, |
68 base::SPLIT_WANT_NONEMPTY); | 68 base::SPLIT_WANT_NONEMPTY); |
69 argv.insert(argv.begin(), base::UTF8ToUTF16("dummy")); | 69 argv.insert(argv.begin(), base::UTF8ToUTF16("dummy")); |
70 #else | 70 #else |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 Context::ApplyContextReleased(); | 190 Context::ApplyContextReleased(); |
191 } | 191 } |
192 } | 192 } |
193 | 193 |
194 void ThreadState::AutoCurrentContextRestore::SetCurrent(Surface* surface, | 194 void ThreadState::AutoCurrentContextRestore::SetCurrent(Surface* surface, |
195 Context* context) { | 195 Context* context) { |
196 thread_state_->SetCurrent(surface, context); | 196 thread_state_->SetCurrent(surface, context); |
197 } | 197 } |
198 | 198 |
199 } // namespace egl | 199 } // namespace egl |
OLD | NEW |