OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_CAST_SURFACE_FACTORY_CAST_H_ | 5 #ifndef UI_OZONE_PLATFORM_CAST_SURFACE_FACTORY_CAST_H_ |
6 #define UI_OZONE_PLATFORM_CAST_SURFACE_FACTORY_CAST_H_ | 6 #define UI_OZONE_PLATFORM_CAST_SURFACE_FACTORY_CAST_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 | 11 |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "ui/gfx/geometry/rect.h" | 13 #include "ui/gfx/geometry/rect.h" |
14 #include "ui/gfx/geometry/size.h" | 14 #include "ui/gfx/geometry/size.h" |
| 15 #include "ui/gl/gl_surface.h" |
15 #include "ui/ozone/public/surface_factory_ozone.h" | 16 #include "ui/ozone/public/surface_factory_ozone.h" |
16 | 17 |
17 namespace chromecast { | 18 namespace chromecast { |
18 class CastEglPlatform; | 19 class CastEglPlatform; |
19 } | 20 } |
20 | 21 |
21 namespace ui { | 22 namespace ui { |
22 | 23 |
23 // SurfaceFactoryOzone implementation for OzonePlatformCast. | 24 // SurfaceFactoryOzone implementation for OzonePlatformCast. |
24 class SurfaceFactoryCast : public SurfaceFactoryOzone { | 25 class SurfaceFactoryCast : public SurfaceFactoryOzone { |
25 public: | 26 public: |
26 SurfaceFactoryCast(); | 27 SurfaceFactoryCast(); |
27 explicit SurfaceFactoryCast( | 28 explicit SurfaceFactoryCast( |
28 std::unique_ptr<chromecast::CastEglPlatform> egl_platform); | 29 std::unique_ptr<chromecast::CastEglPlatform> egl_platform); |
29 ~SurfaceFactoryCast() override; | 30 ~SurfaceFactoryCast() override; |
30 | 31 |
31 // SurfaceFactoryOzone implementation: | 32 // SurfaceFactoryOzone implementation: |
| 33 bool UseNewSurfaceAPI() override; |
| 34 scoped_refptr<gl::GLSurface> CreateViewGLSurface( |
| 35 gl::GLImplementation implementation, |
| 36 gfx::AcceleratedWidget widget) override; |
| 37 scoped_refptr<gl::GLSurface> CreateOffscreenGLSurface( |
| 38 gl::GLImplementation implementation, |
| 39 const gfx::Size& size) override; |
32 std::unique_ptr<SurfaceOzoneCanvas> CreateCanvasForWidget( | 40 std::unique_ptr<SurfaceOzoneCanvas> CreateCanvasForWidget( |
33 gfx::AcceleratedWidget widget) override; | 41 gfx::AcceleratedWidget widget) override; |
34 intptr_t GetNativeDisplay() override; | 42 intptr_t GetNativeDisplay() override; |
35 std::unique_ptr<SurfaceOzoneEGL> CreateEGLSurfaceForWidget( | |
36 gfx::AcceleratedWidget widget) override; | |
37 scoped_refptr<NativePixmap> CreateNativePixmap( | 43 scoped_refptr<NativePixmap> CreateNativePixmap( |
38 gfx::AcceleratedWidget widget, | 44 gfx::AcceleratedWidget widget, |
39 gfx::Size size, | 45 gfx::Size size, |
40 gfx::BufferFormat format, | 46 gfx::BufferFormat format, |
41 gfx::BufferUsage usage) override; | 47 gfx::BufferUsage usage) override; |
42 bool LoadEGLGLES2Bindings( | 48 bool LoadEGLGLES2Bindings( |
43 AddGLLibraryCallback add_gl_library, | 49 AddGLLibraryCallback add_gl_library, |
44 SetGLGetProcAddressProcCallback set_gl_get_proc_address) override; | 50 SetGLGetProcAddressProcCallback set_gl_get_proc_address) override; |
45 | 51 |
46 intptr_t GetNativeWindow(); | 52 intptr_t GetNativeWindow(); |
(...skipping 26 matching lines...) Expand all Loading... |
73 gfx::Rect overlay_bounds_; | 79 gfx::Rect overlay_bounds_; |
74 int previous_frame_overlay_count_; | 80 int previous_frame_overlay_count_; |
75 gfx::Rect previous_frame_overlay_bounds_; | 81 gfx::Rect previous_frame_overlay_bounds_; |
76 | 82 |
77 DISALLOW_COPY_AND_ASSIGN(SurfaceFactoryCast); | 83 DISALLOW_COPY_AND_ASSIGN(SurfaceFactoryCast); |
78 }; | 84 }; |
79 | 85 |
80 } // namespace ui | 86 } // namespace ui |
81 | 87 |
82 #endif // UI_OZONE_PLATFORM_CAST_SURFACE_FACTORY_CAST_H_ | 88 #endif // UI_OZONE_PLATFORM_CAST_SURFACE_FACTORY_CAST_H_ |
OLD | NEW |