Chromium Code Reviews| 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/types/display_mode.h" | 5 #include "ui/display/types/display_mode.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
| 9 | 9 |
| 10 namespace display { | 10 namespace display { |
| 11 | 11 |
| 12 DisplayMode::DisplayMode() | |
| 13 : size_(gfx::Size()), | |
| 14 is_interlaced_(0), | |
|
kylechar
2017/01/25 16:59:45
This is a bool not an int.
| |
| 15 refresh_rate_(0.0) {} | |
| 16 | |
| 12 DisplayMode::DisplayMode(const gfx::Size& size, | 17 DisplayMode::DisplayMode(const gfx::Size& size, |
| 13 bool interlaced, | 18 bool interlaced, |
| 14 float refresh_rate) | 19 float refresh_rate) |
| 15 : size_(size), | 20 : size_(size), |
| 16 is_interlaced_(interlaced), | 21 is_interlaced_(interlaced), |
| 17 refresh_rate_(refresh_rate) {} | 22 refresh_rate_(refresh_rate) {} |
| 18 | 23 |
| 19 DisplayMode::~DisplayMode() {} | 24 DisplayMode::DisplayMode(DisplayMode&&) = default; |
| 25 | |
| 26 DisplayMode& DisplayMode::operator=(DisplayMode&&) = default; | |
| 27 | |
| 28 DisplayMode::~DisplayMode() = default; | |
| 20 | 29 |
| 21 std::unique_ptr<DisplayMode> DisplayMode::Clone() const { | 30 std::unique_ptr<DisplayMode> DisplayMode::Clone() const { |
| 22 return base::WrapUnique(new DisplayMode(size_, | 31 return base::WrapUnique(new DisplayMode(size_, |
| 23 is_interlaced_, | 32 is_interlaced_, |
| 24 refresh_rate_)); | 33 refresh_rate_)); |
| 25 } | 34 } |
| 26 | 35 |
| 27 std::string DisplayMode::ToString() const { | 36 std::string DisplayMode::ToString() const { |
| 28 return base::StringPrintf("[%dx%d %srate=%f]", | 37 return base::StringPrintf("[%dx%d %srate=%f]", |
| 29 size_.width(), | 38 size_.width(), |
| 30 size_.height(), | 39 size_.height(), |
| 31 is_interlaced_ ? "interlaced " : "", | 40 is_interlaced_ ? "interlaced " : "", |
| 32 refresh_rate_); | 41 refresh_rate_); |
| 33 } | 42 } |
| 34 | 43 |
| 35 void PrintTo(const DisplayMode& mode, std::ostream* os) { | 44 void PrintTo(const DisplayMode& mode, std::ostream* os) { |
| 36 *os << mode.ToString(); | 45 *os << mode.ToString(); |
| 37 } | 46 } |
| 38 | 47 |
| 39 } // namespace display | 48 } // namespace display |
| OLD | NEW |