| 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/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 545 scoped_ptr<RootWindowTransformer> transformer) { | 545 scoped_ptr<RootWindowTransformer> transformer) { |
| 546 transformer_ = transformer.Pass(); | 546 transformer_ = transformer.Pass(); |
| 547 host_->SetInsets(transformer_->GetHostInsets()); | 547 host_->SetInsets(transformer_->GetHostInsets()); |
| 548 Window::SetTransform(transformer_->GetTransform()); | 548 Window::SetTransform(transformer_->GetTransform()); |
| 549 // If the layer is not animating, then we need to update the host size | 549 // If the layer is not animating, then we need to update the host size |
| 550 // immediately. | 550 // immediately. |
| 551 if (!layer()->GetAnimator()->is_animating()) | 551 if (!layer()->GetAnimator()->is_animating()) |
| 552 OnHostResized(host_->GetBounds().size()); | 552 OnHostResized(host_->GetBounds().size()); |
| 553 } | 553 } |
| 554 | 554 |
| 555 gfx::Transform RootWindow::GetRootTransform() const { |
| 556 float scale = ui::GetDeviceScaleFactor(layer()); |
| 557 gfx::Transform transform; |
| 558 transform.Scale(scale, scale); |
| 559 transform *= transformer_->GetTransform(); |
| 560 return transform; |
| 561 } |
| 562 |
| 555 //////////////////////////////////////////////////////////////////////////////// | 563 //////////////////////////////////////////////////////////////////////////////// |
| 556 // RootWindow, ui::EventTarget implementation: | 564 // RootWindow, ui::EventTarget implementation: |
| 557 | 565 |
| 558 ui::EventTarget* RootWindow::GetParentTarget() { | 566 ui::EventTarget* RootWindow::GetParentTarget() { |
| 559 return client::GetEventClient(this) ? | 567 return client::GetEventClient(this) ? |
| 560 client::GetEventClient(this)->GetToplevelEventTarget() : | 568 client::GetEventClient(this)->GetToplevelEventTarget() : |
| 561 Env::GetInstance(); | 569 Env::GetInstance(); |
| 562 } | 570 } |
| 563 | 571 |
| 564 //////////////////////////////////////////////////////////////////////////////// | 572 //////////////////////////////////////////////////////////////////////////////// |
| (...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1163 | 1171 |
| 1164 // TODO(derat|oshima): Don't use mouse_button_flags_ as it's | 1172 // TODO(derat|oshima): Don't use mouse_button_flags_ as it's |
| 1165 // currently broken. See/ crbug.com/107931. | 1173 // currently broken. See/ crbug.com/107931. |
| 1166 ui::MouseEvent event(ui::ET_MOUSE_MOVED, | 1174 ui::MouseEvent event(ui::ET_MOUSE_MOVED, |
| 1167 host_mouse_location, | 1175 host_mouse_location, |
| 1168 host_mouse_location, | 1176 host_mouse_location, |
| 1169 ui::EF_IS_SYNTHESIZED); | 1177 ui::EF_IS_SYNTHESIZED); |
| 1170 OnHostMouseEvent(&event); | 1178 OnHostMouseEvent(&event); |
| 1171 } | 1179 } |
| 1172 | 1180 |
| 1173 gfx::Transform RootWindow::GetRootTransform() const { | |
| 1174 float scale = ui::GetDeviceScaleFactor(layer()); | |
| 1175 gfx::Transform transform; | |
| 1176 transform.Scale(scale, scale); | |
| 1177 transform *= transformer_->GetTransform(); | |
| 1178 return transform; | |
| 1179 } | |
| 1180 | |
| 1181 gfx::Transform RootWindow::GetInverseRootTransform() const { | 1181 gfx::Transform RootWindow::GetInverseRootTransform() const { |
| 1182 float scale = ui::GetDeviceScaleFactor(layer()); | 1182 float scale = ui::GetDeviceScaleFactor(layer()); |
| 1183 gfx::Transform transform; | 1183 gfx::Transform transform; |
| 1184 transform.Scale(1.0f / scale, 1.0f / scale); | 1184 transform.Scale(1.0f / scale, 1.0f / scale); |
| 1185 return transformer_->GetInverseTransform() * transform; | 1185 return transformer_->GetInverseTransform() * transform; |
| 1186 } | 1186 } |
| 1187 | 1187 |
| 1188 } // namespace aura | 1188 } // namespace aura |
| OLD | NEW |