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_DRI_SURFACE_FACTORY_H_ | 5 #ifndef UI_OZONE_PLATFORM_DRI_DRI_SURFACE_FACTORY_H_ |
6 #define UI_OZONE_PLATFORM_DRI_DRI_SURFACE_FACTORY_H_ | 6 #define UI_OZONE_PLATFORM_DRI_DRI_SURFACE_FACTORY_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.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 DriWindowDelegateManager; | 13 class DriWindowDelegateManager; |
14 class DriWrapper; | 14 class DriWrapper; |
15 class SurfaceOzoneCanvas; | 15 class SurfaceOzoneCanvas; |
16 | 16 |
17 // SurfaceFactoryOzone implementation on top of DRM/KMS using dumb buffers. | 17 // SurfaceFactoryOzone implementation on top of DRM/KMS using dumb buffers. |
18 // This implementation is used in conjunction with the software rendering | 18 // This implementation is used in conjunction with the software rendering |
19 // path. | 19 // path. |
20 class DriSurfaceFactory : public SurfaceFactoryOzone { | 20 class DriSurfaceFactory : public SurfaceFactoryOzone { |
21 public: | 21 public: |
22 static const gfx::AcceleratedWidget kDefaultWidgetHandle; | |
23 | |
24 DriSurfaceFactory(DriWrapper* drm, DriWindowDelegateManager* window_manager); | 22 DriSurfaceFactory(DriWrapper* drm, DriWindowDelegateManager* window_manager); |
25 ~DriSurfaceFactory() override; | 23 ~DriSurfaceFactory() override; |
26 | 24 |
27 // Describes the state of the hardware after initialization. | |
28 enum HardwareState { | |
29 UNINITIALIZED, | |
30 INITIALIZED, | |
31 FAILED, | |
32 }; | |
33 | |
34 // Open the display device. | |
35 HardwareState InitializeHardware(); | |
36 | |
37 // Close the display device. | |
38 void ShutdownHardware(); | |
39 | |
40 // SurfaceFactoryOzone: | 25 // SurfaceFactoryOzone: |
41 scoped_ptr<SurfaceOzoneCanvas> CreateCanvasForWidget( | 26 scoped_ptr<SurfaceOzoneCanvas> CreateCanvasForWidget( |
42 gfx::AcceleratedWidget widget) override; | 27 gfx::AcceleratedWidget widget) override; |
43 bool LoadEGLGLES2Bindings( | 28 bool LoadEGLGLES2Bindings( |
44 AddGLLibraryCallback add_gl_library, | 29 AddGLLibraryCallback add_gl_library, |
45 SetGLGetProcAddressProcCallback set_gl_get_proc_address) override; | 30 SetGLGetProcAddressProcCallback set_gl_get_proc_address) override; |
46 | 31 |
47 protected: | 32 protected: |
48 | |
49 DriWrapper* drm_; // Not owned. | 33 DriWrapper* drm_; // Not owned. |
50 DriWindowDelegateManager* window_manager_; // Not owned. | 34 DriWindowDelegateManager* window_manager_; // Not owned. |
51 HardwareState state_; | |
52 | 35 |
53 DISALLOW_COPY_AND_ASSIGN(DriSurfaceFactory); | 36 DISALLOW_COPY_AND_ASSIGN(DriSurfaceFactory); |
54 }; | 37 }; |
55 | 38 |
56 } // namespace ui | 39 } // namespace ui |
57 | 40 |
58 #endif // UI_OZONE_PLATFORM_DRI_DRI_SURFACE_FACTORY_H_ | 41 #endif // UI_OZONE_PLATFORM_DRI_DRI_SURFACE_FACTORY_H_ |
OLD | NEW |