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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
|
// 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_GPU_PLATFORM_SUPPORT_H_
#define UI_OZONE_PLATFORM_DRM_GPU_DRM_GPU_PLATFORM_SUPPORT_H_
#include "base/containers/scoped_ptr_hash_map.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/scoped_vector.h"
#include "ipc/message_filter.h"
#include "ui/display/types/display_constants.h"
#include "ui/gfx/native_widget_types.h"
#include "ui/ozone/public/gpu_platform_support.h"
class SkBitmap;
namespace base {
class FilePath;
class SingleThreadTaskRunner;
struct FileDescriptor;
}
namespace gfx {
class Point;
class Rect;
}
namespace ui {
class DrmDeviceManager;
class DrmGpuDisplayManager;
class DrmSurfaceFactory;
class DrmWindow;
class ScreenManager;
struct DisplayMode_Params;
struct DisplaySnapshot_Params;
struct GammaRampRGBEntry;
class DrmGpuPlatformSupport : public GpuPlatformSupport {
public:
DrmGpuPlatformSupport(DrmDeviceManager* drm_device_manager,
ScreenManager* screen_manager,
scoped_ptr<DrmGpuDisplayManager> ndd);
~DrmGpuPlatformSupport() override;
void AddHandler(scoped_ptr<GpuPlatformSupport> handler);
// GpuPlatformSupport:
void OnChannelEstablished(IPC::Sender* sender) override;
void RelinquishGpuResources(const base::Closure& callback) override;
IPC::MessageFilter* GetMessageFilter() override;
// IPC::Listener:
bool OnMessageReceived(const IPC::Message& message) override;
private:
void OnCreateWindowDelegate(gfx::AcceleratedWidget widget);
void OnDestroyWindowDelegate(gfx::AcceleratedWidget widget);
void OnWindowBoundsChanged(gfx::AcceleratedWidget widget,
const gfx::Rect& bounds);
void OnCursorSet(gfx::AcceleratedWidget widget,
const std::vector<SkBitmap>& bitmaps,
const gfx::Point& location,
int frame_delay_ms);
void OnCursorMove(gfx::AcceleratedWidget widget, const gfx::Point& location);
// Display related IPC handlers.
void OnRefreshNativeDisplays();
void OnConfigureNativeDisplay(int64_t id,
const DisplayMode_Params& mode,
const gfx::Point& origin);
void OnDisableNativeDisplay(int64_t id);
void OnTakeDisplayControl();
void OnRelinquishDisplayControl();
void OnAddGraphicsDevice(const base::FilePath& path,
const base::FileDescriptor& fd);
void OnRemoveGraphicsDevice(const base::FilePath& path);
void OnGetHDCPState(int64_t display_id);
void OnSetHDCPState(int64_t display_id, HDCPState state);
void OnSetGammaRamp(int64_t id, const std::vector<GammaRampRGBEntry>& lut);
void SetIOTaskRunner(
const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner);
IPC::Sender* sender_; // Not owned.
DrmDeviceManager* drm_device_manager_; // Not owned.
ScreenManager* screen_manager_; // Not owned.
scoped_ptr<DrmGpuDisplayManager> display_manager_;
ScopedVector<GpuPlatformSupport> handlers_;
scoped_refptr<IPC::MessageFilter> filter_;
};
} // namespace ui
#endif // UI_OZONE_PLATFORM_DRM_GPU_DRM_GPU_PLATFORM_SUPPORT_H_
|