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_EVENTS_DEVICE_DATA_MANAGER_H_ | 5 #ifndef UI_EVENTS_DEVICE_DATA_MANAGER_H_ |
6 #define UI_EVENTS_DEVICE_DATA_MANAGER_H_ | 6 #define UI_EVENTS_DEVICE_DATA_MANAGER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 static DeviceDataManager* GetInstance(); | 23 static DeviceDataManager* GetInstance(); |
24 static bool HasInstance(); | 24 static bool HasInstance(); |
25 | 25 |
26 void ClearTouchTransformerRecord(); | 26 void ClearTouchTransformerRecord(); |
27 void UpdateTouchInfoForDisplay(int64_t display_id, | 27 void UpdateTouchInfoForDisplay(int64_t display_id, |
28 int touch_device_id, | 28 int touch_device_id, |
29 const gfx::Transform& touch_transformer); | 29 const gfx::Transform& touch_transformer); |
30 void ApplyTouchTransformer(int touch_device_id, float* x, float* y); | 30 void ApplyTouchTransformer(int touch_device_id, float* x, float* y); |
31 int64_t GetDisplayForTouchDevice(int touch_device_id) const; | 31 int64_t GetDisplayForTouchDevice(int touch_device_id) const; |
32 | 32 |
| 33 void UpdateTouchRadiusScale(int touch_device_id, double scale); |
| 34 void ApplyTouchRadiusScale(int touch_device_id, double* radius); |
| 35 |
33 protected: | 36 protected: |
34 DeviceDataManager(); | 37 DeviceDataManager(); |
35 | 38 |
36 static DeviceDataManager* instance(); | 39 static DeviceDataManager* instance(); |
37 | 40 |
38 static const int kMaxDeviceNum = 128; | 41 static const int kMaxDeviceNum = 128; |
39 | 42 |
40 private: | 43 private: |
41 static DeviceDataManager* instance_; | 44 static DeviceDataManager* instance_; |
42 | 45 |
43 bool IsTouchDeviceIdValid(int touch_device_id) const; | 46 bool IsTouchDeviceIdValid(int touch_device_id) const; |
44 | 47 |
| 48 double touch_radius_scale_map_[kMaxDeviceNum]; |
| 49 |
45 // Table to keep track of which display id is mapped to which touch device. | 50 // Table to keep track of which display id is mapped to which touch device. |
46 int64_t touch_device_to_display_map_[kMaxDeviceNum]; | 51 int64_t touch_device_to_display_map_[kMaxDeviceNum]; |
47 // Index table to find the TouchTransformer for a touch device. | 52 // Index table to find the TouchTransformer for a touch device. |
48 gfx::Transform touch_device_transformer_map_[kMaxDeviceNum]; | 53 gfx::Transform touch_device_transformer_map_[kMaxDeviceNum]; |
49 | 54 |
50 DISALLOW_COPY_AND_ASSIGN(DeviceDataManager); | 55 DISALLOW_COPY_AND_ASSIGN(DeviceDataManager); |
51 }; | 56 }; |
52 | 57 |
53 } // namespace ui | 58 } // namespace ui |
54 | 59 |
55 #endif // UI_EVENTS_DEVICE_DATA_MANAGER_H_ | 60 #endif // UI_EVENTS_DEVICE_DATA_MANAGER_H_ |
OLD | NEW |