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_GBM_H_ 6 #define UI_OZONE_PLATFORM_DRI_GPU_PLATFORM_SUPPORT_GBM_H_ 7 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" 13 14 class SkBitmap; 15 16 namespace gfx { 17 class Point; 18 class Rect; 19 } 20 21 namespace ui { 22 23 class DriSurfaceFactory; 24 class DriWindowDelegate; 25 class DriWindowDelegateManager; 26 class ScreenManager; 27 28 class GpuPlatformSupportGbm : public GpuPlatformSupport { 29 public: 30 GpuPlatformSupportGbm(DriSurfaceFactory* dri, 31 DriWindowDelegateManager* window_manager, 32 ScreenManager* screen_manager); 33 virtual ~GpuPlatformSupportGbm(); 34 35 void AddHandler(scoped_ptr<GpuPlatformSupport> handler); 36 37 // GpuPlatformSupport: 38 virtual void OnChannelEstablished(IPC::Sender* sender) OVERRIDE; 39 40 // IPC::Listener: 41 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; 42 43 private: 44 void OnCreateWindowDelegate(gfx::AcceleratedWidget widget); 45 void OnDestroyWindowDelegate(gfx::AcceleratedWidget widget); 46 void OnWindowBoundsChanged(gfx::AcceleratedWidget widget, 47 const gfx::Rect& bounds); 48 void OnCursorSet(gfx::AcceleratedWidget widget, 49 const std::vector<SkBitmap>& bitmaps, 50 const gfx::Point& location, 51 int frame_delay_ms); 52 void OnCursorMove(gfx::AcceleratedWidget widget, const gfx::Point& location); 53 54 IPC::Sender* sender_; 55 DriSurfaceFactory* dri_; 56 DriWindowDelegateManager* window_manager_; 57 ScreenManager* screen_manager_; 58 ScopedVector<GpuPlatformSupport> handlers_; 59 }; 60 61 } // namespace ui 62 63 #endif // UI_OZONE_PLATFORM_DRI_GPU_PLATFORM_SUPPORT_GBM_H_ 64