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 namespace ui { | 10 namespace ui { |
11 | 11 |
12 class DriWindowDelegate; | 12 class DriWindowDelegate; |
13 class DriWindowDelegateManager; | 13 class DriWindowDelegateManager; |
14 class DrmDeviceManager; | 14 class DrmDeviceManager; |
15 class GbmWrapper; | 15 class GbmWrapper; |
16 | 16 |
17 class GbmSurfaceFactory : public DriSurfaceFactory { | 17 class GbmSurfaceFactory : public DriSurfaceFactory { |
18 public: | 18 public: |
19 GbmSurfaceFactory(bool allow_surfaceless); | 19 GbmSurfaceFactory(bool allow_surfaceless); |
20 ~GbmSurfaceFactory() override; | 20 ~GbmSurfaceFactory() override; |
21 | 21 |
22 void InitializeGpu(const scoped_refptr<GbmWrapper>& gbm, | 22 void InitializeGpu(DrmDeviceManager* drm_device_manager, |
23 DrmDeviceManager* drm_device_manager, | |
24 DriWindowDelegateManager* window_manager); | 23 DriWindowDelegateManager* window_manager); |
25 | 24 |
26 // DriSurfaceFactory: | 25 // DriSurfaceFactory: |
27 intptr_t GetNativeDisplay() override; | 26 intptr_t GetNativeDisplay() override; |
28 int GetDrmFd() override; | 27 int GetDrmFd() override; |
29 const int32_t* GetEGLSurfaceProperties(const int32_t* desired_list) override; | 28 const int32_t* GetEGLSurfaceProperties(const int32_t* desired_list) override; |
30 bool LoadEGLGLES2Bindings( | 29 bool LoadEGLGLES2Bindings( |
31 AddGLLibraryCallback add_gl_library, | 30 AddGLLibraryCallback add_gl_library, |
32 SetGLGetProcAddressProcCallback set_gl_get_proc_address) override; | 31 SetGLGetProcAddressProcCallback set_gl_get_proc_address) override; |
33 scoped_ptr<ui::SurfaceOzoneEGL> CreateEGLSurfaceForWidget( | 32 scoped_ptr<ui::SurfaceOzoneEGL> CreateEGLSurfaceForWidget( |
(...skipping 12 matching lines...) Expand all Loading... |
46 gfx::OverlayTransform plane_transform, | 45 gfx::OverlayTransform plane_transform, |
47 scoped_refptr<NativePixmap> buffer, | 46 scoped_refptr<NativePixmap> buffer, |
48 const gfx::Rect& display_bounds, | 47 const gfx::Rect& display_bounds, |
49 const gfx::RectF& crop_rect) override; | 48 const gfx::RectF& crop_rect) override; |
50 bool CanShowPrimaryPlaneAsOverlay() override; | 49 bool CanShowPrimaryPlaneAsOverlay() override; |
51 bool CanCreateNativePixmap(BufferUsage usage) override; | 50 bool CanCreateNativePixmap(BufferUsage usage) override; |
52 | 51 |
53 private: | 52 private: |
54 scoped_refptr<GbmWrapper> GetGbmDevice(gfx::AcceleratedWidget widget); | 53 scoped_refptr<GbmWrapper> GetGbmDevice(gfx::AcceleratedWidget widget); |
55 | 54 |
56 scoped_refptr<GbmWrapper> gbm_; | |
57 bool allow_surfaceless_; | 55 bool allow_surfaceless_; |
58 | 56 |
59 DrmDeviceManager* drm_device_manager_; // Not owned. | 57 DrmDeviceManager* drm_device_manager_; // Not owned. |
60 | 58 |
61 DISALLOW_COPY_AND_ASSIGN(GbmSurfaceFactory); | 59 DISALLOW_COPY_AND_ASSIGN(GbmSurfaceFactory); |
62 }; | 60 }; |
63 | 61 |
64 } // namespace ui | 62 } // namespace ui |
65 | 63 |
66 #endif // UI_OZONE_PLATFORM_DRI_GBM_SURFACE_FACTORY_H_ | 64 #endif // UI_OZONE_PLATFORM_DRI_GBM_SURFACE_FACTORY_H_ |
OLD | NEW |