| 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 "ui/display/chromeos/display_configurator.h" | 5 #include "ui/display/chromeos/display_configurator.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 const gfx::Size& size) { | 122 const gfx::Size& size) { |
| 123 const DisplayMode* best_mode = NULL; | 123 const DisplayMode* best_mode = NULL; |
| 124 for (DisplayModeList::const_iterator it = display.modes().begin(); | 124 for (DisplayModeList::const_iterator it = display.modes().begin(); |
| 125 it != display.modes().end(); | 125 it != display.modes().end(); |
| 126 ++it) { | 126 ++it) { |
| 127 const DisplayMode* mode = *it; | 127 const DisplayMode* mode = *it; |
| 128 | 128 |
| 129 if (mode->size() != size) | 129 if (mode->size() != size) |
| 130 continue; | 130 continue; |
| 131 | 131 |
| 132 if (mode == display.native_mode()) { |
| 133 best_mode = mode; |
| 134 break; |
| 135 } |
| 136 |
| 132 if (!best_mode) { | 137 if (!best_mode) { |
| 133 best_mode = mode; | 138 best_mode = mode; |
| 134 continue; | 139 continue; |
| 135 } | 140 } |
| 136 | 141 |
| 137 if (mode->is_interlaced()) { | 142 if (mode->is_interlaced()) { |
| 138 if (!best_mode->is_interlaced()) | 143 if (!best_mode->is_interlaced()) |
| 139 continue; | 144 continue; |
| 140 } else { | 145 } else { |
| 141 // Reset the best rate if the non interlaced is | 146 // Reset the best rate if the non interlaced is |
| (...skipping 827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 969 return state_controller_->GetStateForDisplayIds(display_ids); | 974 return state_controller_->GetStateForDisplayIds(display_ids); |
| 970 } | 975 } |
| 971 } | 976 } |
| 972 default: | 977 default: |
| 973 NOTREACHED(); | 978 NOTREACHED(); |
| 974 } | 979 } |
| 975 return MULTIPLE_DISPLAY_STATE_INVALID; | 980 return MULTIPLE_DISPLAY_STATE_INVALID; |
| 976 } | 981 } |
| 977 | 982 |
| 978 } // namespace ui | 983 } // namespace ui |
| OLD | NEW |