Chromium Code Reviews| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 66 const Window* root_window_; | 66 const Window* root_window_; |
| 67 const gfx::Transform transform_; | 67 const gfx::Transform transform_; |
| 68 | 68 |
| 69 DISALLOW_COPY_AND_ASSIGN(SimpleRootWindowTransformer); | 69 DISALLOW_COPY_AND_ASSIGN(SimpleRootWindowTransformer); |
| 70 }; | 70 }; |
| 71 | 71 |
| 72 //////////////////////////////////////////////////////////////////////////////// | 72 //////////////////////////////////////////////////////////////////////////////// |
| 73 // RootWindowHost, public: | 73 // RootWindowHost, public: |
| 74 | 74 |
| 75 RootWindowHost::~RootWindowHost() { | 75 RootWindowHost::~RootWindowHost() { |
| 76 // TODO(beng): this represents an ordering change. In the old code, the | 76 DCHECK(!compositor_) << "compositor must be destroyed before root window"; |
| 77 // compositor was reset before the window hierarchy was destroyed. | |
| 78 // verify that this has no adverse effects. | |
|
enne (OOO)
2014/01/03 23:22:40
Unfortunately, this does have adverse effects if I
| |
| 79 // Make sure to destroy the compositor before terminating so that state is | |
| 80 // cleared and we don't hit asserts. | |
| 81 compositor_.reset(); | |
| 82 } | 77 } |
| 83 | 78 |
| 84 void RootWindowHost::InitHost() { | 79 void RootWindowHost::InitHost() { |
| 85 compositor_->SetScaleAndSize(GetDeviceScaleFactorFromDisplay(window()), | 80 compositor_->SetScaleAndSize(GetDeviceScaleFactorFromDisplay(window()), |
| 86 GetBounds().size()); | 81 GetBounds().size()); |
| 87 window()->Init(ui::LAYER_NOT_DRAWN); | 82 window()->Init(ui::LAYER_NOT_DRAWN); |
| 88 compositor_->SetRootLayer(window()->layer()); | 83 compositor_->SetRootLayer(window()->layer()); |
| 89 transformer_.reset( | 84 transformer_.reset( |
| 90 new SimpleRootWindowTransformer(window(), gfx::Transform())); | 85 new SimpleRootWindowTransformer(window(), gfx::Transform())); |
| 91 UpdateRootWindowSize(GetBounds().size()); | 86 UpdateRootWindowSize(GetBounds().size()); |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 180 compositor_->SetScaleAndSize(GetDeviceScaleFactorFromDisplay(window()), | 175 compositor_->SetScaleAndSize(GetDeviceScaleFactorFromDisplay(window()), |
| 181 new_size); | 176 new_size); |
| 182 | 177 |
| 183 // The layer, and the observers should be notified of the | 178 // The layer, and the observers should be notified of the |
| 184 // transformed size of the root window. | 179 // transformed size of the root window. |
| 185 UpdateRootWindowSize(new_size); | 180 UpdateRootWindowSize(new_size); |
| 186 delegate_->OnHostResized(new_size); | 181 delegate_->OnHostResized(new_size); |
| 187 } | 182 } |
| 188 | 183 |
| 189 } // namespace aura | 184 } // namespace aura |
| OLD | NEW |