| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #if defined(USE_X11) | |
| 6 #include <X11/Xlib.h> | |
| 7 #endif | |
| 8 | |
| 9 #include "base/at_exit.h" | 5 #include "base/at_exit.h" |
| 10 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 11 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 12 #include "base/i18n/icu_util.h" | 8 #include "base/i18n/icu_util.h" |
| 13 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 14 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| 15 #include "base/run_loop.h" | 11 #include "base/run_loop.h" |
| 16 #include "ui/aura/env.h" | 12 #include "ui/aura/env.h" |
| 17 #include "ui/base/ime/input_method_initializer.h" | 13 #include "ui/base/ime/input_method_initializer.h" |
| 18 #include "ui/base/resource/resource_bundle.h" | 14 #include "ui/base/resource/resource_bundle.h" |
| 19 #include "ui/compositor/test/in_process_context_factory.h" | 15 #include "ui/compositor/test/in_process_context_factory.h" |
| 20 #include "ui/gfx/screen.h" | 16 #include "ui/gfx/screen.h" |
| 21 #include "ui/gl/gl_surface.h" | 17 #include "ui/gl/gl_surface.h" |
| 22 #include "ui/views/examples/example_base.h" | 18 #include "ui/views/examples/example_base.h" |
| 23 #include "ui/views/examples/examples_window.h" | 19 #include "ui/views/examples/examples_window.h" |
| 24 #include "ui/views/test/desktop_test_views_delegate.h" | 20 #include "ui/views/test/desktop_test_views_delegate.h" |
| 25 #include "ui/wm/core/wm_state.h" | 21 #include "ui/wm/core/wm_state.h" |
| 26 | 22 |
| 27 #if !defined(OS_CHROMEOS) | 23 #if !defined(OS_CHROMEOS) |
| 28 #include "ui/views/widget/desktop_aura/desktop_screen.h" | 24 #include "ui/views/widget/desktop_aura/desktop_screen.h" |
| 29 #endif | 25 #endif |
| 26 |
| 30 #if defined(OS_WIN) | 27 #if defined(OS_WIN) |
| 31 #include "ui/base/win/scoped_ole_initializer.h" | 28 #include "ui/base/win/scoped_ole_initializer.h" |
| 32 #endif | 29 #endif |
| 33 | 30 |
| 31 #if defined(USE_X11) |
| 32 #include "ui/gfx/x/x11_connection.h" |
| 33 #endif |
| 34 |
| 34 int main(int argc, char** argv) { | 35 int main(int argc, char** argv) { |
| 35 #if defined(OS_WIN) | 36 #if defined(OS_WIN) |
| 36 ui::ScopedOleInitializer ole_initializer_; | 37 ui::ScopedOleInitializer ole_initializer_; |
| 37 #endif | 38 #endif |
| 38 | 39 |
| 39 CommandLine::Init(argc, argv); | 40 CommandLine::Init(argc, argv); |
| 40 | 41 |
| 41 base::AtExitManager at_exit; | 42 base::AtExitManager at_exit; |
| 42 | 43 |
| 43 #if defined(USE_X11) | 44 #if defined(USE_X11) |
| 44 // This demo uses InProcessContextFactory which uses X on a separate Gpu | 45 // This demo uses InProcessContextFactory which uses X on a separate Gpu |
| 45 // thread. | 46 // thread. |
| 46 XInitThreads(); | 47 gfx::InitializeThreadedX11(); |
| 47 #endif | 48 #endif |
| 48 | 49 |
| 49 gfx::GLSurface::InitializeOneOff(); | 50 gfx::GLSurface::InitializeOneOff(); |
| 50 | 51 |
| 51 // The ContextFactory must exist before any Compositors are created. | 52 // The ContextFactory must exist before any Compositors are created. |
| 52 scoped_ptr<ui::InProcessContextFactory> context_factory( | 53 scoped_ptr<ui::InProcessContextFactory> context_factory( |
| 53 new ui::InProcessContextFactory()); | 54 new ui::InProcessContextFactory()); |
| 54 ui::ContextFactory::SetInstance(context_factory.get()); | 55 ui::ContextFactory::SetInstance(context_factory.get()); |
| 55 | 56 |
| 56 base::MessageLoopForUI message_loop; | 57 base::MessageLoopForUI message_loop; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 | 89 |
| 89 ui::ResourceBundle::CleanupSharedInstance(); | 90 ui::ResourceBundle::CleanupSharedInstance(); |
| 90 } | 91 } |
| 91 | 92 |
| 92 ui::ShutdownInputMethod(); | 93 ui::ShutdownInputMethod(); |
| 93 | 94 |
| 94 aura::Env::DeleteInstance(); | 95 aura::Env::DeleteInstance(); |
| 95 | 96 |
| 96 return 0; | 97 return 0; |
| 97 } | 98 } |
| OLD | NEW |