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() { | 170 void WindowTreeHost::DestroyCompositor() { compositor_.reset(); } |
171 DCHECK(GetAcceleratedWidget()); | |
172 compositor_.reset(); | |
173 } | |
174 | 171 |
175 void WindowTreeHost::CreateCompositor( | 172 void WindowTreeHost::CreateCompositor( |
176 gfx::AcceleratedWidget accelerated_widget) { | 173 gfx::AcceleratedWidget accelerated_widget) { |
177 compositor_.reset(new ui::Compositor(GetAcceleratedWidget())); | 174 compositor_.reset(new ui::Compositor(GetAcceleratedWidget())); |
178 DCHECK(compositor_.get()); | 175 DCHECK(compositor_.get()); |
179 } | 176 } |
180 | 177 |
181 void WindowTreeHost::NotifyHostResized(const gfx::Size& new_size) { | 178 void WindowTreeHost::NotifyHostResized(const gfx::Size& new_size) { |
182 // The compositor should have the same size as the native root window host. | 179 // The compositor should have the same size as the native root window host. |
183 // Get the latest scale from display because it might have been changed. | 180 // Get the latest scale from display because it might have been changed. |
(...skipping 12 matching lines...) Expand all Loading... |
196 WindowTreeHost* WindowTreeHost::Create(const gfx::Rect& bounds) { | 193 WindowTreeHost* WindowTreeHost::Create(const gfx::Rect& bounds) { |
197 // This is only hit for tests and ash, right now these aren't an issue so | 194 // This is only hit for tests and ash, right now these aren't an issue so |
198 // adding the CHECK. | 195 // adding the CHECK. |
199 // TODO(sky): decide if we want a factory. | 196 // TODO(sky): decide if we want a factory. |
200 CHECK(false); | 197 CHECK(false); |
201 return NULL; | 198 return NULL; |
202 } | 199 } |
203 #endif | 200 #endif |
204 | 201 |
205 } // namespace aura | 202 } // namespace aura |
OLD | NEW |