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 #ifndef ASH_TOUCH_TOUCH_TRANSFORMER_CONTROLLER_H_ | 5 #ifndef ASH_TOUCH_TOUCH_TRANSFORMER_CONTROLLER_H_ |
6 #define ASH_TOUCH_TOUCH_TRANSFORMER_CONTROLLER_H_ | 6 #define ASH_TOUCH_TOUCH_TRANSFORMER_CONTROLLER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 | 46 |
47 // Returns a transform that will be used to change an event's location from | 47 // Returns a transform that will be used to change an event's location from |
48 // the touchscreen's coordinate system into |display|'s coordinate system. | 48 // the touchscreen's coordinate system into |display|'s coordinate system. |
49 // The transform is also responsible for properly scaling the display if the | 49 // The transform is also responsible for properly scaling the display if the |
50 // display supports panel fitting. | 50 // display supports panel fitting. |
51 // | 51 // |
52 // On X11 events are reported in framebuffer coordinate space, so the | 52 // On X11 events are reported in framebuffer coordinate space, so the |
53 // |framebuffer_size| is used for scaling. | 53 // |framebuffer_size| is used for scaling. |
54 // On Ozone events are reported in the touchscreen's resolution, so | 54 // On Ozone events are reported in the touchscreen's resolution, so |
55 // |touch_display| is used to determine the size and scale the event. | 55 // |touch_display| is used to determine the size and scale the event. |
56 gfx::Transform GetTouchTransform(const DisplayInfo& display, | 56 gfx::Transform GetTouchTransform( |
57 const DisplayInfo& touch_display, | 57 const display::ManagedDisplayInfo& display, |
58 const ui::TouchscreenDevice& touchscreen, | 58 const display::ManagedDisplayInfo& touch_display, |
59 const gfx::Size& framebuffer_size) const; | 59 const ui::TouchscreenDevice& touchscreen, |
| 60 const gfx::Size& framebuffer_size) const; |
60 | 61 |
61 // Returns the scaling factor for the touch radius such that it scales the | 62 // Returns the scaling factor for the touch radius such that it scales the |
62 // radius from |touch_device|'s coordinate system to the |touch_display|'s | 63 // radius from |touch_device|'s coordinate system to the |touch_display|'s |
63 // coordinate system. | 64 // coordinate system. |
64 double GetTouchResolutionScale( | 65 double GetTouchResolutionScale( |
65 const DisplayInfo& touch_display, | 66 const display::ManagedDisplayInfo& touch_display, |
66 const ui::TouchscreenDevice& touch_device) const; | 67 const ui::TouchscreenDevice& touch_device) const; |
67 | 68 |
68 // For the provided |display| update the touch radius mapping. | 69 // For the provided |display| update the touch radius mapping. |
69 void UpdateTouchRadius(const DisplayInfo& display) const; | 70 void UpdateTouchRadius(const display::ManagedDisplayInfo& display) const; |
70 | 71 |
71 // For a given |target_display| and |target_display_id| update the touch | 72 // For a given |target_display| and |target_display_id| update the touch |
72 // transformation based on the touchscreen associated with |touch_display|. | 73 // transformation based on the touchscreen associated with |touch_display|. |
73 // |target_display_id| is the display id whose root window will receive the | 74 // |target_display_id| is the display id whose root window will receive the |
74 // touch events. | 75 // touch events. |
75 // |touch_display| is the physical display that has the touchscreen | 76 // |touch_display| is the physical display that has the touchscreen |
76 // from which the events arrive. | 77 // from which the events arrive. |
77 // |target_display| provides the dimensions to which the touch event will be | 78 // |target_display| provides the dimensions to which the touch event will be |
78 // transformed. | 79 // transformed. |
79 void UpdateTouchTransform(int64_t target_display_id, | 80 void UpdateTouchTransform( |
80 const DisplayInfo& touch_display, | 81 int64_t target_display_id, |
81 const DisplayInfo& target_display) const; | 82 const display::ManagedDisplayInfo& touch_display, |
| 83 const display::ManagedDisplayInfo& target_display) const; |
82 | 84 |
83 DISALLOW_COPY_AND_ASSIGN(TouchTransformerController); | 85 DISALLOW_COPY_AND_ASSIGN(TouchTransformerController); |
84 }; | 86 }; |
85 | 87 |
86 } // namespace ash | 88 } // namespace ash |
87 | 89 |
88 #endif // ASH_TOUCH_TOUCH_TRANSFORMER_CONTROLLER_H_ | 90 #endif // ASH_TOUCH_TOUCH_TRANSFORMER_CONTROLLER_H_ |
OLD | NEW |