OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/window_tree_host.h" | 5 #include "ui/aura/window_tree_host.h" |
6 | 6 |
7 #include "ui/aura/env.h" | 7 #include "ui/aura/env.h" |
8 #include "ui/aura/root_window.h" | 8 #include "ui/aura/root_window.h" |
9 #include "ui/aura/root_window_transformer.h" | 9 #include "ui/aura/root_window_transformer.h" |
10 #include "ui/aura/window.h" | 10 #include "ui/aura/window.h" |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 *point = gfx::ToFlooredPoint(point_3f.AsPointF()); | 160 *point = gfx::ToFlooredPoint(point_3f.AsPointF()); |
161 } | 161 } |
162 | 162 |
163 //////////////////////////////////////////////////////////////////////////////// | 163 //////////////////////////////////////////////////////////////////////////////// |
164 // WindowTreeHost, protected: | 164 // WindowTreeHost, protected: |
165 | 165 |
166 WindowTreeHost::WindowTreeHost() | 166 WindowTreeHost::WindowTreeHost() |
167 : delegate_(NULL) { | 167 : delegate_(NULL) { |
168 } | 168 } |
169 | 169 |
170 void WindowTreeHost::DestroyCompositor() { compositor_.reset(); } | 170 void WindowTreeHost::DestroyCompositor() { |
| 171 DCHECK(GetAcceleratedWidget()); |
| 172 compositor_.reset(); |
| 173 } |
171 | 174 |
172 void WindowTreeHost::CreateCompositor( | 175 void WindowTreeHost::CreateCompositor( |
173 gfx::AcceleratedWidget accelerated_widget) { | 176 gfx::AcceleratedWidget accelerated_widget) { |
174 compositor_.reset(new ui::Compositor(GetAcceleratedWidget())); | 177 compositor_.reset(new ui::Compositor(GetAcceleratedWidget())); |
175 DCHECK(compositor_.get()); | 178 DCHECK(compositor_.get()); |
176 } | 179 } |
177 | 180 |
178 void WindowTreeHost::NotifyHostResized(const gfx::Size& new_size) { | 181 void WindowTreeHost::NotifyHostResized(const gfx::Size& new_size) { |
179 // The compositor should have the same size as the native root window host. | 182 // The compositor should have the same size as the native root window host. |
180 // Get the latest scale from display because it might have been changed. | 183 // Get the latest scale from display because it might have been changed. |
(...skipping 11 matching lines...) Expand all Loading... |
192 WindowTreeHost* WindowTreeHost::Create(const gfx::Rect& bounds) { | 195 WindowTreeHost* WindowTreeHost::Create(const gfx::Rect& bounds) { |
193 // This is only hit for tests and ash, right now these aren't an issue so | 196 // This is only hit for tests and ash, right now these aren't an issue so |
194 // adding the CHECK. | 197 // adding the CHECK. |
195 // TODO(sky): decide if we want a factory. | 198 // TODO(sky): decide if we want a factory. |
196 CHECK(false); | 199 CHECK(false); |
197 return NULL; | 200 return NULL; |
198 } | 201 } |
199 #endif | 202 #endif |
200 | 203 |
201 } // namespace aura | 204 } // namespace aura |
OLD | NEW |