| 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/bind.h" | 6 #include "base/bind.h" |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/i18n/icu_util.h" | 8 #include "base/i18n/icu_util.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| 11 #include "base/strings/string_split.h" | 11 #include "base/strings/string_split.h" |
| 12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
| 13 #include "cc/output/context_provider.h" | 13 #include "cc/output/context_provider.h" |
| 14 #include "third_party/khronos/GLES2/gl2.h" | 14 #include "third_party/khronos/GLES2/gl2.h" |
| 15 #include "third_party/skia/include/core/SkXfermode.h" | 15 #include "third_party/skia/include/core/SkXfermode.h" |
| 16 #include "ui/aura/client/default_capture_client.h" | 16 #include "ui/aura/client/default_capture_client.h" |
| 17 #include "ui/aura/env.h" | 17 #include "ui/aura/env.h" |
| 18 #include "ui/aura/root_window.h" | 18 #include "ui/aura/root_window.h" |
| 19 #include "ui/aura/test/test_focus_client.h" | 19 #include "ui/aura/test/test_focus_client.h" |
| 20 #include "ui/aura/test/test_screen.h" | 20 #include "ui/aura/test/test_screen.h" |
| 21 #include "ui/aura/window.h" | 21 #include "ui/aura/window.h" |
| 22 #include "ui/base/hit_test.h" | 22 #include "ui/base/hit_test.h" |
| 23 #include "ui/base/resource/resource_bundle.h" | 23 #include "ui/base/resource/resource_bundle.h" |
| 24 #include "ui/base/ui_base_paths.h" | 24 #include "ui/base/ui_base_paths.h" |
| 25 #include "ui/compositor/compositor.h" | 25 #include "ui/compositor/compositor.h" |
| 26 #include "ui/compositor/compositor_observer.h" | 26 #include "ui/compositor/compositor_observer.h" |
| 27 #include "ui/compositor/debug_utils.h" | 27 #include "ui/compositor/debug_utils.h" |
| 28 #include "ui/compositor/layer.h" | 28 #include "ui/compositor/layer.h" |
| 29 #include "ui/compositor/test/context_factories_for_test.h" |
| 29 #include "ui/gfx/canvas.h" | 30 #include "ui/gfx/canvas.h" |
| 30 #include "ui/gfx/rect.h" | 31 #include "ui/gfx/rect.h" |
| 31 #include "ui/gfx/skia_util.h" | 32 #include "ui/gfx/skia_util.h" |
| 32 #ifndef GL_GLEXT_PROTOTYPES | 33 #ifndef GL_GLEXT_PROTOTYPES |
| 33 #define GL_GLEXT_PROTOTYPES 1 | 34 #define GL_GLEXT_PROTOTYPES 1 |
| 34 #endif | 35 #endif |
| 35 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" | 36 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" |
| 36 #include "third_party/khronos/GLES2/gl2ext.h" | 37 #include "third_party/khronos/GLES2/gl2ext.h" |
| 37 | 38 |
| 38 #if defined(USE_X11) | 39 #if defined(USE_X11) |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 | 295 |
| 295 } // namespace | 296 } // namespace |
| 296 | 297 |
| 297 int main(int argc, char** argv) { | 298 int main(int argc, char** argv) { |
| 298 CommandLine::Init(argc, argv); | 299 CommandLine::Init(argc, argv); |
| 299 | 300 |
| 300 base::AtExitManager exit_manager; | 301 base::AtExitManager exit_manager; |
| 301 | 302 |
| 302 // The ContextFactory must exist before any Compositors are created. | 303 // The ContextFactory must exist before any Compositors are created. |
| 303 bool allow_test_contexts = false; | 304 bool allow_test_contexts = false; |
| 304 ui::Compositor::InitializeContextFactoryForTests(allow_test_contexts); | 305 ui::InitializeContextFactoryForTests(allow_test_contexts); |
| 305 | 306 |
| 306 ui::RegisterPathProvider(); | 307 ui::RegisterPathProvider(); |
| 307 base::i18n::InitializeICU(); | 308 base::i18n::InitializeICU(); |
| 308 ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL); | 309 ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL); |
| 309 | 310 |
| 310 base::MessageLoop message_loop(base::MessageLoop::TYPE_UI); | 311 base::MessageLoop message_loop(base::MessageLoop::TYPE_UI); |
| 311 aura::Env::CreateInstance(); | 312 aura::Env::CreateInstance(); |
| 312 scoped_ptr<aura::TestScreen> test_screen( | 313 scoped_ptr<aura::TestScreen> test_screen( |
| 313 aura::TestScreen::CreateFullscreen()); | 314 aura::TestScreen::CreateFullscreen()); |
| 314 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, test_screen.get()); | 315 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, test_screen.get()); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 ui::PrintLayerHierarchy(root_window->layer(), gfx::Point(100, 100)); | 363 ui::PrintLayerHierarchy(root_window->layer(), gfx::Point(100, 100)); |
| 363 #endif | 364 #endif |
| 364 | 365 |
| 365 root_window->ShowRootWindow(); | 366 root_window->ShowRootWindow(); |
| 366 base::MessageLoopForUI::current()->Run(); | 367 base::MessageLoopForUI::current()->Run(); |
| 367 focus_client.reset(); | 368 focus_client.reset(); |
| 368 root_window.reset(); | 369 root_window.reset(); |
| 369 | 370 |
| 370 return 0; | 371 return 0; |
| 371 } | 372 } |
| OLD | NEW |