Chromium Code Reviews| 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 17 matching lines...) Expand all Loading... | |
| 28 ~TouchTransformerController() override; | 28 ~TouchTransformerController() override; |
| 29 | 29 |
| 30 // Updates the TouchTransformer for touch device and pushes the new | 30 // Updates the TouchTransformer for touch device and pushes the new |
| 31 // TouchTransformer into device manager. | 31 // TouchTransformer into device manager. |
| 32 void UpdateTouchTransformer() const; | 32 void UpdateTouchTransformer() const; |
| 33 | 33 |
| 34 // WindowTreeHostManager::Observer: | 34 // WindowTreeHostManager::Observer: |
| 35 void OnDisplaysInitialized() override; | 35 void OnDisplaysInitialized() override; |
| 36 void OnDisplayConfigurationChanged() override; | 36 void OnDisplayConfigurationChanged() override; |
| 37 | 37 |
| 38 // During touch calibration we remove any kind of transform that is being | |
| 39 // applied to the touch input's location. | |
|
kylechar
2016/12/19 20:00:21
This also updates the transforms right?
malaykeshav
2016/12/20 09:56:04
No. This only sets the TouchTransformerController
kylechar
2016/12/20 17:41:28
What does the call to UpdateTouchTransformer() do
malaykeshav
2016/12/20 19:16:55
Correct. When the calibration is under process (Se
| |
| 40 void SetForCalibration(bool is_calibrating); | |
| 41 | |
| 38 private: | 42 private: |
| 39 FRIEND_TEST_ALL_PREFIXES(TouchTransformerControllerTest, | 43 FRIEND_TEST_ALL_PREFIXES(TouchTransformerControllerTest, |
|
kylechar
2016/12/19 20:00:21
Would it just be simpler to make TouchTransformerC
malaykeshav
2016/12/20 09:56:05
Done
kylechar
2016/12/20 17:41:28
This wasn't done?
malaykeshav
2016/12/20 19:16:55
I was unable to friend class TouchTransformerContr
malaykeshav
2016/12/21 05:49:42
Done
| |
| 40 MirrorModeLetterboxing); | 44 MirrorModeLetterboxing); |
| 41 FRIEND_TEST_ALL_PREFIXES(TouchTransformerControllerTest, | 45 FRIEND_TEST_ALL_PREFIXES(TouchTransformerControllerTest, |
| 42 MirrorModePillarboxing); | 46 MirrorModePillarboxing); |
| 43 FRIEND_TEST_ALL_PREFIXES(TouchTransformerControllerTest, SoftwareMirrorMode); | 47 FRIEND_TEST_ALL_PREFIXES(TouchTransformerControllerTest, SoftwareMirrorMode); |
| 44 FRIEND_TEST_ALL_PREFIXES(TouchTransformerControllerTest, ExtendedMode); | 48 FRIEND_TEST_ALL_PREFIXES(TouchTransformerControllerTest, ExtendedMode); |
| 45 FRIEND_TEST_ALL_PREFIXES(TouchTransformerControllerTest, TouchRadiusScale); | 49 FRIEND_TEST_ALL_PREFIXES(TouchTransformerControllerTest, TouchRadiusScale); |
| 50 FRIEND_TEST_ALL_PREFIXES(TouchTransformerControllerTest, OzoneTrasnlation); | |
| 51 FRIEND_TEST_ALL_PREFIXES(TouchTransformerControllerTest, | |
| 52 AccurateUserTouchCalibration); | |
| 53 FRIEND_TEST_ALL_PREFIXES(TouchTransformerControllerTest, | |
| 54 ErrorProneUserTouchCalibration); | |
| 55 FRIEND_TEST_ALL_PREFIXES(TouchTransformerControllerTest, | |
| 56 ResolutionChangeUserTouchCalibration); | |
| 57 FRIEND_TEST_ALL_PREFIXES(TouchTransformerControllerTest, | |
| 58 DifferentBoundsUserTouchCalibration); | |
| 59 FRIEND_TEST_ALL_PREFIXES(TouchTransformerControllerTest, | |
| 60 LetterboxingUserTouchCalibration); | |
| 61 FRIEND_TEST_ALL_PREFIXES(TouchTransformerControllerTest, | |
| 62 PillarBoxingUserTouchCalibration); | |
| 46 | 63 |
| 47 // Returns a transform that will be used to change an event's location from | 64 // 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. | 65 // the touchscreen's coordinate system into |display|'s coordinate system. |
| 49 // The transform is also responsible for properly scaling the display if the | 66 // The transform is also responsible for properly scaling the display if the |
| 50 // display supports panel fitting. | 67 // display supports panel fitting. |
| 51 // | 68 // |
| 52 // On X11 events are reported in framebuffer coordinate space, so the | 69 // On X11 events are reported in framebuffer coordinate space, so the |
| 53 // |framebuffer_size| is used for scaling. | 70 // |framebuffer_size| is used for scaling. |
| 54 // On Ozone events are reported in the touchscreen's resolution, so | 71 // On Ozone events are reported in the touchscreen's resolution, so |
| 55 // |touch_display| is used to determine the size and scale the event. | 72 // |touch_display| is used to determine the size and scale the event. |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 75 // touch events. | 92 // touch events. |
| 76 // |touch_display| is the physical display that has the touchscreen | 93 // |touch_display| is the physical display that has the touchscreen |
| 77 // from which the events arrive. | 94 // from which the events arrive. |
| 78 // |target_display| provides the dimensions to which the touch event will be | 95 // |target_display| provides the dimensions to which the touch event will be |
| 79 // transformed. | 96 // transformed. |
| 80 void UpdateTouchTransform( | 97 void UpdateTouchTransform( |
| 81 int64_t target_display_id, | 98 int64_t target_display_id, |
| 82 const display::ManagedDisplayInfo& touch_display, | 99 const display::ManagedDisplayInfo& touch_display, |
| 83 const display::ManagedDisplayInfo& target_display) const; | 100 const display::ManagedDisplayInfo& target_display) const; |
| 84 | 101 |
| 102 bool is_calibrating_ = false; | |
| 103 | |
| 85 DISALLOW_COPY_AND_ASSIGN(TouchTransformerController); | 104 DISALLOW_COPY_AND_ASSIGN(TouchTransformerController); |
| 86 }; | 105 }; |
| 87 | 106 |
| 88 } // namespace ash | 107 } // namespace ash |
| 89 | 108 |
| 90 #endif // ASH_TOUCH_TOUCH_TRANSFORMER_CONTROLLER_H_ | 109 #endif // ASH_TOUCH_TOUCH_TRANSFORMER_CONTROLLER_H_ |
| OLD | NEW |