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(const ui::ManagedDisplayInfo& display, |
57 const DisplayInfo& touch_display, | 57 const ui::ManagedDisplayInfo& touch_display, |
58 const ui::TouchscreenDevice& touchscreen, | 58 const ui::TouchscreenDevice& touchscreen, |
59 const gfx::Size& framebuffer_size) const; | 59 const gfx::Size& framebuffer_size) const; |
60 | 60 |
61 // Returns the scaling factor for the touch radius such that it scales the | 61 // 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 | 62 // radius from |touch_device|'s coordinate system to the |touch_display|'s |
63 // coordinate system. | 63 // coordinate system. |
64 double GetTouchResolutionScale( | 64 double GetTouchResolutionScale( |
65 const DisplayInfo& touch_display, | 65 const ui::ManagedDisplayInfo& touch_display, |
66 const ui::TouchscreenDevice& touch_device) const; | 66 const ui::TouchscreenDevice& touch_device) const; |
67 | 67 |
68 // For the provided |display| update the touch radius mapping. | 68 // For the provided |display| update the touch radius mapping. |
69 void UpdateTouchRadius(const DisplayInfo& display) const; | 69 void UpdateTouchRadius(const ui::ManagedDisplayInfo& display) const; |
70 | 70 |
71 // For a given |target_display| and |target_display_id| update the touch | 71 // For a given |target_display| and |target_display_id| update the touch |
72 // transformation based on the touchscreen associated with |touch_display|. | 72 // transformation based on the touchscreen associated with |touch_display|. |
73 // |target_display_id| is the display id whose root window will receive the | 73 // |target_display_id| is the display id whose root window will receive the |
74 // touch events. | 74 // touch events. |
75 // |touch_display| is the physical display that has the touchscreen | 75 // |touch_display| is the physical display that has the touchscreen |
76 // from which the events arrive. | 76 // from which the events arrive. |
77 // |target_display| provides the dimensions to which the touch event will be | 77 // |target_display| provides the dimensions to which the touch event will be |
78 // transformed. | 78 // transformed. |
79 void UpdateTouchTransform(int64_t target_display_id, | 79 void UpdateTouchTransform(int64_t target_display_id, |
80 const DisplayInfo& touch_display, | 80 const ui::ManagedDisplayInfo& touch_display, |
81 const DisplayInfo& target_display) const; | 81 const ui::ManagedDisplayInfo& target_display) const; |
82 | 82 |
83 DISALLOW_COPY_AND_ASSIGN(TouchTransformerController); | 83 DISALLOW_COPY_AND_ASSIGN(TouchTransformerController); |
84 }; | 84 }; |
85 | 85 |
86 } // namespace ash | 86 } // namespace ash |
87 | 87 |
88 #endif // ASH_TOUCH_TOUCH_TRANSFORMER_CONTROLLER_H_ | 88 #endif // ASH_TOUCH_TOUCH_TRANSFORMER_CONTROLLER_H_ |
OLD | NEW |