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