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

Side by Side Diff: ui/ozone/platform/drm/gpu/drm_thread_message_proxy.h

Issue 1311043016: Switch DRM platform to using a separate thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mv-drm-calls-on-thread2
Patch Set: update & fix clang Created 5 years, 2 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
OLDNEW
1 // Copyright 2014 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_GPU_PLATFORM_SUPPORT_H_ 5 #ifndef UI_OZONE_PLATFORM_DRM_GPU_DRM_THREAD_MESSAGE_PROXY_H_
6 #define UI_OZONE_PLATFORM_DRM_GPU_DRM_GPU_PLATFORM_SUPPORT_H_ 6 #define UI_OZONE_PLATFORM_DRM_GPU_DRM_THREAD_MESSAGE_PROXY_H_
7 7
8 #include "base/containers/scoped_ptr_hash_map.h" 8 #include "base/memory/weak_ptr.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "ipc/message_filter.h" 9 #include "ipc/message_filter.h"
11 #include "ui/display/types/display_constants.h" 10 #include "ui/display/types/display_constants.h"
11 #include "ui/display/types/gamma_ramp_rgb_entry.h"
12 #include "ui/gfx/native_widget_types.h" 12 #include "ui/gfx/native_widget_types.h"
13 #include "ui/ozone/public/gpu_platform_support.h"
14
15 class SkBitmap;
16 13
17 namespace base { 14 namespace base {
15 struct FileDescriptor;
18 class FilePath; 16 class FilePath;
19 class SingleThreadTaskRunner;
20 struct FileDescriptor;
21 } 17 }
22 18
23 namespace gfx { 19 namespace gfx {
24 class Point; 20 class Point;
25 class Rect; 21 class Rect;
26 } 22 }
27 23
28 namespace ui { 24 namespace ui {
29 25
30 class DrmDeviceManager; 26 class DrmThread;
31 class DrmGpuDisplayManager;
32 class DrmSurfaceFactory;
33 class DrmWindow;
34 class ScreenManager;
35 class ScanoutBufferGenerator;
36
37 struct DisplayMode_Params; 27 struct DisplayMode_Params;
38 struct DisplaySnapshot_Params; 28 struct DisplaySnapshot_Params;
39 struct OverlayCheck_Params; 29 struct OverlayCheck_Params;
40 struct GammaRampRGBEntry;
41 30
42 class DrmGpuPlatformSupport : public GpuPlatformSupport { 31 class DrmThreadMessageProxy : public IPC::MessageFilter {
43 public: 32 public:
44 DrmGpuPlatformSupport(DrmDeviceManager* drm_device_manager, 33 DrmThreadMessageProxy(DrmThread* drm_thread);
45 ScreenManager* screen_manager,
46 ScanoutBufferGenerator* buffer_generator,
47 scoped_ptr<DrmGpuDisplayManager> display_manager);
48 ~DrmGpuPlatformSupport() override;
49 34
50 // GpuPlatformSupport: 35 // IPC::MessageFilter:
51 void OnChannelEstablished(IPC::Sender* sender) override; 36 void OnFilterAdded(IPC::Sender* sender) override;
52 IPC::MessageFilter* GetMessageFilter() override;
53
54 // IPC::Listener:
55 bool OnMessageReceived(const IPC::Message& message) override; 37 bool OnMessageReceived(const IPC::Message& message) override;
56 38
57 private: 39 private:
40 ~DrmThreadMessageProxy() override;
41
58 void OnCreateWindow(gfx::AcceleratedWidget widget); 42 void OnCreateWindow(gfx::AcceleratedWidget widget);
59 void OnDestroyWindow(gfx::AcceleratedWidget widget); 43 void OnDestroyWindow(gfx::AcceleratedWidget widget);
60 void OnWindowBoundsChanged(gfx::AcceleratedWidget widget, 44 void OnWindowBoundsChanged(gfx::AcceleratedWidget widget,
61 const gfx::Rect& bounds); 45 const gfx::Rect& bounds);
62 void OnCursorSet(gfx::AcceleratedWidget widget, 46 void OnCursorSet(gfx::AcceleratedWidget widget,
63 const std::vector<SkBitmap>& bitmaps, 47 const std::vector<SkBitmap>& bitmaps,
64 const gfx::Point& location, 48 const gfx::Point& location,
65 int frame_delay_ms); 49 int frame_delay_ms);
66 void OnCursorMove(gfx::AcceleratedWidget widget, const gfx::Point& location); 50 void OnCursorMove(gfx::AcceleratedWidget widget, const gfx::Point& location);
67 void OnCheckOverlayCapabilities( 51 void OnCheckOverlayCapabilities(
68 gfx::AcceleratedWidget widget, 52 gfx::AcceleratedWidget widget,
69 const std::vector<OverlayCheck_Params>& overlays); 53 const std::vector<OverlayCheck_Params>& overlays);
70 54
71 // Display related IPC handlers. 55 // Display related IPC handlers.
72 void OnRefreshNativeDisplays(); 56 void OnRefreshNativeDisplays();
73 void OnConfigureNativeDisplay(int64_t id, 57 void OnConfigureNativeDisplay(int64_t id,
74 const DisplayMode_Params& mode, 58 const DisplayMode_Params& mode,
75 const gfx::Point& origin); 59 const gfx::Point& origin);
76 void OnDisableNativeDisplay(int64_t id); 60 void OnDisableNativeDisplay(int64_t id);
77 void OnTakeDisplayControl(); 61 void OnTakeDisplayControl();
78 void OnRelinquishDisplayControl(); 62 void OnRelinquishDisplayControl();
79 void OnAddGraphicsDevice(const base::FilePath& path, 63 void OnAddGraphicsDevice(const base::FilePath& path,
80 const base::FileDescriptor& fd); 64 const base::FileDescriptor& fd);
81 void OnRemoveGraphicsDevice(const base::FilePath& path); 65 void OnRemoveGraphicsDevice(const base::FilePath& path);
82 void OnGetHDCPState(int64_t display_id); 66 void OnGetHDCPState(int64_t display_id);
83 void OnSetHDCPState(int64_t display_id, HDCPState state); 67 void OnSetHDCPState(int64_t display_id, HDCPState state);
84 void OnSetGammaRamp(int64_t id, const std::vector<GammaRampRGBEntry>& lut); 68 void OnSetGammaRamp(int64_t id, const std::vector<GammaRampRGBEntry>& lut);
85 69
86 void SetIOTaskRunner( 70 void OnCheckOverlayCapabilitiesCallback(
87 const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner); 71 gfx::AcceleratedWidget widget,
72 const std::vector<OverlayCheck_Params>& overlays) const;
73 void OnRefreshNativeDisplaysCallback(
74 const std::vector<DisplaySnapshot_Params>& displays) const;
75 void OnConfigureNativeDisplayCallback(int64_t display_id, bool success) const;
76 void OnDisableNativeDisplayCallback(int64_t display_id, bool success) const;
77 void OnTakeDisplayControlCallback(bool success) const;
78 void OnRelinquishDisplayControlCallback(bool success) const;
79 void OnGetHDCPStateCallback(int64_t display_id,
80 bool success,
81 HDCPState state) const;
82 void OnSetHDCPStateCallback(int64_t display_id, bool success) const;
88 83
89 IPC::Sender* sender_ = nullptr; // Not owned. 84 DrmThread* drm_thread_;
90 DrmDeviceManager* drm_device_manager_; // Not owned.
91 ScreenManager* screen_manager_; // Not owned.
92 ScanoutBufferGenerator* buffer_generator_; // Not owned.
93 85
94 scoped_ptr<DrmGpuDisplayManager> display_manager_; 86 IPC::Sender* sender_ = nullptr;
95 scoped_refptr<IPC::MessageFilter> filter_; 87
88 base::WeakPtrFactory<DrmThreadMessageProxy> weak_ptr_factory_;
89
90 DISALLOW_COPY_AND_ASSIGN(DrmThreadMessageProxy);
96 }; 91 };
97 92
98 } // namespace ui 93 } // namespace ui
99 94
100 #endif // UI_OZONE_PLATFORM_DRM_GPU_DRM_GPU_PLATFORM_SUPPORT_H_ 95 #endif // UI_OZONE_PLATFORM_DRM_GPU_DRM_THREAD_MESSAGE_PROXY_H_
OLDNEW
« no previous file with comments | « ui/ozone/platform/drm/gpu/drm_thread.cc ('k') | ui/ozone/platform/drm/gpu/drm_thread_message_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698