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

Side by Side Diff: ui/ozone/common/display_snapshot_proxy.cc

Issue 851853002: It is time. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Trying to reup because the last upload failed. Created 5 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 unified diff | Download patch
« no previous file with comments | « ui/ozone/common/display_snapshot_proxy.h ('k') | ui/ozone/common/display_util.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "ui/ozone/common/display_snapshot_proxy.h"
6
7 #include "ui/ozone/common/display_mode_proxy.h"
8 #include "ui/ozone/common/gpu/ozone_gpu_message_params.h"
9
10 namespace ui {
11
12 namespace {
13
14 bool SameModes(const DisplayMode_Params& lhs, const DisplayMode_Params& rhs) {
15 return lhs.size == rhs.size && lhs.is_interlaced == rhs.is_interlaced &&
16 lhs.refresh_rate == rhs.refresh_rate;
17 }
18
19 } // namespace
20
21 DisplaySnapshotProxy::DisplaySnapshotProxy(const DisplaySnapshot_Params& params)
22 : DisplaySnapshot(params.display_id,
23 params.has_proper_display_id,
24 params.origin,
25 params.physical_size,
26 params.type,
27 params.is_aspect_preserving_scaling,
28 params.has_overscan,
29 params.display_name,
30 std::vector<const DisplayMode*>(),
31 NULL,
32 NULL),
33 string_representation_(params.string_representation) {
34 for (size_t i = 0; i < params.modes.size(); ++i) {
35 modes_.push_back(new DisplayModeProxy(params.modes[i]));
36
37 if (params.has_current_mode &&
38 SameModes(params.modes[i], params.current_mode))
39 current_mode_ = modes_.back();
40
41 if (params.has_native_mode &&
42 SameModes(params.modes[i], params.native_mode))
43 native_mode_ = modes_.back();
44 }
45 }
46
47 DisplaySnapshotProxy::~DisplaySnapshotProxy() {
48 }
49
50 std::string DisplaySnapshotProxy::ToString() const {
51 return string_representation_;
52 }
53
54 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/common/display_snapshot_proxy.h ('k') | ui/ozone/common/display_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698