| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef UI_OZONE_PLATFORM_DRM_GPU_DRM_DISPLAY_H_ | 5 #ifndef UI_OZONE_PLATFORM_DRM_GPU_DRM_DISPLAY_H_ |
| 6 #define UI_OZONE_PLATFORM_DRM_GPU_DRM_DISPLAY_H_ | 6 #define UI_OZONE_PLATFORM_DRM_GPU_DRM_DISPLAY_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 11 #include "ui/display/types/display_constants.h" | 11 #include "ui/display/types/display_constants.h" |
| 12 #include "ui/gfx/geometry/point.h" |
| 12 | 13 |
| 13 typedef struct _drmModeModeInfo drmModeModeInfo; | 14 typedef struct _drmModeModeInfo drmModeModeInfo; |
| 14 | 15 |
| 15 namespace gfx { | |
| 16 class Point; | |
| 17 } | |
| 18 | |
| 19 namespace ui { | 16 namespace ui { |
| 20 | 17 |
| 21 class DrmDevice; | 18 class DrmDevice; |
| 22 class ScreenManager; | 19 class ScreenManager; |
| 23 | 20 |
| 24 struct GammaRampRGBEntry; | 21 struct GammaRampRGBEntry; |
| 25 | 22 |
| 26 class DrmDisplay { | 23 class DrmDisplay { |
| 27 public: | 24 public: |
| 28 DrmDisplay(ScreenManager* screen_manager, | 25 DrmDisplay(ScreenManager* screen_manager, |
| 29 int64_t display_id, | 26 int64_t display_id, |
| 30 const scoped_refptr<DrmDevice>& drm, | 27 const scoped_refptr<DrmDevice>& drm, |
| 31 uint32_t crtc, | 28 uint32_t crtc, |
| 32 uint32_t connector, | 29 uint32_t connector, |
| 33 const std::vector<drmModeModeInfo>& modes); | 30 const std::vector<drmModeModeInfo>& modes, |
| 31 const gfx::Point& origin); |
| 34 ~DrmDisplay(); | 32 ~DrmDisplay(); |
| 35 | 33 |
| 36 int64_t display_id() const { return display_id_; } | 34 int64_t display_id() const { return display_id_; } |
| 37 scoped_refptr<DrmDevice> drm() const { return drm_; } | 35 scoped_refptr<DrmDevice> drm() const { return drm_; } |
| 38 uint32_t crtc() const { return crtc_; } | 36 uint32_t crtc() const { return crtc_; } |
| 39 uint32_t connector() const { return connector_; } | 37 uint32_t connector() const { return connector_; } |
| 40 const std::vector<drmModeModeInfo>& modes() const { return modes_; } | 38 const std::vector<drmModeModeInfo>& modes() const { return modes_; } |
| 39 gfx::Point origin() const { return origin_; } |
| 41 | 40 |
| 42 bool Configure(const drmModeModeInfo* mode, const gfx::Point& origin); | 41 bool Configure(const drmModeModeInfo* mode, const gfx::Point& origin); |
| 43 bool GetHDCPState(HDCPState* state); | 42 bool GetHDCPState(HDCPState* state); |
| 44 bool SetHDCPState(HDCPState state); | 43 bool SetHDCPState(HDCPState state); |
| 45 void SetGammaRamp(const std::vector<GammaRampRGBEntry>& lut); | 44 void SetGammaRamp(const std::vector<GammaRampRGBEntry>& lut); |
| 46 | 45 |
| 47 private: | 46 private: |
| 48 ScreenManager* screen_manager_; // Not owned. | 47 ScreenManager* screen_manager_; // Not owned. |
| 49 | 48 |
| 50 int64_t display_id_; | 49 int64_t display_id_; |
| 51 scoped_refptr<DrmDevice> drm_; | 50 scoped_refptr<DrmDevice> drm_; |
| 52 uint32_t crtc_; | 51 uint32_t crtc_; |
| 53 uint32_t connector_; | 52 uint32_t connector_; |
| 54 std::vector<drmModeModeInfo> modes_; | 53 std::vector<drmModeModeInfo> modes_; |
| 54 gfx::Point origin_; |
| 55 | 55 |
| 56 DISALLOW_COPY_AND_ASSIGN(DrmDisplay); | 56 DISALLOW_COPY_AND_ASSIGN(DrmDisplay); |
| 57 }; | 57 }; |
| 58 | 58 |
| 59 } // namespace ui | 59 } // namespace ui |
| 60 | 60 |
| 61 #endif // UI_OZONE_PLATFORM_DRM_GPU_DRM_DISPLAY_H_ | 61 #endif // UI_OZONE_PLATFORM_DRM_GPU_DRM_DISPLAY_H_ |
| OLD | NEW |