#include "ash/display/display_controller.h"
#include "ui/gfx/transform.h"
+namespace ui {
+struct TouchscreenDevice;
+} // namespace ui
+
namespace ash {
// TouchTransformerController listens to display configuration change
void UpdateTouchTransformer() const;
// DisplayController::Observer:
- virtual void OnDisplaysInitialized() OVERRIDE;
- virtual void OnDisplayConfigurationChanged() OVERRIDE;
+ virtual void OnDisplaysInitialized() override;
+ virtual void OnDisplayConfigurationChanged() override;
private:
FRIEND_TEST_ALL_PREFIXES(TouchTransformerControllerTest,
FRIEND_TEST_ALL_PREFIXES(TouchTransformerControllerTest,
TouchRadiusScale);
- bool ShouldComputeMirrorModeTouchTransformer(
- const DisplayInfo& touch_display) const ;
-
- gfx::Transform GetMirrorModeTouchTransformer(
- const DisplayInfo& touch_display) const;
-
- gfx::Transform GetExtendedModeTouchTransformer(
- const DisplayInfo& touch_display, const gfx::Size& fb_size) const;
-
- double GetTouchResolutionScale(const DisplayInfo& touch_display) const;
+ // Returns a transform that will be used to change an event's location from
+ // the touchscreen's coordinate system into the display's coordinate system.
+ // The transform is also responsible for properly scaling the display if the
+ // display support panel fitting.
+ //
+ // On X11 events are reported in framebuffer coordinate space, so the
+ // |framebuffer_size| is used for scaling.
+ // On Ozone events are reported in the touchscreen's resolution, so
+ // |touchscreen| is used to determine the size and scale the event.
+ gfx::Transform GetTouchTransform(
+ const DisplayInfo& display,
+ const ui::TouchscreenDevice& touchscreen,
+ const gfx::Size& framebuffer_size) const;
- // For unittests only.
- bool force_compute_mirror_mode_touch_transformer_;
+ // Returns the scaling factor for the touch radius such that it scales the
+ // radius from |touch_device|'s coordiante system to the |touch_display|'s
+ // coordinate system.
+ double GetTouchResolutionScale(
+ const DisplayInfo& touch_display,
+ const ui::TouchscreenDevice& touch_device) const;
DISALLOW_COPY_AND_ASSIGN(TouchTransformerController);
};