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