OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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_DRI_GBM_SURFACE_FACTORY_H_ | 5 #ifndef UI_OZONE_PLATFORM_DRI_GBM_SURFACE_FACTORY_H_ |
6 #define UI_OZONE_PLATFORM_DRI_GBM_SURFACE_FACTORY_H_ | 6 #define UI_OZONE_PLATFORM_DRI_GBM_SURFACE_FACTORY_H_ |
7 | 7 |
8 #include "ui/ozone/platform/dri/dri_surface_factory.h" | 8 #include "ui/ozone/platform/dri/dri_surface_factory.h" |
9 | 9 |
10 struct gbm_device; | 10 struct gbm_device; |
11 | 11 |
12 namespace ui { | 12 namespace ui { |
13 | 13 |
| 14 class DriWindowDelegate; |
| 15 class DriWindowManager; |
| 16 |
14 class GbmSurfaceFactory : public DriSurfaceFactory { | 17 class GbmSurfaceFactory : public DriSurfaceFactory { |
15 public: | 18 public: |
16 GbmSurfaceFactory(bool allow_surfaceless); | 19 GbmSurfaceFactory(bool allow_surfaceless); |
17 virtual ~GbmSurfaceFactory(); | 20 virtual ~GbmSurfaceFactory(); |
18 | 21 |
19 void InitializeGpu(DriWrapper* dri, | 22 void InitializeGpu(DriWrapper* dri, |
20 gbm_device* device, | 23 gbm_device* device, |
21 ScreenManager* screen_manager); | 24 ScreenManager* screen_manager, |
| 25 DriWindowManager* window_manager); |
22 | 26 |
23 // DriSurfaceFactory: | 27 // DriSurfaceFactory: |
24 virtual intptr_t GetNativeDisplay() OVERRIDE; | 28 virtual intptr_t GetNativeDisplay() OVERRIDE; |
25 virtual const int32_t* GetEGLSurfaceProperties( | 29 virtual const int32_t* GetEGLSurfaceProperties( |
26 const int32_t* desired_list) OVERRIDE; | 30 const int32_t* desired_list) OVERRIDE; |
27 virtual bool LoadEGLGLES2Bindings( | 31 virtual bool LoadEGLGLES2Bindings( |
28 AddGLLibraryCallback add_gl_library, | 32 AddGLLibraryCallback add_gl_library, |
29 SetGLGetProcAddressProcCallback set_gl_get_proc_address) OVERRIDE; | 33 SetGLGetProcAddressProcCallback set_gl_get_proc_address) OVERRIDE; |
30 virtual scoped_ptr<ui::SurfaceOzoneEGL> CreateEGLSurfaceForWidget( | 34 virtual scoped_ptr<ui::SurfaceOzoneEGL> CreateEGLSurfaceForWidget( |
31 gfx::AcceleratedWidget w) OVERRIDE; | 35 gfx::AcceleratedWidget w) OVERRIDE; |
32 virtual scoped_ptr<SurfaceOzoneEGL> CreateSurfacelessEGLSurfaceForWidget( | 36 virtual scoped_ptr<SurfaceOzoneEGL> CreateSurfacelessEGLSurfaceForWidget( |
33 gfx::AcceleratedWidget widget) OVERRIDE; | 37 gfx::AcceleratedWidget widget) OVERRIDE; |
34 virtual scoped_refptr<ui::NativePixmap> CreateNativePixmap( | 38 virtual scoped_refptr<ui::NativePixmap> CreateNativePixmap( |
35 gfx::Size size, | 39 gfx::Size size, |
36 BufferFormat format) OVERRIDE; | 40 BufferFormat format) OVERRIDE; |
37 virtual bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget, | 41 virtual bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget, |
38 int plane_z_order, | 42 int plane_z_order, |
39 gfx::OverlayTransform plane_transform, | 43 gfx::OverlayTransform plane_transform, |
40 scoped_refptr<NativePixmap> buffer, | 44 scoped_refptr<NativePixmap> buffer, |
41 const gfx::Rect& display_bounds, | 45 const gfx::Rect& display_bounds, |
42 const gfx::RectF& crop_rect) OVERRIDE; | 46 const gfx::RectF& crop_rect) OVERRIDE; |
43 virtual bool CanShowPrimaryPlaneAsOverlay() OVERRIDE; | 47 virtual bool CanShowPrimaryPlaneAsOverlay() OVERRIDE; |
44 | 48 |
45 private: | 49 private: |
| 50 DriWindowDelegate* GetOrCreateWindowDelegate(gfx::AcceleratedWidget widget); |
| 51 |
46 gbm_device* device_; // Not owned. | 52 gbm_device* device_; // Not owned. |
47 bool allow_surfaceless_; | 53 bool allow_surfaceless_; |
48 | 54 |
49 DISALLOW_COPY_AND_ASSIGN(GbmSurfaceFactory); | 55 DISALLOW_COPY_AND_ASSIGN(GbmSurfaceFactory); |
50 }; | 56 }; |
51 | 57 |
52 } // namespace ui | 58 } // namespace ui |
53 | 59 |
54 #endif // UI_OZONE_PLATFORM_DRI_GBM_SURFACE_FACTORY_H_ | 60 #endif // UI_OZONE_PLATFORM_DRI_GBM_SURFACE_FACTORY_H_ |
OLD | NEW |