X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fash%2Ftouch%2Ftouch_transformer_controller.h;h=b210c04fba7c09953fdfc77f38610de00870f138;hb=1afa4dd80ef85af7c90efaea6959db1d92330844;hp=8512186603d757b0bb8d096596e469130f0f9077;hpb=90762837333c13ccf56f2ad88e4481fc71e8d281;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/ash/touch/touch_transformer_controller.h b/src/ash/touch/touch_transformer_controller.h index 8512186..b210c04 100644 --- a/src/ash/touch/touch_transformer_controller.h +++ b/src/ash/touch/touch_transformer_controller.h @@ -9,6 +9,10 @@ #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 @@ -24,8 +28,8 @@ class ASH_EXPORT TouchTransformerController 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, @@ -37,19 +41,26 @@ class ASH_EXPORT TouchTransformerController 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); };