Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(132)

Unified Diff: chromeos/display/output_configurator.cc

Issue 12505005: Store rotation/ui scale to local state. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromeos/display/output_configurator.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/display/output_configurator.cc
diff --git a/chromeos/display/output_configurator.cc b/chromeos/display/output_configurator.cc
index 3031b83bb4e09fac6276a34730deb477fc9c617d..5986d7bb60a714097ed52a2d8d4d184e6b383b61 100644
--- a/chromeos/display/output_configurator.cc
+++ b/chromeos/display/output_configurator.cc
@@ -396,43 +396,6 @@ OutputState InferCurrentState(Display* display,
return state;
}
-OutputState GetNextState(Display* display,
- XRRScreenResources* screen,
- OutputState current_state,
- const std::vector<OutputSnapshot>& outputs) {
- TRACE_EVENT0("chromeos", "OutputConfigurator::GetNextState");
- OutputState state = STATE_INVALID;
-
- switch (outputs.size()) {
- case 0:
- state = STATE_HEADLESS;
- break;
- case 1:
- state = STATE_SINGLE;
- break;
- case 2: {
- bool mirror_supported = (0 != outputs[0].mirror_mode) &&
- (0 != outputs[1].mirror_mode);
- switch (current_state) {
- case STATE_DUAL_EXTENDED:
- state =
- mirror_supported ? STATE_DUAL_MIRROR : STATE_DUAL_EXTENDED;
- break;
- case STATE_DUAL_MIRROR:
- state = STATE_DUAL_EXTENDED;
- break;
- default:
- // Default to extended mode.
- state = STATE_DUAL_EXTENDED;
- }
- break;
- }
- default:
- CHECK(false);
- }
- return state;
-}
-
RRCrtc GetNextCrtcAfter(Display* display,
XRRScreenResources* screen,
RROutput output,
@@ -533,7 +496,8 @@ bool IsOutputAspectPreservingScaling(Display* display,
OutputConfigurator::OutputConfigurator()
// If we aren't running on ChromeOS (like linux desktop),
// don't try to configure display.
- : configure_display_(base::chromeos::IsRunningOnChromeOS()),
+ : delegate_(NULL),
+ configure_display_(base::chromeos::IsRunningOnChromeOS()),
is_panel_fitting_enabled_(false),
connected_output_count_(0),
xrandr_event_base_(0),
@@ -1302,6 +1266,50 @@ void OutputConfigurator::RecordPreviousStateUMA() {
last_enter_state_time_ = base::TimeTicks::Now();
}
+OutputState OutputConfigurator::GetNextState(
+ Display* display,
+ XRRScreenResources* screen,
+ OutputState current_state,
+ const std::vector<OutputSnapshot>& output_snapshots) const {
+ TRACE_EVENT0("chromeos", "OutputConfigurator::GetNextState");
+ OutputState state = STATE_INVALID;
+
+ switch (output_snapshots.size()) {
+ case 0:
+ state = STATE_HEADLESS;
+ break;
+ case 1:
+ state = STATE_SINGLE;
+ break;
+ case 2: {
+ bool mirror_supported = (0 != output_snapshots[0].mirror_mode) &&
+ (0 != output_snapshots[1].mirror_mode);
+ switch (current_state) {
+ case STATE_DUAL_EXTENDED:
+ state =
+ mirror_supported ? STATE_DUAL_MIRROR : STATE_DUAL_EXTENDED;
+ break;
+ case STATE_DUAL_MIRROR:
+ state = STATE_DUAL_EXTENDED;
+ break;
+ case STATE_INVALID: {
+ std::vector<RROutput> outputs;
+ for (size_t i = 0; i < output_snapshots.size(); ++i)
+ outputs.push_back(output_snapshots[i].output);
+ state = delegate_->GetStateForOutputs(outputs);
+ break;
+ }
+ default:
+ state = STATE_DUAL_EXTENDED;
+ }
+ break;
+ }
+ default:
+ CHECK(false);
+ }
+ return state;
+}
+
// static
bool OutputConfigurator::IsInternalOutput(const XRROutputInfo* output_info) {
return IsInternalOutputName(std::string(output_info->name));
« no previous file with comments | « chromeos/display/output_configurator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698