ozone: fix HDPMLegacy - do the PF after overlays, also clear old overlays
[chromium-blink-merge.git] / ui / ozone / platform / dri / dri_gpu_platform_support.h
blobdaae2ec731f939c9c6bc43ac724ba9b0d2ecbe14
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.
5 #ifndef UI_OZONE_PLATFORM_DRI_DRI_GPU_PLATFORM_SUPPORT_H_
6 #define UI_OZONE_PLATFORM_DRI_DRI_GPU_PLATFORM_SUPPORT_H_
8 #include "base/containers/scoped_ptr_hash_map.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "base/memory/scoped_vector.h"
11 #include "ipc/message_filter.h"
12 #include "ui/gfx/native_widget_types.h"
13 #include "ui/ozone/platform/dri/dri_helper_thread.h"
14 #include "ui/ozone/public/gpu_platform_support.h"
16 class SkBitmap;
18 namespace base {
19 class FilePath;
22 namespace gfx {
23 class Point;
24 class Rect;
27 namespace ui {
29 class DriSurfaceFactory;
30 class DriWindowDelegate;
31 class DriWindowDelegateManager;
32 class DriWrapper;
33 class NativeDisplayDelegateDri;
34 class ScreenManager;
36 struct DisplayMode_Params;
37 struct DisplaySnapshot_Params;
39 class DriGpuPlatformSupport : public GpuPlatformSupport {
40 public:
41 DriGpuPlatformSupport(DriWrapper* drm,
42 DriWindowDelegateManager* window_manager,
43 ScreenManager* screen_manager,
44 scoped_ptr<NativeDisplayDelegateDri> ndd);
45 ~DriGpuPlatformSupport() override;
47 void AddHandler(scoped_ptr<GpuPlatformSupport> handler);
49 // GpuPlatformSupport:
50 void OnChannelEstablished(IPC::Sender* sender) override;
51 void RelinquishGpuResources(const base::Closure& callback) override;
52 IPC::MessageFilter* GetMessageFilter() override;
54 // IPC::Listener:
55 bool OnMessageReceived(const IPC::Message& message) override;
57 private:
58 void OnCreateWindowDelegate(gfx::AcceleratedWidget widget);
59 void OnDestroyWindowDelegate(gfx::AcceleratedWidget widget);
60 void OnWindowBoundsChanged(gfx::AcceleratedWidget widget,
61 const gfx::Rect& bounds);
62 void OnCursorSet(gfx::AcceleratedWidget widget,
63 const std::vector<SkBitmap>& bitmaps,
64 const gfx::Point& location,
65 int frame_delay_ms);
66 void OnCursorMove(gfx::AcceleratedWidget widget, const gfx::Point& location);
68 // Display related IPC handlers.
69 void OnForceDPMSOn();
70 void OnRefreshNativeDisplays();
71 void OnConfigureNativeDisplay(int64_t id,
72 const DisplayMode_Params& mode,
73 const gfx::Point& origin);
74 void OnDisableNativeDisplay(int64_t id);
75 void OnTakeDisplayControl();
76 void OnRelinquishDisplayControl();
77 void OnAddGraphicsDevice(const base::FilePath& path);
78 void OnRemoveGraphicsDevice(const base::FilePath& path);
80 void OnFilterAdded();
82 IPC::Sender* sender_; // Not owned.
83 DriWrapper* drm_; // Not owned.
84 DriWindowDelegateManager* window_manager_; // Not owned.
85 ScreenManager* screen_manager_; // Not owned.
87 DriHelperThread helper_thread_;
88 scoped_ptr<NativeDisplayDelegateDri> ndd_;
89 ScopedVector<GpuPlatformSupport> handlers_;
90 scoped_refptr<IPC::MessageFilter> filter_;
93 } // namespace ui
95 #endif // UI_OZONE_PLATFORM_DRI_DRI_GPU_PLATFORM_SUPPORT_H_