Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / ui / display / chromeos / x11 / display_snapshot_x11.cc
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/display/chromeos/x11/display_snapshot_x11.h"
6
7 #include "base/strings/stringprintf.h"
8 #include "ui/display/chromeos/x11/display_mode_x11.h"
9
10 namespace ui {
11
12 DisplaySnapshotX11::DisplaySnapshotX11(
13     int64_t display_id,
14     const gfx::Point& origin,
15     const gfx::Size& physical_size,
16     DisplayConnectionType type,
17     bool is_aspect_preserving_scaling,
18     bool has_overscan,
19     std::string display_name,
20     const std::vector<const DisplayMode*>& modes,
21     const DisplayMode* current_mode,
22     const DisplayMode* native_mode,
23     RROutput output,
24     RRCrtc crtc,
25     int index)
26     : DisplaySnapshot(display_id,
27                       origin,
28                       physical_size,
29                       type,
30                       is_aspect_preserving_scaling,
31                       has_overscan,
32                       display_name,
33                       modes,
34                       current_mode,
35                       native_mode),
36       output_(output),
37       crtc_(crtc),
38       index_(index) {}
39
40 DisplaySnapshotX11::~DisplaySnapshotX11() {}
41
42 std::string DisplaySnapshotX11::ToString() const {
43   return base::StringPrintf(
44       "[type=%d, output=%ld, crtc=%ld, mode=%ld, dim=%dx%d]",
45       type_,
46       output_,
47       crtc_,
48       current_mode_
49           ? static_cast<const DisplayModeX11*>(current_mode_)->mode_id()
50           : 0,
51       physical_size_.width(),
52       physical_size_.height());
53 }
54
55 }  // namespace ui