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 "base/at_exit.h" | 5 #include "base/at_exit.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #if defined(OS_MACOSX) | 8 #if defined(OS_MACOSX) |
9 #include "base/mac/scoped_nsautorelease_pool.h" | 9 #include "base/mac/scoped_nsautorelease_pool.h" |
10 #endif | 10 #endif |
11 #include "gpu/command_buffer/client/gles2_lib.h" | 11 #include "gpu/command_buffer/client/gles2_lib.h" |
12 #include "gpu/command_buffer/tests/gl_test_utils.h" | 12 #include "gpu/command_buffer/tests/gl_test_utils.h" |
| 13 #include "gpu/config/gpu_util.h" |
13 #include "ui/gl/gl_surface.h" | 14 #include "ui/gl/gl_surface.h" |
14 | 15 |
15 #if defined(OS_ANDROID) | 16 #if defined(OS_ANDROID) |
16 #include "base/android/jni_android.h" | 17 #include "base/android/jni_android.h" |
17 #include "ui/gl/android/gl_jni_registrar.h" | 18 #include "ui/gl/android/gl_jni_registrar.h" |
18 #endif | 19 #endif |
19 | 20 |
20 #if defined(TOOLKIT_GTK) | 21 #if defined(TOOLKIT_GTK) |
21 #include "ui/gfx/gtk_util.h" | 22 #include "ui/gfx/gtk_util.h" |
22 #endif | 23 #endif |
23 | 24 |
24 int main(int argc, char** argv) { | 25 int main(int argc, char** argv) { |
25 #if defined(OS_ANDROID) | 26 #if defined(OS_ANDROID) |
26 ui::gl::android::RegisterJni(base::android::AttachCurrentThread()); | 27 ui::gl::android::RegisterJni(base::android::AttachCurrentThread()); |
27 #else | 28 #else |
28 base::AtExitManager exit_manager; | 29 base::AtExitManager exit_manager; |
29 #endif | 30 #endif |
30 CommandLine::Init(argc, argv); | 31 CommandLine::Init(argc, argv); |
31 #if defined(OS_MACOSX) | 32 #if defined(OS_MACOSX) |
32 base::mac::ScopedNSAutoreleasePool pool; | 33 base::mac::ScopedNSAutoreleasePool pool; |
33 #endif | 34 #endif |
34 #if defined(TOOLKIT_GTK) | 35 #if defined(TOOLKIT_GTK) |
35 gfx::GtkInitFromCommandLine(*CommandLine::ForCurrentProcess()); | 36 gfx::GtkInitFromCommandLine(*CommandLine::ForCurrentProcess()); |
36 #endif | 37 #endif |
37 gfx::GLSurface::InitializeOneOff(); | 38 gfx::GLSurface::InitializeOneOff(); |
38 ::gles2::Initialize(); | 39 ::gles2::Initialize(); |
| 40 gpu::ApplyGpuDriverBugWorkarounds(CommandLine::ForCurrentProcess()); |
39 base::MessageLoop::Type message_loop_type = base::MessageLoop::TYPE_UI; | 41 base::MessageLoop::Type message_loop_type = base::MessageLoop::TYPE_UI; |
40 base::MessageLoop main_message_loop(message_loop_type); | 42 base::MessageLoop main_message_loop(message_loop_type); |
41 return GLTestHelper::RunTests(argc, argv); | 43 return GLTestHelper::RunTests(argc, argv); |
42 } | 44 } |
43 | 45 |
44 | 46 |
OLD | NEW |