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 UI_DISPLAY_MANAGER_CHROMEOS_TOUCH_TRANSFORM_CONTROLLER_H_ | 5 #ifndef UI_DISPLAY_MANAGER_CHROMEOS_TOUCH_TRANSFORM_CONTROLLER_H_ |
6 #define UI_DISPLAY_MANAGER_CHROMEOS_TOUCH_TRANSFORM_CONTROLLER_H_ | 6 #define UI_DISPLAY_MANAGER_CHROMEOS_TOUCH_TRANSFORM_CONTROLLER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "ui/display/manager/display_manager_export.h" | 9 #include "ui/display/manager/display_manager_export.h" |
10 #include "ui/gfx/geometry/size.h" | 10 #include "ui/gfx/geometry/size.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 class DISPLAY_MANAGER_EXPORT TouchTransformController { | 31 class DISPLAY_MANAGER_EXPORT TouchTransformController { |
32 public: | 32 public: |
33 TouchTransformController(DisplayConfigurator* display_configurator, | 33 TouchTransformController(DisplayConfigurator* display_configurator, |
34 DisplayManager* display_manager); | 34 DisplayManager* display_manager); |
35 ~TouchTransformController(); | 35 ~TouchTransformController(); |
36 | 36 |
37 // Updates the transform for touch input-devices and pushes the new transforms | 37 // Updates the transform for touch input-devices and pushes the new transforms |
38 // into device manager. | 38 // into device manager. |
39 void UpdateTouchTransforms() const; | 39 void UpdateTouchTransforms() const; |
40 | 40 |
| 41 // During touch calibration we remove the previous transform and update touch |
| 42 // transformer until calibration is complete. |
| 43 void SetForCalibration(bool is_calibrating); |
| 44 |
41 private: | 45 private: |
42 friend class test::TouchTransformControllerTest; | 46 friend class test::TouchTransformControllerTest; |
43 | 47 |
44 // Returns a transform that will be used to change an event's location from | 48 // Returns a transform that will be used to change an event's location from |
45 // the touchscreen's coordinate system into |display|'s coordinate system. | 49 // the touchscreen's coordinate system into |display|'s coordinate system. |
46 // The transform is also responsible for properly scaling the display if the | 50 // The transform is also responsible for properly scaling the display if the |
47 // display supports panel fitting. | 51 // display supports panel fitting. |
48 // | 52 // |
49 // On X11 events are reported in framebuffer coordinate space, so the | 53 // On X11 events are reported in framebuffer coordinate space, so the |
50 // |framebuffer_size| is used for scaling. | 54 // |framebuffer_size| is used for scaling. |
(...skipping 24 matching lines...) Expand all Loading... |
75 // transformed. | 79 // transformed. |
76 void UpdateTouchTransform(int64_t target_display_id, | 80 void UpdateTouchTransform(int64_t target_display_id, |
77 const ManagedDisplayInfo& touch_display, | 81 const ManagedDisplayInfo& touch_display, |
78 const ManagedDisplayInfo& target_display) const; | 82 const ManagedDisplayInfo& target_display) const; |
79 | 83 |
80 // Both |display_configurator_| and |display_manager_| are not owned and must | 84 // Both |display_configurator_| and |display_manager_| are not owned and must |
81 // outlive TouchTransformController. | 85 // outlive TouchTransformController. |
82 DisplayConfigurator* display_configurator_; | 86 DisplayConfigurator* display_configurator_; |
83 DisplayManager* display_manager_; | 87 DisplayManager* display_manager_; |
84 | 88 |
| 89 bool is_calibrating_ = false; |
| 90 |
85 DISALLOW_COPY_AND_ASSIGN(TouchTransformController); | 91 DISALLOW_COPY_AND_ASSIGN(TouchTransformController); |
86 }; | 92 }; |
87 | 93 |
88 } // namespace display | 94 } // namespace display |
89 | 95 |
90 #endif // UI_DISPLAY_MANAGER_CHROMEOS_TOUCH_TRANSFORM_CONTROLLER_H_ | 96 #endif // UI_DISPLAY_MANAGER_CHROMEOS_TOUCH_TRANSFORM_CONTROLLER_H_ |
OLD | NEW |