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