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

Unified Diff: chromeos/display/real_output_configurator_delegate.cc

Issue 21297003: Add ability to set resolution on external display (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: adraddressed comment, adjusted test Created 7 years, 5 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/real_output_configurator_delegate.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/display/real_output_configurator_delegate.cc
diff --git a/chromeos/display/real_output_configurator_delegate.cc b/chromeos/display/real_output_configurator_delegate.cc
index 5b0804a7e9e590667493d7b63e0e4ab6e835651d..0ed04378b76643737c39a47f0a71821b30124ea0 100644
--- a/chromeos/display/real_output_configurator_delegate.cc
+++ b/chromeos/display/real_output_configurator_delegate.cc
@@ -105,7 +105,8 @@ void RealOutputConfiguratorDelegate::ForceDPMSOn() {
}
std::vector<OutputConfigurator::OutputSnapshot>
-RealOutputConfiguratorDelegate::GetOutputs() {
+RealOutputConfiguratorDelegate::GetOutputs(
+ const OutputConfigurator::StateController* state_controller) {
CHECK(screen_) << "Server not grabbed";
std::vector<OutputConfigurator::OutputSnapshot> outputs;
@@ -150,8 +151,20 @@ RealOutputConfiguratorDelegate::GetOutputs() {
break;
}
}
-
to_populate.native_mode = GetOutputNativeMode(output_info);
+ if (to_populate.has_display_id) {
+ int width = 0, height = 0;
+ if (state_controller &&
+ state_controller->GetResolutionForDisplayId(
+ to_populate.display_id, &width, &height)) {
+ to_populate.selected_mode =
+ FindOutputModeMatchingSize(screen_, output_info, width, height);
+ }
+ }
+ // Fallback to native mode.
+ if (to_populate.selected_mode == None)
+ to_populate.selected_mode = to_populate.native_mode;
+
to_populate.is_aspect_preserving_scaling =
IsOutputAspectPreservingScaling(this_id);
to_populate.touch_device_id = None;
« no previous file with comments | « chromeos/display/real_output_configurator_delegate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698