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 "ui/gfx/native_widget_types.h"
12 #include "ui/ozone/public/gpu_platform_support.h"
23 class DriSurfaceFactory;
24 class DriWindowDelegate;
25 class DriWindowDelegateManager;
26 class NativeDisplayDelegateDri;
29 struct DisplayMode_Params;
30 struct DisplaySnapshot_Params;
32 class DriGpuPlatformSupport : public GpuPlatformSupport {
34 DriGpuPlatformSupport(DriSurfaceFactory* dri,
35 DriWindowDelegateManager* window_manager,
36 ScreenManager* screen_manager,
37 scoped_ptr<NativeDisplayDelegateDri> ndd);
38 ~DriGpuPlatformSupport() override;
40 void AddHandler(scoped_ptr<GpuPlatformSupport> handler);
42 // GpuPlatformSupport:
43 void OnChannelEstablished(IPC::Sender* sender) override;
46 bool OnMessageReceived(const IPC::Message& message) override;
49 void OnCreateWindowDelegate(gfx::AcceleratedWidget widget);
50 void OnDestroyWindowDelegate(gfx::AcceleratedWidget widget);
51 void OnWindowBoundsChanged(gfx::AcceleratedWidget widget,
52 const gfx::Rect& bounds);
53 void OnCursorSet(gfx::AcceleratedWidget widget,
54 const std::vector<SkBitmap>& bitmaps,
55 const gfx::Point& location,
57 void OnCursorMove(gfx::AcceleratedWidget widget, const gfx::Point& location);
59 // Display related IPC handlers.
61 void OnRefreshNativeDisplays(
62 const std::vector<DisplaySnapshot_Params>& cached_displays);
63 void OnConfigureNativeDisplay(int64_t id,
64 const DisplayMode_Params& mode,
65 const gfx::Point& origin);
66 void OnDisableNativeDisplay(int64_t id);
67 void OnTakeDisplayControl();
68 void OnRelinquishDisplayControl();
70 IPC::Sender* sender_; // Not owned.
71 DriSurfaceFactory* dri_; // Not owned.
72 DriWindowDelegateManager* window_manager_; // Not owned.
73 ScreenManager* screen_manager_; // Not owned.
75 scoped_ptr<NativeDisplayDelegateDri> ndd_;
76 ScopedVector<GpuPlatformSupport> handlers_;
81 #endif // UI_OZONE_PLATFORM_DRI_DRI_GPU_PLATFORM_SUPPORT_H_