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 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 } | 438 } |
439 | 439 |
440 void RootWindow::ConvertPointFromNativeScreen(gfx::Point* point) const { | 440 void RootWindow::ConvertPointFromNativeScreen(gfx::Point* point) const { |
441 gfx::Point location = host_->GetLocationOnNativeScreen(); | 441 gfx::Point location = host_->GetLocationOnNativeScreen(); |
442 point->Offset(-location.x(), -location.y()); | 442 point->Offset(-location.x(), -location.y()); |
443 ConvertPointFromHost(point); | 443 ConvertPointFromHost(point); |
444 } | 444 } |
445 | 445 |
446 void RootWindow::ConvertPointToHost(gfx::Point* point) const { | 446 void RootWindow::ConvertPointToHost(gfx::Point* point) const { |
447 gfx::Point3F point_3f(*point); | 447 gfx::Point3F point_3f(*point); |
448 GetRootTransform().TransformPoint(point_3f); | 448 GetRootTransform().TransformPoint(&point_3f); |
449 *point = gfx::ToFlooredPoint(point_3f.AsPointF()); | 449 *point = gfx::ToFlooredPoint(point_3f.AsPointF()); |
450 } | 450 } |
451 | 451 |
452 void RootWindow::ConvertPointFromHost(gfx::Point* point) const { | 452 void RootWindow::ConvertPointFromHost(gfx::Point* point) const { |
453 gfx::Point3F point_3f(*point); | 453 gfx::Point3F point_3f(*point); |
454 GetInverseRootTransform().TransformPoint(point_3f); | 454 GetInverseRootTransform().TransformPoint(&point_3f); |
455 *point = gfx::ToFlooredPoint(point_3f.AsPointF()); | 455 *point = gfx::ToFlooredPoint(point_3f.AsPointF()); |
456 } | 456 } |
457 | 457 |
458 void RootWindow::ProcessedTouchEvent(ui::TouchEvent* event, | 458 void RootWindow::ProcessedTouchEvent(ui::TouchEvent* event, |
459 Window* window, | 459 Window* window, |
460 ui::EventResult result) { | 460 ui::EventResult result) { |
461 scoped_ptr<ui::GestureRecognizer::Gestures> gestures; | 461 scoped_ptr<ui::GestureRecognizer::Gestures> gestures; |
462 gestures.reset(gesture_recognizer_->ProcessTouchEventForGesture( | 462 gestures.reset(gesture_recognizer_->ProcessTouchEventForGesture( |
463 *event, result, window)); | 463 *event, result, window)); |
464 ProcessGestures(gestures.get()); | 464 ProcessGestures(gestures.get()); |
(...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1241 } | 1241 } |
1242 | 1242 |
1243 gfx::Transform RootWindow::GetInverseRootTransform() const { | 1243 gfx::Transform RootWindow::GetInverseRootTransform() const { |
1244 float scale = ui::GetDeviceScaleFactor(layer()); | 1244 float scale = ui::GetDeviceScaleFactor(layer()); |
1245 gfx::Transform transform; | 1245 gfx::Transform transform; |
1246 transform.Scale(1.0f / scale, 1.0f / scale); | 1246 transform.Scale(1.0f / scale, 1.0f / scale); |
1247 return transformer_->GetInverseTransform() * transform; | 1247 return transformer_->GetInverseTransform() * transform; |
1248 } | 1248 } |
1249 | 1249 |
1250 } // namespace aura | 1250 } // namespace aura |
OLD | NEW |