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