| Index: ash/touch/touch_transformer_controller_x11.cc
|
| diff --git a/ash/touch/touch_transformer_controller.cc b/ash/touch/touch_transformer_controller_x11.cc
|
| similarity index 92%
|
| rename from ash/touch/touch_transformer_controller.cc
|
| rename to ash/touch/touch_transformer_controller_x11.cc
|
| index 8ff8ad5c3ea4afc931b2a3a412d7a4e81e6e4667..26e338b264d69abf42865b53c4842dd6df848c16 100644
|
| --- a/ash/touch/touch_transformer_controller.cc
|
| +++ b/ash/touch/touch_transformer_controller_x11.cc
|
| @@ -43,11 +43,13 @@ double TouchTransformerController::GetTouchResolutionScale(
|
| if (!ui::DeviceDataManagerX11::GetInstance()->GetDataRange(
|
| touch_display.touch_device_id(),
|
| ui::DeviceDataManagerX11::DT_TOUCH_POSITION_X,
|
| - &min_x, &max_x) ||
|
| + &min_x,
|
| + &max_x) ||
|
| !ui::DeviceDataManagerX11::GetInstance()->GetDataRange(
|
| touch_display.touch_device_id(),
|
| ui::DeviceDataManagerX11::DT_TOUCH_POSITION_Y,
|
| - &min_y, &max_y)) {
|
| + &min_y,
|
| + &max_y)) {
|
| return 1.0;
|
| }
|
|
|
| @@ -73,12 +75,11 @@ double TouchTransformerController::GetTouchResolutionScale(
|
| // This function computes the extended mode TouchTransformer for
|
| // |touch_display|. The TouchTransformer maps the touch event position
|
| // from framebuffer size to the display size.
|
| -gfx::Transform
|
| -TouchTransformerController::GetExtendedModeTouchTransformer(
|
| - const DisplayInfo& touch_display, const gfx::Size& fb_size) const {
|
| +gfx::Transform TouchTransformerController::GetExtendedModeTouchTransformer(
|
| + const DisplayInfo& touch_display,
|
| + const gfx::Size& fb_size) const {
|
| gfx::Transform ctm;
|
| - if (touch_display.touch_device_id() == 0 ||
|
| - fb_size.width() == 0.0 ||
|
| + if (touch_display.touch_device_id() == 0 || fb_size.width() == 0.0 ||
|
| fb_size.height() == 0.0)
|
| return ctm;
|
| float width = touch_display.bounds_in_native().width();
|
| @@ -122,8 +123,8 @@ gfx::Transform TouchTransformerController::GetMirrorModeTouchTransformer(
|
| float native_width = native_mode_size.width();
|
| float native_height = native_mode_size.height();
|
|
|
| - if (native_height == 0.0 || mirror_height == 0.0 ||
|
| - native_width == 0.0 || mirror_width == 0.0)
|
| + if (native_height == 0.0 || mirror_height == 0.0 || native_width == 0.0 ||
|
| + mirror_width == 0.0)
|
| return ctm;
|
|
|
| float native_ar = native_width / native_height;
|
| @@ -146,8 +147,8 @@ gfx::Transform TouchTransformerController::GetMirrorModeTouchTransformer(
|
| return ctm; // Same aspect ratio - return identity
|
| }
|
|
|
| -TouchTransformerController::TouchTransformerController() :
|
| - force_compute_mirror_mode_touch_transformer_ (false) {
|
| +TouchTransformerController::TouchTransformerController()
|
| + : force_compute_mirror_mode_touch_transformer_(false) {
|
| Shell::GetInstance()->display_controller()->AddObserver(this);
|
| }
|
|
|
| @@ -219,13 +220,13 @@ void TouchTransformerController::UpdateTouchTransformer() const {
|
| Shell::GetInstance()->display_configurator()->framebuffer_size();
|
| // In extended but software mirroring mode, ther is only one X root window
|
| // that associates with both displays.
|
| - if (GetDisplayManager()->software_mirroring_enabled()) {
|
| + if (GetDisplayManager()->software_mirroring_enabled()) {
|
| aura::Window* root = display_controller->GetPrimaryRootWindow();
|
| RootWindowController::ForWindow(root)->ash_host()->UpdateDisplayID(
|
| display1_id, display2_id);
|
| DisplayInfo source_display =
|
| - gfx::Display::InternalDisplayId() == display1_id ?
|
| - display1 : display2;
|
| + gfx::Display::InternalDisplayId() == display1_id ? display1
|
| + : display2;
|
| // Mapping from framebuffer size to the source display's native
|
| // resolution.
|
| device_manager->UpdateTouchInfoForDisplay(
|
| @@ -265,9 +266,8 @@ void TouchTransformerController::UpdateTouchTransformer() const {
|
| display_controller->GetRootWindowForDisplayId(single_display.id());
|
| RootWindowController::ForWindow(root)->ash_host()->UpdateDisplayID(
|
| single_display.id(), gfx::Display::kInvalidDisplayID);
|
| - device_manager->UpdateTouchInfoForDisplay(single_display_id,
|
| - single_display.touch_device_id(),
|
| - gfx::Transform());
|
| + device_manager->UpdateTouchInfoForDisplay(
|
| + single_display_id, single_display.touch_device_id(), gfx::Transform());
|
| }
|
|
|
| void TouchTransformerController::OnDisplaysInitialized() {
|
|
|