Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(132)

Side by Side Diff: ash/touch/touch_transformer_controller.h

Issue 688183002: Refactor TouchTransformerConverter to allow support for Ozone (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mv-touch-transformer
Patch Set: Rebased Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/shell.cc ('k') | ash/touch/touch_transformer_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "ash/ash_export.h" 8 #include "ash/ash_export.h"
9 #include "ash/display/display_controller.h" 9 #include "ash/display/display_controller.h"
10 #include "ui/gfx/transform.h" 10 #include "ui/gfx/transform.h"
(...skipping 23 matching lines...) Expand all
34 private: 34 private:
35 FRIEND_TEST_ALL_PREFIXES(TouchTransformerControllerTest, 35 FRIEND_TEST_ALL_PREFIXES(TouchTransformerControllerTest,
36 TouchTransformerMirrorModeLetterboxing); 36 TouchTransformerMirrorModeLetterboxing);
37 FRIEND_TEST_ALL_PREFIXES(TouchTransformerControllerTest, 37 FRIEND_TEST_ALL_PREFIXES(TouchTransformerControllerTest,
38 TouchTransformerMirrorModePillarboxing); 38 TouchTransformerMirrorModePillarboxing);
39 FRIEND_TEST_ALL_PREFIXES(TouchTransformerControllerTest, 39 FRIEND_TEST_ALL_PREFIXES(TouchTransformerControllerTest,
40 TouchTransformerExtendedMode); 40 TouchTransformerExtendedMode);
41 FRIEND_TEST_ALL_PREFIXES(TouchTransformerControllerTest, 41 FRIEND_TEST_ALL_PREFIXES(TouchTransformerControllerTest,
42 TouchRadiusScale); 42 TouchRadiusScale);
43 43
44 bool ShouldComputeMirrorModeTouchTransformer( 44 // Returns a transform that will be used to change an event's location from
45 const DisplayInfo& touch_display) const ; 45 // the touchscreen's coordinate system into the display's coordinate system.
46 46 // The transform is also responsible for properly scaling the display if the
47 gfx::Transform GetMirrorModeTouchTransformer( 47 // display support panel fitting.
48 const DisplayInfo& touch_display) const; 48 //
49 49 // On X11 events are reported in framebuffer coordinate space, so the
50 gfx::Transform GetExtendedModeTouchTransformer( 50 // |framebuffer_size| is used for scaling.
51 const DisplayInfo& touch_display, const gfx::Size& fb_size) const; 51 // On Ozone events are reported in the touchscreen's resolution, so
52 // |touchscreen| is used to determine the size and scale the event.
53 gfx::Transform GetTouchTransform(
54 const DisplayInfo& display,
55 const ui::TouchscreenDevice& touchscreen,
56 const gfx::Size& framebuffer_size) const;
52 57
53 // Returns the scaling factor for the touch radius such that it scales the 58 // Returns the scaling factor for the touch radius such that it scales the
54 // radius from |touch_device|'s coordiante system to the |touch_display|'s 59 // radius from |touch_device|'s coordiante system to the |touch_display|'s
55 // coordinate system. 60 // coordinate system.
56 double GetTouchResolutionScale( 61 double GetTouchResolutionScale(
57 const DisplayInfo& touch_display, 62 const DisplayInfo& touch_display,
58 const ui::TouchscreenDevice& touch_device) const; 63 const ui::TouchscreenDevice& touch_device) const;
59 64
60 // For unittests only.
61 bool force_compute_mirror_mode_touch_transformer_;
62
63 DISALLOW_COPY_AND_ASSIGN(TouchTransformerController); 65 DISALLOW_COPY_AND_ASSIGN(TouchTransformerController);
64 }; 66 };
65 67
66 } // namespace ash 68 } // namespace ash
67 69
68 #endif // ASH_TOUCH_TOUCH_TRANSFORMER_CONTROLLER_H_ 70 #endif // ASH_TOUCH_TOUCH_TRANSFORMER_CONTROLLER_H_
OLDNEW
« no previous file with comments | « ash/shell.cc ('k') | ash/touch/touch_transformer_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698