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.h" | 10 #include "base/message_loop.h" |
11 #include "base/string_split.h" | 11 #include "base/string_split.h" |
12 #include "base/time.h" | 12 #include "base/time.h" |
13 #include "third_party/skia/include/core/SkXfermode.h" | 13 #include "third_party/skia/include/core/SkXfermode.h" |
14 #include "ui/aura/env.h" | 14 #include "ui/aura/env.h" |
15 #include "ui/aura/event.h" | 15 #include "ui/aura/event.h" |
16 #include "ui/aura/root_window.h" | 16 #include "ui/aura/root_window.h" |
17 #include "ui/aura/single_display_manager.h" | 17 #include "ui/aura/single_display_manager.h" |
| 18 #include "ui/aura/shared/root_window_capture_client.h" |
18 #include "ui/aura/window.h" | 19 #include "ui/aura/window.h" |
19 #include "ui/base/hit_test.h" | 20 #include "ui/base/hit_test.h" |
20 #include "ui/base/resource/resource_bundle.h" | 21 #include "ui/base/resource/resource_bundle.h" |
21 #include "ui/base/ui_base_paths.h" | 22 #include "ui/base/ui_base_paths.h" |
22 #include "ui/compositor/compositor.h" | 23 #include "ui/compositor/compositor.h" |
23 #include "ui/compositor/compositor_observer.h" | 24 #include "ui/compositor/compositor_observer.h" |
24 #include "ui/compositor/debug_utils.h" | 25 #include "ui/compositor/debug_utils.h" |
25 #include "ui/compositor/layer.h" | 26 #include "ui/compositor/layer.h" |
26 #include "ui/compositor/test/compositor_test_support.h" | 27 #include "ui/compositor/test/compositor_test_support.h" |
27 #include "ui/gfx/canvas.h" | 28 #include "ui/gfx/canvas.h" |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 icu_util::Initialize(); | 290 icu_util::Initialize(); |
290 ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL); | 291 ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL); |
291 | 292 |
292 MessageLoop message_loop(MessageLoop::TYPE_UI); | 293 MessageLoop message_loop(MessageLoop::TYPE_UI); |
293 ui::CompositorTestSupport::Initialize(); | 294 ui::CompositorTestSupport::Initialize(); |
294 aura::SingleDisplayManager* manager = new aura::SingleDisplayManager; | 295 aura::SingleDisplayManager* manager = new aura::SingleDisplayManager; |
295 manager->set_use_fullscreen_host_window(true); | 296 manager->set_use_fullscreen_host_window(true); |
296 aura::Env::GetInstance()->SetDisplayManager(manager); | 297 aura::Env::GetInstance()->SetDisplayManager(manager); |
297 scoped_ptr<aura::RootWindow> root_window( | 298 scoped_ptr<aura::RootWindow> root_window( |
298 aura::DisplayManager::CreateRootWindowForPrimaryDisplay()); | 299 aura::DisplayManager::CreateRootWindowForPrimaryDisplay()); |
| 300 aura::client::SetCaptureClient( |
| 301 root_window.get(), |
| 302 new aura::shared::RootWindowCaptureClient(root_window.get())); |
299 | 303 |
300 // add layers | 304 // add layers |
301 ColoredLayer background(SK_ColorRED); | 305 ColoredLayer background(SK_ColorRED); |
302 background.SetBounds(root_window->bounds()); | 306 background.SetBounds(root_window->bounds()); |
303 root_window->layer()->Add(&background); | 307 root_window->layer()->Add(&background); |
304 | 308 |
305 ColoredLayer window(SK_ColorBLUE); | 309 ColoredLayer window(SK_ColorBLUE); |
306 window.SetBounds(gfx::Rect(background.bounds().size())); | 310 window.SetBounds(gfx::Rect(background.bounds().size())); |
307 background.Add(&window); | 311 background.Add(&window); |
308 | 312 |
(...skipping 29 matching lines...) Expand all Loading... |
338 #endif | 342 #endif |
339 | 343 |
340 root_window->ShowRootWindow(); | 344 root_window->ShowRootWindow(); |
341 MessageLoopForUI::current()->Run(); | 345 MessageLoopForUI::current()->Run(); |
342 root_window.reset(); | 346 root_window.reset(); |
343 | 347 |
344 ui::CompositorTestSupport::Terminate(); | 348 ui::CompositorTestSupport::Terminate(); |
345 | 349 |
346 return 0; | 350 return 0; |
347 } | 351 } |
OLD | NEW |