Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(324)

Side by Side Diff: ui/aura/root_window.cc

Issue 23691025: Adding shutdown tracing capabilities (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 1057 matching lines...) Expand 10 before | Expand all | Expand 10 after
1240 } 1242 }
1241 1243
1242 gfx::Transform RootWindow::GetInverseRootTransform() const { 1244 gfx::Transform RootWindow::GetInverseRootTransform() const {
1243 float scale = ui::GetDeviceScaleFactor(layer()); 1245 float scale = ui::GetDeviceScaleFactor(layer());
1244 gfx::Transform transform; 1246 gfx::Transform transform;
1245 transform.Scale(1.0f / scale, 1.0f / scale); 1247 transform.Scale(1.0f / scale, 1.0f / scale);
1246 return transformer_->GetInverseTransform() * transform; 1248 return transformer_->GetInverseTransform() * transform;
1247 } 1249 }
1248 1250
1249 } // namespace aura 1251 } // namespace aura
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698