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 885 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
896 void RootWindow::OnHostLostMouseGrab() { | 896 void RootWindow::OnHostLostMouseGrab() { |
897 mouse_pressed_handler_ = NULL; | 897 mouse_pressed_handler_ = NULL; |
898 mouse_moved_handler_ = NULL; | 898 mouse_moved_handler_ = NULL; |
899 } | 899 } |
900 | 900 |
901 void RootWindow::OnHostPaint(const gfx::Rect& damage_rect) { | 901 void RootWindow::OnHostPaint(const gfx::Rect& damage_rect) { |
902 compositor_->ScheduleRedrawRect(damage_rect); | 902 compositor_->ScheduleRedrawRect(damage_rect); |
903 } | 903 } |
904 | 904 |
905 void RootWindow::OnHostMoved(const gfx::Point& origin) { | 905 void RootWindow::OnHostMoved(const gfx::Point& origin) { |
| 906 TRACE_EVENT1("ui", "RootWindow::OnHostMoved", |
| 907 "origin", origin.ToString()); |
| 908 |
906 FOR_EACH_OBSERVER(RootWindowObserver, observers_, | 909 FOR_EACH_OBSERVER(RootWindowObserver, observers_, |
907 OnRootWindowHostMoved(this, origin)); | 910 OnRootWindowHostMoved(this, origin)); |
908 } | 911 } |
909 | 912 |
910 void RootWindow::OnHostResized(const gfx::Size& size) { | 913 void RootWindow::OnHostResized(const gfx::Size& size) { |
| 914 TRACE_EVENT1("ui", "RootWindow::OnHostResized", |
| 915 "size", size.ToString()); |
| 916 |
911 DispatchHeldEvents(); | 917 DispatchHeldEvents(); |
912 // The compositor should have the same size as the native root window host. | 918 // The compositor should have the same size as the native root window host. |
913 // Get the latest scale from display because it might have been changed. | 919 // Get the latest scale from display because it might have been changed. |
914 compositor_->SetScaleAndSize(GetDeviceScaleFactorFromDisplay(this), size); | 920 compositor_->SetScaleAndSize(GetDeviceScaleFactorFromDisplay(this), size); |
915 | 921 |
916 // The layer, and the observers should be notified of the | 922 // The layer, and the observers should be notified of the |
917 // transformed size of the root window. | 923 // transformed size of the root window. |
918 UpdateRootWindowSize(size); | 924 UpdateRootWindowSize(size); |
919 FOR_EACH_OBSERVER(RootWindowObserver, observers_, | 925 FOR_EACH_OBSERVER(RootWindowObserver, observers_, |
920 OnRootWindowHostResized(this)); | 926 OnRootWindowHostResized(this)); |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1164 } | 1170 } |
1165 | 1171 |
1166 gfx::Transform RootWindow::GetInverseRootTransform() const { | 1172 gfx::Transform RootWindow::GetInverseRootTransform() const { |
1167 float scale = ui::GetDeviceScaleFactor(layer()); | 1173 float scale = ui::GetDeviceScaleFactor(layer()); |
1168 gfx::Transform transform; | 1174 gfx::Transform transform; |
1169 transform.Scale(1.0f / scale, 1.0f / scale); | 1175 transform.Scale(1.0f / scale, 1.0f / scale); |
1170 return transformer_->GetInverseTransform() * transform; | 1176 return transformer_->GetInverseTransform() * transform; |
1171 } | 1177 } |
1172 | 1178 |
1173 } // namespace aura | 1179 } // namespace aura |
OLD | NEW |