| 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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 // cleared and we don't hit asserts. | 152 // cleared and we don't hit asserts. |
| 153 compositor_.reset(); | 153 compositor_.reset(); |
| 154 | 154 |
| 155 // Tear down in reverse. Frees any references held by the host. | 155 // Tear down in reverse. Frees any references held by the host. |
| 156 host_.reset(NULL); | 156 host_.reset(NULL); |
| 157 | 157 |
| 158 // An observer may have been added by an animation on the RootWindow. | 158 // An observer may have been added by an animation on the RootWindow. |
| 159 layer()->GetAnimator()->RemoveObserver(this); | 159 layer()->GetAnimator()->RemoveObserver(this); |
| 160 } | 160 } |
| 161 | 161 |
| 162 // static |
| 163 RootWindow* RootWindow::GetForAcceleratedWidget( |
| 164 gfx::AcceleratedWidget widget) { |
| 165 RootWindowHost* host = RootWindowHost::GetForAcceleratedWidget(widget); |
| 166 return host ? host->GetRootWindow() : NULL; |
| 167 } |
| 168 |
| 162 void RootWindow::Init() { | 169 void RootWindow::Init() { |
| 163 compositor()->SetScaleAndSize(GetDeviceScaleFactorFromMonitor(this), | 170 compositor()->SetScaleAndSize(GetDeviceScaleFactorFromMonitor(this), |
| 164 host_->GetBounds().size()); | 171 host_->GetBounds().size()); |
| 165 Window::Init(ui::LAYER_NOT_DRAWN); | 172 Window::Init(ui::LAYER_NOT_DRAWN); |
| 166 last_mouse_location_ = | 173 last_mouse_location_ = |
| 167 ui::ConvertPointToDIP(layer(), host_->QueryMouseLocation()); | 174 ui::ConvertPointToDIP(layer(), host_->QueryMouseLocation()); |
| 168 compositor()->SetRootLayer(layer()); | 175 compositor()->SetRootLayer(layer()); |
| 169 SetBounds( | 176 SetBounds( |
| 170 ui::ConvertRectToDIP(layer(), gfx::Rect(host_->GetBounds().size()))); | 177 ui::ConvertRectToDIP(layer(), gfx::Rect(host_->GetBounds().size()))); |
| 171 Show(); | 178 Show(); |
| (...skipping 860 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1032 void RootWindow::UnlockCompositor() { | 1039 void RootWindow::UnlockCompositor() { |
| 1033 DCHECK(compositor_lock_); | 1040 DCHECK(compositor_lock_); |
| 1034 compositor_lock_ = NULL; | 1041 compositor_lock_ = NULL; |
| 1035 if (draw_on_compositor_unlock_) { | 1042 if (draw_on_compositor_unlock_) { |
| 1036 draw_on_compositor_unlock_ = false; | 1043 draw_on_compositor_unlock_ = false; |
| 1037 ScheduleDraw(); | 1044 ScheduleDraw(); |
| 1038 } | 1045 } |
| 1039 } | 1046 } |
| 1040 | 1047 |
| 1041 } // namespace aura | 1048 } // namespace aura |
| OLD | NEW |