| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/message_loop/message_loop.h" | 6 #include "base/message_loop/message_loop.h" |
| 7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 #include "ui/display/chromeos/test/action_logger_util.h" | 9 #include "ui/display/chromeos/test/action_logger_util.h" |
| 10 #include "ui/display/chromeos/test/test_display_snapshot.h" | 10 #include "ui/display/chromeos/test/test_display_snapshot.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 } | 40 } |
| 41 | 41 |
| 42 DisplayConfigurator::StateController* GetStateController() const override { | 42 DisplayConfigurator::StateController* GetStateController() const override { |
| 43 return nullptr; | 43 return nullptr; |
| 44 } | 44 } |
| 45 | 45 |
| 46 MultipleDisplayState GetDisplayState() const override { | 46 MultipleDisplayState GetDisplayState() const override { |
| 47 return display_state_; | 47 return display_state_; |
| 48 } | 48 } |
| 49 | 49 |
| 50 virtual chromeos::DisplayPowerState GetPowerState() const override { | 50 chromeos::DisplayPowerState GetPowerState() const override { |
| 51 return power_state_; | 51 return power_state_; |
| 52 } | 52 } |
| 53 | 53 |
| 54 virtual std::vector<DisplayConfigurator::DisplayState> ParseDisplays( | 54 std::vector<DisplayConfigurator::DisplayState> ParseDisplays( |
| 55 const std::vector<DisplaySnapshot*>& displays) const override { | 55 const std::vector<DisplaySnapshot*>& displays) const override { |
| 56 std::vector<DisplayConfigurator::DisplayState> parsed_displays; | 56 std::vector<DisplayConfigurator::DisplayState> parsed_displays; |
| 57 for (DisplaySnapshot* display : displays) { | 57 for (DisplaySnapshot* display : displays) { |
| 58 DisplayConfigurator::DisplayState state; | 58 DisplayConfigurator::DisplayState state; |
| 59 state.display = display; | 59 state.display = display; |
| 60 state.selected_mode = display->native_mode(); | 60 state.selected_mode = display->native_mode(); |
| 61 if (should_mirror_) | 61 if (should_mirror_) |
| 62 state.mirror_mode = FindMirrorMode(displays); | 62 state.mirror_mode = FindMirrorMode(displays); |
| 63 | 63 |
| 64 parsed_displays.push_back(state); | 64 parsed_displays.push_back(state); |
| 65 } | 65 } |
| 66 | 66 |
| 67 return parsed_displays; | 67 return parsed_displays; |
| 68 } | 68 } |
| 69 | 69 |
| 70 virtual bool GetDisplayLayout( | 70 bool GetDisplayLayout( |
| 71 const std::vector<DisplayConfigurator::DisplayState>& displays, | 71 const std::vector<DisplayConfigurator::DisplayState>& displays, |
| 72 MultipleDisplayState new_display_state, | 72 MultipleDisplayState new_display_state, |
| 73 chromeos::DisplayPowerState new_power_state, | 73 chromeos::DisplayPowerState new_power_state, |
| 74 std::vector<DisplayConfigureRequest>* requests, | 74 std::vector<DisplayConfigureRequest>* requests, |
| 75 gfx::Size* framebuffer_size) const override { | 75 gfx::Size* framebuffer_size) const override { |
| 76 gfx::Point origin; | 76 gfx::Point origin; |
| 77 for (const DisplayConfigurator::DisplayState& state : displays) { | 77 for (const DisplayConfigurator::DisplayState& state : displays) { |
| 78 const DisplayMode* mode = state.selected_mode; | 78 const DisplayMode* mode = state.selected_mode; |
| 79 if (new_display_state == MULTIPLE_DISPLAY_STATE_DUAL_MIRROR) | 79 if (new_display_state == MULTIPLE_DISPLAY_STATE_DUAL_MIRROR) |
| 80 mode = state.mirror_mode; | 80 mode = state.mirror_mode; |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 EXPECT_EQ( | 377 EXPECT_EQ( |
| 378 JoinActions(kGrab, GetFramebufferAction(small_mode_.size(), &displays_[0], | 378 JoinActions(kGrab, GetFramebufferAction(small_mode_.size(), &displays_[0], |
| 379 nullptr).c_str(), | 379 nullptr).c_str(), |
| 380 GetCrtcAction(displays_[0], nullptr, gfx::Point()).c_str(), | 380 GetCrtcAction(displays_[0], nullptr, gfx::Point()).c_str(), |
| 381 kUngrab, NULL), | 381 kUngrab, NULL), |
| 382 log_.GetActionsAndClear()); | 382 log_.GetActionsAndClear()); |
| 383 } | 383 } |
| 384 | 384 |
| 385 } // namespace test | 385 } // namespace test |
| 386 } // namespace ui | 386 } // namespace ui |
| OLD | NEW |