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 <cstdarg> | 7 #include <cstdarg> |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 *interlaced = it->second.interlaced; | 148 *interlaced = it->second.interlaced; |
149 return true; | 149 return true; |
150 } | 150 } |
151 virtual void ConfigureCrtc(OutputConfigurator::CrtcConfig* config) OVERRIDE { | 151 virtual void ConfigureCrtc(OutputConfigurator::CrtcConfig* config) OVERRIDE { |
152 AppendAction(GetCrtcAction(config->crtc, config->x, config->y, config->mode, | 152 AppendAction(GetCrtcAction(config->crtc, config->x, config->y, config->mode, |
153 config->output)); | 153 config->output)); |
154 } | 154 } |
155 virtual void CreateFrameBuffer( | 155 virtual void CreateFrameBuffer( |
156 int width, | 156 int width, |
157 int height, | 157 int height, |
158 const std::vector<OutputConfigurator::CrtcConfig>& configs) { | 158 const std::vector<OutputConfigurator::CrtcConfig>& configs) OVERRIDE { |
159 AppendAction(GetFramebufferAction(width, height, | 159 AppendAction( |
160 configs.size() >= 1 ? configs[0].crtc : 0, | 160 GetFramebufferAction(width, |
161 configs.size() >= 2 ? configs[1].crtc : 0)); | 161 height, |
| 162 configs.size() >= 1 ? configs[0].crtc : 0, |
| 163 configs.size() >= 2 ? configs[1].crtc : 0)); |
162 } | 164 } |
163 virtual void ConfigureCTM( | 165 virtual void ConfigureCTM( |
164 int touch_device_id, | 166 int touch_device_id, |
165 const OutputConfigurator::CoordinateTransformation& ctm) OVERRIDE { | 167 const OutputConfigurator::CoordinateTransformation& ctm) OVERRIDE { |
166 AppendAction(GetCTMAction(touch_device_id, ctm)); | 168 AppendAction(GetCTMAction(touch_device_id, ctm)); |
167 } | 169 } |
168 virtual void SendProjectingStateToPowerManager(bool projecting) OVERRIDE { | 170 virtual void SendProjectingStateToPowerManager(bool projecting) OVERRIDE { |
169 AppendAction(projecting ? kProjectingOn : kProjectingOff); | 171 AppendAction(projecting ? kProjectingOn : kProjectingOff); |
170 } | 172 } |
171 | 173 |
(...skipping 22 matching lines...) Expand all Loading... |
194 std::vector<OutputConfigurator::OutputSnapshot> outputs_; | 196 std::vector<OutputConfigurator::OutputSnapshot> outputs_; |
195 | 197 |
196 std::string actions_; | 198 std::string actions_; |
197 | 199 |
198 DISALLOW_COPY_AND_ASSIGN(TestDelegate); | 200 DISALLOW_COPY_AND_ASSIGN(TestDelegate); |
199 }; | 201 }; |
200 | 202 |
201 class TestStateController : public OutputConfigurator::StateController { | 203 class TestStateController : public OutputConfigurator::StateController { |
202 public: | 204 public: |
203 TestStateController() : state_(STATE_DUAL_EXTENDED) {} | 205 TestStateController() : state_(STATE_DUAL_EXTENDED) {} |
204 ~TestStateController() {} | 206 virtual ~TestStateController() {} |
205 | 207 |
206 void set_state(OutputState state) { state_ = state; } | 208 void set_state(OutputState state) { state_ = state; } |
207 | 209 |
208 // OutputConfigurator::StateController overrides: | 210 // OutputConfigurator::StateController overrides: |
209 virtual OutputState GetStateForOutputs( | 211 virtual OutputState GetStateForOutputs( |
210 const std::vector<OutputInfo>& outputs) const OVERRIDE { return state_; } | 212 const std::vector<OutputInfo>& outputs) const OVERRIDE { return state_; } |
211 | 213 |
212 private: | 214 private: |
213 OutputState state_; | 215 OutputState state_; |
214 | 216 |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 UpdateOutputs(2); | 588 UpdateOutputs(2); |
587 state_controller_.set_state(STATE_DUAL_EXTENDED); | 589 state_controller_.set_state(STATE_DUAL_EXTENDED); |
588 EXPECT_TRUE(test_api_.SendOutputChangeEvents(true)); | 590 EXPECT_TRUE(test_api_.SendOutputChangeEvents(true)); |
589 EXPECT_FALSE(configurator_.SetDisplayMode(STATE_HEADLESS)); | 591 EXPECT_FALSE(configurator_.SetDisplayMode(STATE_HEADLESS)); |
590 EXPECT_FALSE(configurator_.SetDisplayMode(STATE_SINGLE)); | 592 EXPECT_FALSE(configurator_.SetDisplayMode(STATE_SINGLE)); |
591 EXPECT_TRUE(configurator_.SetDisplayMode(STATE_DUAL_MIRROR)); | 593 EXPECT_TRUE(configurator_.SetDisplayMode(STATE_DUAL_MIRROR)); |
592 EXPECT_TRUE(configurator_.SetDisplayMode(STATE_DUAL_EXTENDED)); | 594 EXPECT_TRUE(configurator_.SetDisplayMode(STATE_DUAL_EXTENDED)); |
593 } | 595 } |
594 | 596 |
595 } // namespace chromeos | 597 } // namespace chromeos |
OLD | NEW |