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