diff options
author | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-08 05:55:02 +0000 |
---|---|---|
committer | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-08 05:55:02 +0000 |
commit | 6caf9606e791a6774f1150eff09c34dae9f552cc (patch) | |
tree | bb44f55c50d83c184bf733e68bbd494b66fdba2f /chromeos/display | |
parent | dba96ef37448812fd1cfde3c8714f3eda96de685 (diff) | |
download | chromium_src-6caf9606e791a6774f1150eff09c34dae9f552cc.zip chromium_src-6caf9606e791a6774f1150eff09c34dae9f552cc.tar.gz chromium_src-6caf9606e791a6774f1150eff09c34dae9f552cc.tar.bz2 |
Compositor reflector, which copies texture onto another compositor.
- added GL utility functions to create and copy texture for mirroring
- made sure we don't create two compositor for the same display.
- update the mirroring compositor size when the mirror window size
changed.
- fix a bug that was using int for display ID. changed the
initial value for faked display id so that we can catch
such error early in test.
BUG=239776
TEST=added new tests, plus manually on daisy (mirroring now works on daisy)
Review URL: https://chromiumcodereview.appspot.com/16232013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@205044 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos/display')
-rw-r--r-- | chromeos/display/output_configurator.cc | 8 | ||||
-rw-r--r-- | chromeos/display/output_configurator_unittest.cc | 12 | ||||
-rw-r--r-- | chromeos/display/real_output_configurator_delegate.cc | 8 |
3 files changed, 26 insertions, 2 deletions
diff --git a/chromeos/display/output_configurator.cc b/chromeos/display/output_configurator.cc index 8214d0c..19b28f5 100644 --- a/chromeos/display/output_configurator.cc +++ b/chromeos/display/output_configurator.cc @@ -254,8 +254,14 @@ bool OutputConfigurator::SetDisplayMode(OutputState new_state) { return false; VLOG(1) << "SetDisplayMode: state=" << OutputStateToString(new_state); - if (output_state_ == new_state) + if (output_state_ == new_state) { + // Cancel software mirroring if the state is moving from + // STATE_DUAL_EXTENDED to STATE_DUAL_EXTENDED. + if (mirroring_controller_ && new_state == STATE_DUAL_EXTENDED) + mirroring_controller_->SetSoftwareMirroring(false); + NotifyOnDisplayChanged(); return true; + } delegate_->GrabServer(); std::vector<OutputSnapshot> outputs = delegate_->GetOutputs(); diff --git a/chromeos/display/output_configurator_unittest.cc b/chromeos/display/output_configurator_unittest.cc index 606180c..6deae54 100644 --- a/chromeos/display/output_configurator_unittest.cc +++ b/chromeos/display/output_configurator_unittest.cc @@ -406,6 +406,18 @@ TEST_F(OutputConfiguratorTest, ConnectSecondOutput) { EXPECT_EQ(STATE_DUAL_EXTENDED, configurator_.output_state()); EXPECT_TRUE(mirroring_controller_.software_mirroring_enabled()); + // Setting STATE_DUAL_MIRROR should try to reconfigure + EXPECT_TRUE(configurator_.SetDisplayMode(STATE_DUAL_EXTENDED)); + EXPECT_EQ(JoinActions(NULL), delegate_->GetActionsAndClear()); + EXPECT_FALSE(mirroring_controller_.software_mirroring_enabled()); + + // Set back to software mirror mode. + EXPECT_TRUE(configurator_.SetDisplayMode(STATE_DUAL_MIRROR)); + EXPECT_EQ(JoinActions(kGrab, kUngrab, NULL), + delegate_->GetActionsAndClear()); + EXPECT_EQ(STATE_DUAL_EXTENDED, configurator_.output_state()); + EXPECT_TRUE(mirroring_controller_.software_mirroring_enabled()); + // Disconnect the second output. UpdateOutputs(1); EXPECT_TRUE(test_api_.SendOutputChangeEvents(false)); diff --git a/chromeos/display/real_output_configurator_delegate.cc b/chromeos/display/real_output_configurator_delegate.cc index 30a8494..a44a41b 100644 --- a/chromeos/display/real_output_configurator_delegate.cc +++ b/chromeos/display/real_output_configurator_delegate.cc @@ -123,6 +123,13 @@ RealOutputConfiguratorDelegate::GetOutputs() { to_populate.output = this_id; to_populate.has_display_id = GetDisplayId(this_id, i, &to_populate.display_id); + to_populate.is_internal = IsInternalOutput(output_info); + // Use the index as a valid display id even if the internal + // display doesn't have valid EDID because the index + // will never change. + if (!to_populate.has_display_id && to_populate.is_internal) + to_populate.has_display_id = true; + (outputs.empty() ? one_info : two_info) = output_info; // Now, look up the current CRTC and any related info. @@ -145,7 +152,6 @@ RealOutputConfiguratorDelegate::GetOutputs() { } to_populate.native_mode = GetOutputNativeMode(output_info); - to_populate.is_internal = IsInternalOutput(output_info); to_populate.is_aspect_preserving_scaling = IsOutputAspectPreservingScaling(this_id); to_populate.touch_device_id = None; |