| 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 "base/memory/ptr_util.h" | |
| 6 | |
| 7 #include "ui/ozone/common/display_snapshot_proxy.h" | 5 #include "ui/ozone/common/display_snapshot_proxy.h" |
| 8 | 6 |
| 9 #include <stddef.h> | 7 #include <stddef.h> |
| 10 | 8 |
| 11 #include "ui/ozone/common/display_mode_proxy.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "ui/display/types/display_mode.h" |
| 12 #include "ui/ozone/common/gpu/ozone_gpu_message_params.h" | 11 #include "ui/ozone/common/gpu/ozone_gpu_message_params.h" |
| 13 | 12 |
| 14 namespace ui { | 13 namespace ui { |
| 15 | 14 |
| 16 namespace { | 15 namespace { |
| 17 | 16 |
| 18 bool SameModes(const DisplayMode_Params& lhs, const DisplayMode_Params& rhs) { | 17 bool SameModes(const DisplayMode_Params& lhs, const DisplayMode_Params& rhs) { |
| 19 return lhs.size == rhs.size && lhs.is_interlaced == rhs.is_interlaced && | 18 return lhs.size == rhs.size && lhs.is_interlaced == rhs.is_interlaced && |
| 20 lhs.refresh_rate == rhs.refresh_rate; | 19 lhs.refresh_rate == rhs.refresh_rate; |
| 21 } | 20 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 32 params.has_overscan, | 31 params.has_overscan, |
| 33 params.has_color_correction_matrix, | 32 params.has_color_correction_matrix, |
| 34 params.display_name, | 33 params.display_name, |
| 35 params.sys_path, | 34 params.sys_path, |
| 36 std::vector<std::unique_ptr<const display::DisplayMode>>(), | 35 std::vector<std::unique_ptr<const display::DisplayMode>>(), |
| 37 params.edid, | 36 params.edid, |
| 38 NULL, | 37 NULL, |
| 39 NULL), | 38 NULL), |
| 40 string_representation_(params.string_representation) { | 39 string_representation_(params.string_representation) { |
| 41 for (size_t i = 0; i < params.modes.size(); ++i) { | 40 for (size_t i = 0; i < params.modes.size(); ++i) { |
| 42 modes_.push_back(base::MakeUnique<DisplayModeProxy>(params.modes[i])); | 41 modes_.push_back(base::MakeUnique<display::DisplayMode>( |
| 42 params.modes[i].size, params.modes[i].is_interlaced, |
| 43 params.modes[i].refresh_rate)); |
| 43 | 44 |
| 44 if (params.has_current_mode && | 45 if (params.has_current_mode && |
| 45 SameModes(params.modes[i], params.current_mode)) | 46 SameModes(params.modes[i], params.current_mode)) |
| 46 current_mode_ = modes_.back().get(); | 47 current_mode_ = modes_.back().get(); |
| 47 | 48 |
| 48 if (params.has_native_mode && | 49 if (params.has_native_mode && |
| 49 SameModes(params.modes[i], params.native_mode)) | 50 SameModes(params.modes[i], params.native_mode)) |
| 50 native_mode_ = modes_.back().get(); | 51 native_mode_ = modes_.back().get(); |
| 51 } | 52 } |
| 52 | 53 |
| 53 product_id_ = params.product_id; | 54 product_id_ = params.product_id; |
| 54 maximum_cursor_size_ = params.maximum_cursor_size; | 55 maximum_cursor_size_ = params.maximum_cursor_size; |
| 55 } | 56 } |
| 56 | 57 |
| 57 DisplaySnapshotProxy::~DisplaySnapshotProxy() { | 58 DisplaySnapshotProxy::~DisplaySnapshotProxy() { |
| 58 } | 59 } |
| 59 | 60 |
| 60 std::string DisplaySnapshotProxy::ToString() const { | 61 std::string DisplaySnapshotProxy::ToString() const { |
| 61 return string_representation_; | 62 return string_representation_; |
| 62 } | 63 } |
| 63 | 64 |
| 64 } // namespace ui | 65 } // namespace ui |
| OLD | NEW |