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

Side by Side Diff: ui/display/fake_display_snapshot.cc

Issue 2324163002: Add FakeDisplayDelegate for off device usage. (Closed)
Patch Set: Fix windows compile problems. Created 4 years, 3 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/display/fake_display_snapshot.h ('k') | ui/display/types/BUILD.gn » ('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 2016 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/display/fake_display_snapshot.h"
6
7 #include <inttypes.h>
8
9 #include <vector>
10
11 #include "base/strings/stringprintf.h"
12
13 namespace display {
14
15 namespace {
16
17 // For a non high-DPI display (96 dpi) use a pitch of 265µm.
18 static const float kDisplayPitchMM = 0.265f;
19
20 } // namespace
21
22 FakeDisplaySnapshot::FakeDisplaySnapshot(int64_t display_id,
23 const gfx::Size& display_size,
24 ui::DisplayConnectionType type,
25 std::string name)
26 : DisplaySnapshot(display_id,
27 gfx::Point(0, 0),
28 gfx::Size(display_size.width() * kDisplayPitchMM,
29 display_size.height() * kDisplayPitchMM),
30 type,
31 false,
32 false,
33 false,
34 name,
35 base::FilePath(),
36 std::vector<std::unique_ptr<const ui::DisplayMode>>(),
37 std::vector<uint8_t>(),
38 nullptr,
39 nullptr) {
40 ui::DisplayMode mode(display_size, false, 60.0f);
41 modes_.push_back(mode.Clone());
42
43 native_mode_ = modes_.front().get();
44 }
45
46 FakeDisplaySnapshot::~FakeDisplaySnapshot() {}
47
48 std::string FakeDisplaySnapshot::ToString() const {
49 return base::StringPrintf(
50 "id=%" PRId64 " current_mode=%s physical_size=%s", display_id_,
51 current_mode_ ? current_mode_->ToString().c_str() : "nullptr",
52 physical_size_.ToString().c_str());
53 }
54
55 } // namespace display
OLDNEW
« no previous file with comments | « ui/display/fake_display_snapshot.h ('k') | ui/display/types/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698