Commit b03278a7 authored by miletus's avatar miletus Committed by Commit bot

TouchTransformer for software mirroring mode

In software mirroring mode, there is one X root window and it should
be associated with both displays (touchscreens).

BUG=chrome-os-partner:31466
TEST=tested on Big with clone mode.

Review URL: https://codereview.chromium.org/557073002

Cr-Commit-Position: refs/heads/master@{#294407}
parent 8f132304
...@@ -197,7 +197,6 @@ void TouchTransformerController::UpdateTouchTransformer() const { ...@@ -197,7 +197,6 @@ void TouchTransformerController::UpdateTouchTransformer() const {
return; return;
} else if (display_state == ui::MULTIPLE_DISPLAY_STATE_DUAL_MIRROR || } else if (display_state == ui::MULTIPLE_DISPLAY_STATE_DUAL_MIRROR ||
display_state == ui::MULTIPLE_DISPLAY_STATE_DUAL_EXTENDED) { display_state == ui::MULTIPLE_DISPLAY_STATE_DUAL_EXTENDED) {
// TODO(miletus) : Handle DUAL_EXTENDED with software mirroring.
DisplayIdPair id_pair = GetDisplayManager()->GetCurrentDisplayIdPair(); DisplayIdPair id_pair = GetDisplayManager()->GetCurrentDisplayIdPair();
display1_id = id_pair.first; display1_id = id_pair.first;
display2_id = id_pair.second; display2_id = id_pair.second;
...@@ -236,11 +235,30 @@ void TouchTransformerController::UpdateTouchTransformer() const { ...@@ -236,11 +235,30 @@ void TouchTransformerController::UpdateTouchTransformer() const {
} }
if (display_state == ui::MULTIPLE_DISPLAY_STATE_DUAL_EXTENDED) { if (display_state == ui::MULTIPLE_DISPLAY_STATE_DUAL_EXTENDED) {
// TODO(miletus) : Handle the case the state is DUAL_EXTENDED but it gfx::Size fb_size =
// is actually doing software mirroring. Shell::GetInstance()->display_configurator()->framebuffer_size();
if (GetDisplayManager()->software_mirroring_enabled()) // In extended but software mirroring mode, ther is only one X root window
return; // that associates with both displays.
// In extended mode, each display is associated with one root window. 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;
// Mapping from framebuffer size to the source display's native
// resolution.
device_manager->UpdateTouchInfoForDisplay(
display1_id,
display1.touch_device_id(),
GetExtendedModeTouchTransformer(source_display, fb_size));
device_manager->UpdateTouchInfoForDisplay(
display2_id,
display2.touch_device_id(),
GetExtendedModeTouchTransformer(source_display, fb_size));
} else {
// In actual extended mode, each display is associated with one root
// window.
aura::Window* root1 = aura::Window* root1 =
display_controller->GetRootWindowForDisplayId(display1_id); display_controller->GetRootWindowForDisplayId(display1_id);
aura::Window* root2 = aura::Window* root2 =
...@@ -249,8 +267,7 @@ void TouchTransformerController::UpdateTouchTransformer() const { ...@@ -249,8 +267,7 @@ void TouchTransformerController::UpdateTouchTransformer() const {
display1_id, gfx::Display::kInvalidDisplayID); display1_id, gfx::Display::kInvalidDisplayID);
RootWindowController::ForWindow(root2)->ash_host()->UpdateDisplayID( RootWindowController::ForWindow(root2)->ash_host()->UpdateDisplayID(
display2_id, gfx::Display::kInvalidDisplayID); display2_id, gfx::Display::kInvalidDisplayID);
gfx::Size fb_size = // Mapping from framebuffer size to each display's native resolution.
Shell::GetInstance()->display_configurator()->framebuffer_size();
device_manager->UpdateTouchInfoForDisplay( device_manager->UpdateTouchInfoForDisplay(
display1_id, display1_id,
display1.touch_device_id(), display1.touch_device_id(),
...@@ -259,6 +276,7 @@ void TouchTransformerController::UpdateTouchTransformer() const { ...@@ -259,6 +276,7 @@ void TouchTransformerController::UpdateTouchTransformer() const {
display2_id, display2_id,
display2.touch_device_id(), display2.touch_device_id(),
GetExtendedModeTouchTransformer(display2, fb_size)); GetExtendedModeTouchTransformer(display2, fb_size));
}
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment