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/ozone/common/display_snapshot_proxy.h" | 5 #include "ui/ozone/common/display_snapshot_proxy.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "ui/ozone/common/display_mode_proxy.h" | 9 #include "ui/ozone/common/display_mode_proxy.h" |
10 #include "ui/ozone/common/gpu/ozone_gpu_message_params.h" | 10 #include "ui/ozone/common/gpu/ozone_gpu_message_params.h" |
11 | 11 |
12 namespace ui { | 12 namespace ui { |
13 | 13 |
14 namespace { | 14 namespace { |
15 | 15 |
16 bool SameModes(const DisplayMode_Params& lhs, const DisplayMode_Params& rhs) { | 16 bool SameModes(const DisplayMode_Params& lhs, const DisplayMode_Params& rhs) { |
17 return lhs.size == rhs.size && lhs.is_interlaced == rhs.is_interlaced && | 17 return lhs.size == rhs.size && lhs.is_interlaced == rhs.is_interlaced && |
18 lhs.refresh_rate == rhs.refresh_rate; | 18 lhs.refresh_rate == rhs.refresh_rate; |
19 } | 19 } |
20 | 20 |
21 } // namespace | 21 } // namespace |
22 | 22 |
23 DisplaySnapshotProxy::DisplaySnapshotProxy(const DisplaySnapshot_Params& params) | 23 DisplaySnapshotProxy::DisplaySnapshotProxy(const DisplaySnapshot_Params& params) |
24 : DisplaySnapshot(params.display_id, | 24 : DisplaySnapshot(params.display_id, |
25 params.origin, | 25 params.origin, |
26 params.physical_size, | 26 params.physical_size, |
27 params.type, | 27 params.type, |
28 params.is_aspect_preserving_scaling, | 28 params.is_aspect_preserving_scaling, |
29 params.has_overscan, | 29 params.has_overscan, |
| 30 params.has_color_correction_matrix, |
30 params.display_name, | 31 params.display_name, |
31 params.sys_path, | 32 params.sys_path, |
32 std::vector<const DisplayMode*>(), | 33 std::vector<const DisplayMode*>(), |
33 NULL, | 34 NULL, |
34 NULL), | 35 NULL), |
35 string_representation_(params.string_representation) { | 36 string_representation_(params.string_representation) { |
36 for (size_t i = 0; i < params.modes.size(); ++i) { | 37 for (size_t i = 0; i < params.modes.size(); ++i) { |
37 modes_.push_back(new DisplayModeProxy(params.modes[i])); | 38 modes_.push_back(new DisplayModeProxy(params.modes[i])); |
38 | 39 |
39 if (params.has_current_mode && | 40 if (params.has_current_mode && |
40 SameModes(params.modes[i], params.current_mode)) | 41 SameModes(params.modes[i], params.current_mode)) |
41 current_mode_ = modes_.back(); | 42 current_mode_ = modes_.back(); |
42 | 43 |
43 if (params.has_native_mode && | 44 if (params.has_native_mode && |
44 SameModes(params.modes[i], params.native_mode)) | 45 SameModes(params.modes[i], params.native_mode)) |
45 native_mode_ = modes_.back(); | 46 native_mode_ = modes_.back(); |
46 } | 47 } |
47 | 48 |
48 product_id_ = params.product_id; | 49 product_id_ = params.product_id; |
49 } | 50 } |
50 | 51 |
51 DisplaySnapshotProxy::~DisplaySnapshotProxy() { | 52 DisplaySnapshotProxy::~DisplaySnapshotProxy() { |
52 } | 53 } |
53 | 54 |
54 std::string DisplaySnapshotProxy::ToString() const { | 55 std::string DisplaySnapshotProxy::ToString() const { |
55 return string_representation_; | 56 return string_representation_; |
56 } | 57 } |
57 | 58 |
58 } // namespace ui | 59 } // namespace ui |
OLD | NEW |