Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / ui / ozone / platform / dri / gpu_platform_support_host_gbm.h
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.
4
5 #ifndef UI_OZONE_PLATFORM_DRI_GPU_PLATFORM_SUPPORT_HOST_GBM_H_
6 #define UI_OZONE_PLATFORM_DRI_GPU_PLATFORM_SUPPORT_HOST_GBM_H_
7
8 #include <vector>
9
10 #include "ui/gfx/native_widget_types.h"
11 #include "ui/ozone/platform/dri/hardware_cursor_delegate.h"
12 #include "ui/ozone/public/gpu_platform_support_host.h"
13
14 class SkBitmap;
15
16 namespace gfx {
17 class Point;
18 }
19
20 namespace ui {
21
22 class GpuPlatformSupportHostGbm : public GpuPlatformSupportHost,
23                                   public HardwareCursorDelegate,
24                                   public IPC::Sender {
25  public:
26   GpuPlatformSupportHostGbm();
27   virtual ~GpuPlatformSupportHostGbm();
28
29   void RegisterHandler(GpuPlatformSupportHost* handler);
30   void UnregisterHandler(GpuPlatformSupportHost* handler);
31
32   // GpuPlatformSupportHost:
33   virtual void OnChannelEstablished(int host_id, IPC::Sender* sender) OVERRIDE;
34   virtual void OnChannelDestroyed(int host_id) OVERRIDE;
35
36   // IPC::Listener:
37   virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
38
39   // IPC::Sender:
40   virtual bool Send(IPC::Message* message) OVERRIDE;
41
42   // HardwareCursorDelegate:
43   virtual void SetHardwareCursor(gfx::AcceleratedWidget widget,
44                                  const SkBitmap& bitmap,
45                                  const gfx::Point& location) OVERRIDE;
46   virtual void MoveHardwareCursor(gfx::AcceleratedWidget widget,
47                                   const gfx::Point& location) OVERRIDE;
48
49  private:
50   int host_id_;
51   IPC::Sender* sender_;
52   std::vector<GpuPlatformSupportHost*> handlers_;
53 };
54
55 }  // namespace ui
56
57 #endif  // UI_OZONE_GPU_GPU_PLATFORM_SUPPORT_HOST_GBM_H_