| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ash/touch/touch_transformer_controller.h" | 5 #include "ash/touch/touch_transformer_controller.h" |
| 6 | 6 |
| 7 #include "ash/display/display_manager.h" | 7 #include "ash/display/display_manager.h" |
| 8 #include "ash/display/window_tree_host_manager.h" | 8 #include "ash/display/window_tree_host_manager.h" |
| 9 #include "ash/host/ash_window_tree_host.h" | 9 #include "ash/host/ash_window_tree_host.h" |
| 10 #include "ash/root_window_controller.h" | 10 #include "ash/root_window_controller.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 << ", Touchscreen size: " << touch_device.size.ToString() | 60 << ", Touchscreen size: " << touch_device.size.ToString() |
| 61 << ", Touch radius scale ratio: " << ratio; | 61 << ", Touch radius scale ratio: " << ratio; |
| 62 return ratio; | 62 return ratio; |
| 63 } | 63 } |
| 64 | 64 |
| 65 gfx::Transform TouchTransformerController::GetTouchTransform( | 65 gfx::Transform TouchTransformerController::GetTouchTransform( |
| 66 const DisplayInfo& display, | 66 const DisplayInfo& display, |
| 67 const DisplayInfo& touch_display, | 67 const DisplayInfo& touch_display, |
| 68 const ui::TouchscreenDevice& touchscreen, | 68 const ui::TouchscreenDevice& touchscreen, |
| 69 const gfx::Size& framebuffer_size) const { | 69 const gfx::Size& framebuffer_size) const { |
| 70 gfx::SizeF current_size = display.bounds_in_native().size(); | 70 auto current_size = gfx::SizeF(display.bounds_in_native().size()); |
| 71 gfx::SizeF touch_native_size = touch_display.GetNativeModeSize(); | 71 auto touch_native_size = gfx::SizeF(touch_display.GetNativeModeSize()); |
| 72 #if defined(USE_OZONE) | 72 #if defined(USE_OZONE) |
| 73 gfx::SizeF touch_area = touchscreen.size; | 73 auto touch_area = gfx::SizeF(touchscreen.size); |
| 74 #elif defined(USE_X11) | 74 #elif defined(USE_X11) |
| 75 // On X11 touches are reported in the framebuffer coordinate space. | 75 // On X11 touches are reported in the framebuffer coordinate space. |
| 76 gfx::SizeF touch_area = framebuffer_size; | 76 auto touch_area = gfx::SizeF(framebuffer_size); |
| 77 #endif | 77 #endif |
| 78 | 78 |
| 79 gfx::Transform ctm; | 79 gfx::Transform ctm; |
| 80 | 80 |
| 81 if (current_size.IsEmpty() || touch_native_size.IsEmpty() || | 81 if (current_size.IsEmpty() || touch_native_size.IsEmpty() || |
| 82 touch_area.IsEmpty() || touchscreen.id == ui::InputDevice::kInvalidId) | 82 touch_area.IsEmpty() || touchscreen.id == ui::InputDevice::kInvalidId) |
| 83 return ctm; | 83 return ctm; |
| 84 | 84 |
| 85 #if defined(USE_OZONE) | 85 #if defined(USE_OZONE) |
| 86 // Translate the touch so that it falls within the display bounds. | 86 // Translate the touch so that it falls within the display bounds. |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 | 222 |
| 223 void TouchTransformerController::OnDisplaysInitialized() { | 223 void TouchTransformerController::OnDisplaysInitialized() { |
| 224 UpdateTouchTransformer(); | 224 UpdateTouchTransformer(); |
| 225 } | 225 } |
| 226 | 226 |
| 227 void TouchTransformerController::OnDisplayConfigurationChanged() { | 227 void TouchTransformerController::OnDisplayConfigurationChanged() { |
| 228 UpdateTouchTransformer(); | 228 UpdateTouchTransformer(); |
| 229 } | 229 } |
| 230 | 230 |
| 231 } // namespace ash | 231 } // namespace ash |
| OLD | NEW |