summaryrefslogtreecommitdiffstats
path: root/ui/ozone/platform/drm/gpu/drm_display_snapshot.h
blob: e79f9a4269789b8bc562cc31fdfbceac204fbb69 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef UI_OZONE_PLATFORM_DRM_GPU_DRM_DISPLAY_SNAPSHOT_H_
#define UI_OZONE_PLATFORM_DRM_GPU_DRM_DISPLAY_SNAPSHOT_H_

#include "base/memory/ref_counted.h"
#include "ui/display/types/display_snapshot.h"
#include "ui/ozone/platform/drm/gpu/scoped_drm_types.h"

namespace ui {

class DrmDevice;

class DrmDisplaySnapshot : public DisplaySnapshot {
 public:
  DrmDisplaySnapshot(const scoped_refptr<DrmDevice>& drm,
                     drmModeConnector* connector,
                     drmModeCrtc* crtc,
                     uint32_t index);
  ~DrmDisplaySnapshot() override;

  scoped_refptr<DrmDevice> drm() const { return drm_; }
  // Native properties of a display used by the DRM implementation in
  // configuring this display.
  uint32_t connector() const { return connector_; }
  uint32_t crtc() const { return crtc_; }

  // DisplaySnapshot overrides:
  std::string ToString() const override;

 private:
  scoped_refptr<DrmDevice> drm_;
  uint32_t connector_;
  uint32_t crtc_;
  std::string name_;
  bool overscan_flag_;

  DISALLOW_COPY_AND_ASSIGN(DrmDisplaySnapshot);
};

}  // namespace ui

#endif  // UI_OZONE_PLATFORM_DRM_GPU_DRM_DISPLAY_SNAPSHOT_H_