OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "ui/aura/desktop.h" | 5 #include "ui/aura/desktop.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "ui/aura/desktop_host.h" | 9 #include "ui/aura/desktop_host.h" |
10 #include "ui/aura/root_window.h" | 10 #include "ui/aura/root_window.h" |
11 #include "ui/aura/window.h" | 11 #include "ui/aura/window.h" |
12 #include "ui/gfx/compositor/compositor.h" | 12 #include "ui/gfx/compositor/compositor.h" |
13 #include "ui/gfx/compositor/layer.h" | 13 #include "ui/gfx/compositor/layer.h" |
14 | 14 |
15 namespace aura { | 15 namespace aura { |
16 | 16 |
17 // static | 17 // static |
18 Desktop* Desktop::instance_ = NULL; | 18 Desktop* Desktop::instance_ = NULL; |
19 | 19 |
20 Desktop::Desktop() | 20 Desktop::Desktop() |
21 : host_(aura::DesktopHost::Create(gfx::Rect(200, 200, 1024, 768))), | 21 : host_(aura::DesktopHost::Create(gfx::Rect(200, 200, 1280, 1024))), |
22 ALLOW_THIS_IN_INITIALIZER_LIST(schedule_paint_(this)) { | 22 ALLOW_THIS_IN_INITIALIZER_LIST(schedule_paint_(this)) { |
23 DCHECK(MessageLoopForUI::current()) | 23 DCHECK(MessageLoopForUI::current()) |
24 << "The UI message loop must be initialized first."; | 24 << "The UI message loop must be initialized first."; |
25 compositor_ = ui::Compositor::Create(this, host_->GetAcceleratedWidget(), | 25 compositor_ = ui::Compositor::Create(this, host_->GetAcceleratedWidget(), |
26 host_->GetSize()); | 26 host_->GetSize()); |
27 host_->SetDesktop(this); | 27 host_->SetDesktop(this); |
28 DCHECK(compositor_.get()); | 28 DCHECK(compositor_.get()); |
29 window_.reset(new internal::RootWindow); | 29 window_.reset(new internal::RootWindow); |
30 } | 30 } |
31 | 31 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 Desktop* Desktop::GetInstance() { | 76 Desktop* Desktop::GetInstance() { |
77 if (!instance_) { | 77 if (!instance_) { |
78 instance_ = new Desktop; | 78 instance_ = new Desktop; |
79 instance_->window_->Init(); | 79 instance_->window_->Init(); |
80 instance_->compositor()->set_root_layer(instance_->window_->layer()); | 80 instance_->compositor()->set_root_layer(instance_->window_->layer()); |
81 } | 81 } |
82 return instance_; | 82 return instance_; |
83 } | 83 } |
84 | 84 |
85 } // namespace aura | 85 } // namespace aura |
OLD | NEW |