OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chromeos/display/output_configurator.h" | 5 #include "chromeos/display/output_configurator.h" |
6 | 6 |
7 #include <X11/Xlib.h> | 7 #include <X11/Xlib.h> |
8 #include <X11/extensions/Xrandr.h> | 8 #include <X11/extensions/Xrandr.h> |
9 #include <X11/extensions/XInput2.h> | 9 #include <X11/extensions/XInput2.h> |
10 | 10 |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 return has_internal_output && (connected_output_count > 1); | 96 return has_internal_output && (connected_output_count > 1); |
97 } | 97 } |
98 | 98 |
99 } // namespace | 99 } // namespace |
100 | 100 |
101 OutputConfigurator::ModeInfo::ModeInfo() | 101 OutputConfigurator::ModeInfo::ModeInfo() |
102 : width(0), | 102 : width(0), |
103 height(0), | 103 height(0), |
104 interlaced(false) {} | 104 interlaced(false) {} |
105 | 105 |
| 106 OutputConfigurator::ModeInfo::ModeInfo(int width, int height, bool interlaced) |
| 107 : width(width), |
| 108 height(height), |
| 109 interlaced(interlaced) {} |
| 110 |
106 OutputConfigurator::CoordinateTransformation::CoordinateTransformation() | 111 OutputConfigurator::CoordinateTransformation::CoordinateTransformation() |
107 : x_scale(1.0), | 112 : x_scale(1.0), |
108 x_offset(0.0), | 113 x_offset(0.0), |
109 y_scale(1.0), | 114 y_scale(1.0), |
110 y_offset(0.0) {} | 115 y_offset(0.0) {} |
111 | 116 |
112 OutputConfigurator::OutputSnapshot::OutputSnapshot() | 117 OutputConfigurator::OutputSnapshot::OutputSnapshot() |
113 : output(None), | 118 : output(None), |
114 crtc(None), | 119 crtc(None), |
115 current_mode(None), | 120 current_mode(None), |
116 native_mode(None), | 121 native_mode(None), |
117 mirror_mode(None), | 122 mirror_mode(None), |
118 selected_mode(None), | 123 selected_mode(None), |
119 x(0), | 124 x(0), |
120 y(0), | 125 y(0), |
121 width_mm(0), | 126 width_mm(0), |
122 height_mm(0), | 127 height_mm(0), |
123 is_internal(false), | 128 is_internal(false), |
124 is_aspect_preserving_scaling(false), | 129 is_aspect_preserving_scaling(false), |
125 touch_device_id(0), | 130 touch_device_id(0), |
126 display_id(0), | 131 display_id(0), |
127 has_display_id(false) {} | 132 has_display_id(false), |
| 133 index(0) {} |
128 | 134 |
129 OutputConfigurator::OutputSnapshot::~OutputSnapshot() {} | 135 OutputConfigurator::OutputSnapshot::~OutputSnapshot() {} |
130 | 136 |
131 void OutputConfigurator::TestApi::SendScreenChangeEvent() { | 137 void OutputConfigurator::TestApi::SendScreenChangeEvent() { |
132 XRRScreenChangeNotifyEvent event = {0}; | 138 XRRScreenChangeNotifyEvent event = {0}; |
133 event.type = xrandr_event_base_ + RRScreenChangeNotify; | 139 event.type = xrandr_event_base_ + RRScreenChangeNotify; |
134 configurator_->Dispatch(reinterpret_cast<const base::NativeEvent>(&event)); | 140 configurator_->Dispatch(reinterpret_cast<const base::NativeEvent>(&event)); |
135 } | 141 } |
136 | 142 |
137 void OutputConfigurator::TestApi::SendOutputChangeEvent(RROutput output, | 143 void OutputConfigurator::TestApi::SendOutputChangeEvent(RROutput output, |
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
690 float width_ratio = static_cast<float>(mirror_mode_info->width) / | 696 float width_ratio = static_cast<float>(mirror_mode_info->width) / |
691 static_cast<float>(native_mode_info->width); | 697 static_cast<float>(native_mode_info->width); |
692 float height_ratio = static_cast<float>(mirror_mode_info->height) / | 698 float height_ratio = static_cast<float>(mirror_mode_info->height) / |
693 static_cast<float>(native_mode_info->height); | 699 static_cast<float>(native_mode_info->height); |
694 | 700 |
695 area_ratio = width_ratio * height_ratio; | 701 area_ratio = width_ratio * height_ratio; |
696 return area_ratio; | 702 return area_ratio; |
697 } | 703 } |
698 | 704 |
699 } // namespace chromeos | 705 } // namespace chromeos |
OLD | NEW |