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

Unified Diff: chromeos/display/output_configurator.cc

Issue 132983002: Replace OutputSnapshot |is_internal| with check against 'type == OUTPUT_TYPE_INTERNAL' (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 11 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') | chromeos/display/output_configurator_unittest.cc » ('j') | 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 174730da1024bd07886c364b0f59052441eb27e2..fb545aaf7cb45720c94884524486f5cdce3374a5 100644
--- a/chromeos/display/output_configurator.cc
+++ b/chromeos/display/output_configurator.cc
@@ -94,7 +94,7 @@ int GetOutputPower(
output_power->resize(outputs.size());
for (size_t i = 0; i < outputs.size(); ++i) {
- bool internal = outputs[i].is_internal;
+ bool internal = outputs[i].type == OUTPUT_TYPE_INTERNAL;
bool on = state == DISPLAY_POWER_ALL_ON ||
(state == DISPLAY_POWER_INTERNAL_OFF_EXTERNAL_ON && !internal) ||
(state == DISPLAY_POWER_INTERNAL_ON_EXTERNAL_OFF && internal);
@@ -113,7 +113,7 @@ bool IsProjecting(
bool has_internal_output = false;
int connected_output_count = outputs.size();
for (size_t i = 0; i < outputs.size(); ++i)
- has_internal_output |= outputs[i].is_internal;
+ has_internal_output |= outputs[i].type == OUTPUT_TYPE_INTERNAL;
// "Projecting" is defined as having more than 1 output connected while at
// least one of them is an internal output.
@@ -154,7 +154,6 @@ OutputConfigurator::OutputSnapshot::OutputSnapshot()
y(0),
width_mm(0),
height_mm(0),
- is_internal(false),
is_aspect_preserving_scaling(false),
type(OUTPUT_TYPE_UNKNOWN),
touch_device_id(0),
@@ -484,7 +483,8 @@ bool OutputConfigurator::SetDisplayPower(DisplayPowerState power_state,
bool only_if_single_internal_display =
flags & kSetDisplayPowerOnlyIfSingleInternalDisplay;
bool single_internal_display =
- cached_outputs_.size() == 1 && cached_outputs_[0].is_internal;
+ cached_outputs_.size() == 1 &&
+ cached_outputs_[0].type == OUTPUT_TYPE_INTERNAL;
if (single_internal_display || !only_if_single_internal_display) {
success = EnterStateOrFallBackToSoftwareMirroring(new_state, power_state);
attempted_change = true;
@@ -665,8 +665,8 @@ void OutputConfigurator::UpdateCachedOutputs() {
// Set |mirror_mode| fields.
if (cached_outputs_.size() == 2) {
- bool one_is_internal = cached_outputs_[0].is_internal;
- bool two_is_internal = cached_outputs_[1].is_internal;
+ bool one_is_internal = cached_outputs_[0].type == OUTPUT_TYPE_INTERNAL;
+ bool two_is_internal = cached_outputs_[1].type == OUTPUT_TYPE_INTERNAL;
int internal_outputs = (one_is_internal ? 1 : 0) +
(two_is_internal ? 1 : 0);
DCHECK_LT(internal_outputs, 2);
« no previous file with comments | « chromeos/display/output_configurator.h ('k') | chromeos/display/output_configurator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698