| Index: chromeos/display/output_configurator.cc
|
| diff --git a/chromeos/display/output_configurator.cc b/chromeos/display/output_configurator.cc
|
| index bc6124815ce0aeef3a7a47bdcde20e7086602deb..984838a96f9bda41731232d032e891b5fc59e671 100644
|
| --- a/chromeos/display/output_configurator.cc
|
| +++ b/chromeos/display/output_configurator.cc
|
| @@ -123,12 +123,6 @@ OutputConfigurator::ModeInfo::ModeInfo(int width,
|
| interlaced(interlaced),
|
| refresh_rate(refresh_rate) {}
|
|
|
| -OutputConfigurator::CoordinateTransformation::CoordinateTransformation()
|
| - : x_scale(1.0),
|
| - x_offset(0.0),
|
| - y_scale(1.0),
|
| - y_offset(0.0) {}
|
| -
|
| OutputConfigurator::OutputSnapshot::OutputSnapshot()
|
| : output(None),
|
| crtc(None),
|
| @@ -804,11 +798,8 @@ bool OutputConfigurator::EnterState(ui::OutputState output_state,
|
| output->y = 0;
|
| output->current_mode = output_power[i] ? output->mirror_mode : None;
|
| if (output->touch_device_id) {
|
| - // CTM needs to be calculated if aspect preserving scaling is used.
|
| - // Otherwise, assume it is full screen, and use identity CTM.
|
| if (output->mirror_mode != output->native_mode &&
|
| output->is_aspect_preserving_scaling) {
|
| - output->transform = GetMirrorModeCTM(*output);
|
| mirrored_display_area_ratio_map_[output->touch_device_id] =
|
| GetMirroredDisplayAreaRatio(*output);
|
| }
|
| @@ -841,12 +832,6 @@ bool OutputConfigurator::EnterState(ui::OutputState output_state,
|
| width = std::max<int>(width, mode_info->width);
|
| height += (height ? kVerticalGap : 0) + mode_info->height;
|
| }
|
| -
|
| - for (size_t i = 0; i < updated_outputs.size(); ++i) {
|
| - OutputSnapshot* output = &updated_outputs[i];
|
| - if (output->touch_device_id)
|
| - output->transform = GetExtendedModeCTM(*output, width, height);
|
| - }
|
| break;
|
| }
|
| }
|
| @@ -899,9 +884,6 @@ bool OutputConfigurator::EnterState(ui::OutputState output_state,
|
| }
|
|
|
| if (configure_succeeded) {
|
| - if (output.touch_device_id)
|
| - touchscreen_delegate_->ConfigureCTM(output.touch_device_id,
|
| - output.transform);
|
| cached_outputs_[i] = updated_outputs[i];
|
| } else {
|
| all_succeeded = false;
|
| @@ -956,80 +938,6 @@ ui::OutputState OutputConfigurator::ChooseOutputState(
|
| return ui::OUTPUT_STATE_INVALID;
|
| }
|
|
|
| -OutputConfigurator::CoordinateTransformation
|
| -OutputConfigurator::GetMirrorModeCTM(
|
| - const OutputConfigurator::OutputSnapshot& output) {
|
| - CoordinateTransformation ctm; // Default to identity
|
| - const ModeInfo* native_mode_info = GetModeInfo(output, output.native_mode);
|
| - const ModeInfo* mirror_mode_info = GetModeInfo(output, output.mirror_mode);
|
| -
|
| - if (!native_mode_info || !mirror_mode_info ||
|
| - native_mode_info->height == 0 || mirror_mode_info->height == 0 ||
|
| - native_mode_info->width == 0 || mirror_mode_info->width == 0)
|
| - return ctm;
|
| -
|
| - float native_mode_ar = static_cast<float>(native_mode_info->width) /
|
| - static_cast<float>(native_mode_info->height);
|
| - float mirror_mode_ar = static_cast<float>(mirror_mode_info->width) /
|
| - static_cast<float>(mirror_mode_info->height);
|
| -
|
| - if (mirror_mode_ar > native_mode_ar) { // Letterboxing
|
| - ctm.x_scale = 1.0;
|
| - ctm.x_offset = 0.0;
|
| - ctm.y_scale = mirror_mode_ar / native_mode_ar;
|
| - ctm.y_offset = (native_mode_ar / mirror_mode_ar - 1.0) * 0.5;
|
| - return ctm;
|
| - }
|
| - if (native_mode_ar > mirror_mode_ar) { // Pillarboxing
|
| - ctm.y_scale = 1.0;
|
| - ctm.y_offset = 0.0;
|
| - ctm.x_scale = native_mode_ar / mirror_mode_ar;
|
| - ctm.x_offset = (mirror_mode_ar / native_mode_ar - 1.0) * 0.5;
|
| - return ctm;
|
| - }
|
| -
|
| - return ctm; // Same aspect ratio - return identity
|
| -}
|
| -
|
| -OutputConfigurator::CoordinateTransformation
|
| -OutputConfigurator::GetExtendedModeCTM(
|
| - const OutputConfigurator::OutputSnapshot& output,
|
| - int framebuffer_width,
|
| - int framebuffer_height) {
|
| - CoordinateTransformation ctm; // Default to identity
|
| - const ModeInfo* mode_info = GetModeInfo(output, output.selected_mode);
|
| - DCHECK(mode_info);
|
| - if (!mode_info)
|
| - return ctm;
|
| - // An example of how to calculate the CTM.
|
| - // Suppose we have 2 monitors, the first one has size 1366 x 768.
|
| - // The second one has size 2560 x 1600
|
| - // The total size of framebuffer is 2560 x 2428
|
| - // where 2428 = 768 + 60 (hidden gap) + 1600
|
| - // and the sceond monitor is translated to Point (0, 828) in the
|
| - // framebuffer.
|
| - // X will first map input event location to [0, 2560) x [0, 2428),
|
| - // then apply CTM on it.
|
| - // So to compute CTM, for monitor1, we have
|
| - // x_scale = (1366 - 1) / (2560 - 1)
|
| - // x_offset = 0 / (2560 - 1)
|
| - // y_scale = (768 - 1) / (2428 - 1)
|
| - // y_offset = 0 / (2428 -1)
|
| - // For Monitor 2, we have
|
| - // x_scale = (2560 - 1) / (2560 - 1)
|
| - // x_offset = 0 / (2560 - 1)
|
| - // y_scale = (1600 - 1) / (2428 - 1)
|
| - // y_offset = 828 / (2428 -1)
|
| - // See the unittest OutputConfiguratorTest.CTMForMultiScreens.
|
| - ctm.x_scale =
|
| - static_cast<float>(mode_info->width - 1) / (framebuffer_width - 1);
|
| - ctm.x_offset = static_cast<float>(output.x) / (framebuffer_width - 1);
|
| - ctm.y_scale =
|
| - static_cast<float>(mode_info->height - 1) / (framebuffer_height - 1);
|
| - ctm.y_offset = static_cast<float>(output.y) / (framebuffer_height - 1);
|
| - return ctm;
|
| -}
|
| -
|
| float OutputConfigurator::GetMirroredDisplayAreaRatio(
|
| const OutputConfigurator::OutputSnapshot& output) {
|
| float area_ratio = 1.0f;
|
|
|