| 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_DRM_GPU_GBM_SURFACE_FACTORY_H_ | 5 #ifndef UI_OZONE_PLATFORM_DRM_GPU_GBM_SURFACE_FACTORY_H_ |
| 6 #define UI_OZONE_PLATFORM_DRM_GPU_GBM_SURFACE_FACTORY_H_ | 6 #define UI_OZONE_PLATFORM_DRM_GPU_GBM_SURFACE_FACTORY_H_ |
| 7 | 7 |
| 8 #include "ui/ozone/platform/drm/gpu/drm_surface_factory.h" | 8 #include "ui/ozone/platform/drm/gpu/drm_surface_factory.h" |
| 9 | 9 |
| 10 namespace ui { | 10 namespace ui { |
| 11 | 11 |
| 12 class DrmDeviceManager; | 12 class DrmThread; |
| 13 class DrmWindow; | |
| 14 class GbmDevice; | 13 class GbmDevice; |
| 15 class ScreenManager; | |
| 16 | 14 |
| 17 class GbmSurfaceFactory : public DrmSurfaceFactory { | 15 class GbmSurfaceFactory : public DrmSurfaceFactory { |
| 18 public: | 16 public: |
| 19 GbmSurfaceFactory(bool allow_surfaceless); | 17 GbmSurfaceFactory(bool allow_surfaceless, DrmThread* drm_thread); |
| 20 ~GbmSurfaceFactory() override; | 18 ~GbmSurfaceFactory() override; |
| 21 | 19 |
| 22 void InitializeGpu(DrmDeviceManager* drm_device_manager, | |
| 23 ScreenManager* screen_manager); | |
| 24 | |
| 25 // DrmSurfaceFactory: | 20 // DrmSurfaceFactory: |
| 26 intptr_t GetNativeDisplay() override; | 21 intptr_t GetNativeDisplay() override; |
| 27 const int32_t* GetEGLSurfaceProperties(const int32_t* desired_list) override; | 22 const int32_t* GetEGLSurfaceProperties(const int32_t* desired_list) override; |
| 28 bool LoadEGLGLES2Bindings( | 23 bool LoadEGLGLES2Bindings( |
| 29 AddGLLibraryCallback add_gl_library, | 24 AddGLLibraryCallback add_gl_library, |
| 30 SetGLGetProcAddressProcCallback set_gl_get_proc_address) override; | 25 SetGLGetProcAddressProcCallback set_gl_get_proc_address) override; |
| 31 scoped_ptr<SurfaceOzoneCanvas> CreateCanvasForWidget( | 26 scoped_ptr<SurfaceOzoneCanvas> CreateCanvasForWidget( |
| 32 gfx::AcceleratedWidget widget) override; | 27 gfx::AcceleratedWidget widget) override; |
| 33 scoped_ptr<ui::SurfaceOzoneEGL> CreateEGLSurfaceForWidget( | 28 scoped_ptr<ui::SurfaceOzoneEGL> CreateEGLSurfaceForWidget( |
| 34 gfx::AcceleratedWidget w) override; | 29 gfx::AcceleratedWidget w) override; |
| 35 scoped_ptr<SurfaceOzoneEGL> CreateSurfacelessEGLSurfaceForWidget( | 30 scoped_ptr<SurfaceOzoneEGL> CreateSurfacelessEGLSurfaceForWidget( |
| 36 gfx::AcceleratedWidget widget) override; | 31 gfx::AcceleratedWidget widget) override; |
| 37 scoped_refptr<ui::NativePixmap> CreateNativePixmap( | 32 scoped_refptr<ui::NativePixmap> CreateNativePixmap( |
| 38 gfx::AcceleratedWidget widget, | 33 gfx::AcceleratedWidget widget, |
| 39 gfx::Size size, | 34 gfx::Size size, |
| 40 gfx::BufferFormat format, | 35 gfx::BufferFormat format, |
| 41 gfx::BufferUsage usage) override; | 36 gfx::BufferUsage usage) override; |
| 42 bool CanShowPrimaryPlaneAsOverlay() override; | 37 bool CanShowPrimaryPlaneAsOverlay() override; |
| 43 | 38 |
| 44 private: | 39 private: |
| 45 scoped_refptr<GbmDevice> GetGbmDevice(gfx::AcceleratedWidget widget); | 40 scoped_refptr<GbmDevice> GetGbmDevice(gfx::AcceleratedWidget widget); |
| 46 | 41 |
| 47 bool allow_surfaceless_; | 42 bool allow_surfaceless_; |
| 48 | 43 |
| 49 DrmDeviceManager* drm_device_manager_; // Not owned. | |
| 50 | |
| 51 DISALLOW_COPY_AND_ASSIGN(GbmSurfaceFactory); | 44 DISALLOW_COPY_AND_ASSIGN(GbmSurfaceFactory); |
| 52 }; | 45 }; |
| 53 | 46 |
| 54 } // namespace ui | 47 } // namespace ui |
| 55 | 48 |
| 56 #endif // UI_OZONE_PLATFORM_DRM_GPU_GBM_SURFACE_FACTORY_H_ | 49 #endif // UI_OZONE_PLATFORM_DRM_GPU_GBM_SURFACE_FACTORY_H_ |
| OLD | NEW |