Skip to content

Commit

Permalink
Clear the software mirroring display list when adding it to the updat…
Browse files Browse the repository at this point in the history
…ed list.

BUG=601505
TEST=DisplayManagerTest.SoftwareMirroringAndRotate
R=stevenjb@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#385871}
  • Loading branch information
mitoshima authored and Commit bot committed Apr 7, 2016
1 parent a0e06ac commit eb29f79
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ash/display/display_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1221,8 +1221,10 @@ gfx::Display* DisplayManager::FindDisplayForId(int64_t id) {

void DisplayManager::AddMirrorDisplayInfoIfAny(
std::vector<DisplayInfo>* display_info_list) {
if (software_mirroring_enabled() && IsInMirrorMode())
if (software_mirroring_enabled() && IsInMirrorMode()) {
display_info_list->push_back(GetDisplayInfo(mirroring_display_id_));
software_mirroring_display_list_.clear();
}
}

void DisplayManager::InsertAndUpdateDisplayInfo(const DisplayInfo& new_info) {
Expand Down
15 changes: 15 additions & 0 deletions ash/display/display_manager_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1484,6 +1484,21 @@ TEST_F(DisplayManagerTest, SoftwareMirroring) {
gfx::Screen::GetScreen()->RemoveObserver(&display_observer);
}

TEST_F(DisplayManagerTest, RotateInSoftwareMirroring) {
if (!SupportsMultipleDisplays())
return;

DisplayManager* display_manager = Shell::GetInstance()->display_manager();
UpdateDisplay("600x400,500x300");
display_manager->SetMirrorMode(true);

EXPECT_EQ(1U, display_manager->GetNumDisplays());
int64_t primary_id = gfx::Screen::GetScreen()->GetPrimaryDisplay().id();
display_manager->SetDisplayRotation(primary_id, gfx::Display::ROTATE_180,
gfx::Display::ROTATION_SOURCE_ACTIVE);
display_manager->SetMirrorMode(false);
}

TEST_F(DisplayManagerTest, SingleDisplayToSoftwareMirroring) {
if (!SupportsMultipleDisplays())
return;
Expand Down

0 comments on commit eb29f79

Please sign in to comment.