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 "ui/aura/root_window.h" | 5 #include "ui/aura/root_window.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 compositor_.reset(new ui::Compositor(this, host_->GetAcceleratedWidget())); | 163 compositor_.reset(new ui::Compositor(this, host_->GetAcceleratedWidget())); |
164 DCHECK(compositor_.get()); | 164 DCHECK(compositor_.get()); |
165 compositor_->AddObserver(this); | 165 compositor_->AddObserver(this); |
166 | 166 |
167 prop_.reset(new ui::ViewProp(host_->GetAcceleratedWidget(), | 167 prop_.reset(new ui::ViewProp(host_->GetAcceleratedWidget(), |
168 kRootWindowForAcceleratedWidget, | 168 kRootWindowForAcceleratedWidget, |
169 this)); | 169 this)); |
170 } | 170 } |
171 | 171 |
172 RootWindow::~RootWindow() { | 172 RootWindow::~RootWindow() { |
| 173 TRACE_EVENT0("shutdown", "RootWindow::Destructor"); |
| 174 |
173 compositor_->RemoveObserver(this); | 175 compositor_->RemoveObserver(this); |
174 // Make sure to destroy the compositor before terminating so that state is | 176 // Make sure to destroy the compositor before terminating so that state is |
175 // cleared and we don't hit asserts. | 177 // cleared and we don't hit asserts. |
176 compositor_.reset(); | 178 compositor_.reset(); |
177 | 179 |
178 // Tear down in reverse. Frees any references held by the host. | 180 // Tear down in reverse. Frees any references held by the host. |
179 host_.reset(NULL); | 181 host_.reset(NULL); |
180 | 182 |
181 // An observer may have been added by an animation on the RootWindow. | 183 // An observer may have been added by an animation on the RootWindow. |
182 layer()->GetAnimator()->RemoveObserver(this); | 184 layer()->GetAnimator()->RemoveObserver(this); |
(...skipping 1061 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1244 } | 1246 } |
1245 | 1247 |
1246 gfx::Transform RootWindow::GetInverseRootTransform() const { | 1248 gfx::Transform RootWindow::GetInverseRootTransform() const { |
1247 float scale = ui::GetDeviceScaleFactor(layer()); | 1249 float scale = ui::GetDeviceScaleFactor(layer()); |
1248 gfx::Transform transform; | 1250 gfx::Transform transform; |
1249 transform.Scale(1.0f / scale, 1.0f / scale); | 1251 transform.Scale(1.0f / scale, 1.0f / scale); |
1250 return transformer_->GetInverseTransform() * transform; | 1252 return transformer_->GetInverseTransform() * transform; |
1251 } | 1253 } |
1252 | 1254 |
1253 } // namespace aura | 1255 } // namespace aura |
OLD | NEW |