| 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> |
| 11 |
| 10 #include "base/macros.h" | 12 #include "base/macros.h" |
| 11 #include "base/memory/scoped_ptr.h" | |
| 12 #include "ui/gfx/geometry/rect.h" | 13 #include "ui/gfx/geometry/rect.h" |
| 13 #include "ui/gfx/geometry/size.h" | 14 #include "ui/gfx/geometry/size.h" |
| 14 #include "ui/ozone/public/surface_factory_ozone.h" | 15 #include "ui/ozone/public/surface_factory_ozone.h" |
| 15 | 16 |
| 16 namespace chromecast { | 17 namespace chromecast { |
| 17 class CastEglPlatform; | 18 class CastEglPlatform; |
| 18 } | 19 } |
| 19 | 20 |
| 20 namespace ui { | 21 namespace ui { |
| 21 | 22 |
| 22 // SurfaceFactoryOzone implementation for OzonePlatformCast. | 23 // SurfaceFactoryOzone implementation for OzonePlatformCast. |
| 23 class SurfaceFactoryCast : public SurfaceFactoryOzone { | 24 class SurfaceFactoryCast : public SurfaceFactoryOzone { |
| 24 public: | 25 public: |
| 25 SurfaceFactoryCast(); | 26 SurfaceFactoryCast(); |
| 26 explicit SurfaceFactoryCast( | 27 explicit SurfaceFactoryCast( |
| 27 scoped_ptr<chromecast::CastEglPlatform> egl_platform); | 28 std::unique_ptr<chromecast::CastEglPlatform> egl_platform); |
| 28 ~SurfaceFactoryCast() override; | 29 ~SurfaceFactoryCast() override; |
| 29 | 30 |
| 30 // SurfaceFactoryOzone implementation: | 31 // SurfaceFactoryOzone implementation: |
| 31 scoped_ptr<SurfaceOzoneCanvas> CreateCanvasForWidget( | 32 std::unique_ptr<SurfaceOzoneCanvas> CreateCanvasForWidget( |
| 32 gfx::AcceleratedWidget widget) override; | 33 gfx::AcceleratedWidget widget) override; |
| 33 intptr_t GetNativeDisplay() override; | 34 intptr_t GetNativeDisplay() override; |
| 34 scoped_ptr<SurfaceOzoneEGL> CreateEGLSurfaceForWidget( | 35 std::unique_ptr<SurfaceOzoneEGL> CreateEGLSurfaceForWidget( |
| 35 gfx::AcceleratedWidget widget) override; | 36 gfx::AcceleratedWidget widget) override; |
| 36 scoped_refptr<NativePixmap> CreateNativePixmap( | 37 scoped_refptr<NativePixmap> CreateNativePixmap( |
| 37 gfx::AcceleratedWidget widget, | 38 gfx::AcceleratedWidget widget, |
| 38 gfx::Size size, | 39 gfx::Size size, |
| 39 gfx::BufferFormat format, | 40 gfx::BufferFormat format, |
| 40 gfx::BufferUsage usage) override; | 41 gfx::BufferUsage usage) override; |
| 41 bool LoadEGLGLES2Bindings( | 42 bool LoadEGLGLES2Bindings( |
| 42 AddGLLibraryCallback add_gl_library, | 43 AddGLLibraryCallback add_gl_library, |
| 43 SetGLGetProcAddressProcCallback set_gl_get_proc_address) override; | 44 SetGLGetProcAddressProcCallback set_gl_get_proc_address) override; |
| 44 | 45 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 59 void DestroyDisplayTypeAndWindow(); | 60 void DestroyDisplayTypeAndWindow(); |
| 60 void DestroyWindow(); | 61 void DestroyWindow(); |
| 61 void InitializeHardware(); | 62 void InitializeHardware(); |
| 62 | 63 |
| 63 HardwareState state_; | 64 HardwareState state_; |
| 64 void* display_type_; | 65 void* display_type_; |
| 65 bool have_display_type_; | 66 bool have_display_type_; |
| 66 void* window_; | 67 void* window_; |
| 67 gfx::Size display_size_; | 68 gfx::Size display_size_; |
| 68 gfx::Size new_display_size_; | 69 gfx::Size new_display_size_; |
| 69 scoped_ptr<chromecast::CastEglPlatform> egl_platform_; | 70 std::unique_ptr<chromecast::CastEglPlatform> egl_platform_; |
| 70 | 71 |
| 71 // Overlays scheduled in current and previous frames: | 72 // Overlays scheduled in current and previous frames: |
| 72 int overlay_count_; | 73 int overlay_count_; |
| 73 gfx::Rect overlay_bounds_; | 74 gfx::Rect overlay_bounds_; |
| 74 int previous_frame_overlay_count_; | 75 int previous_frame_overlay_count_; |
| 75 gfx::Rect previous_frame_overlay_bounds_; | 76 gfx::Rect previous_frame_overlay_bounds_; |
| 76 | 77 |
| 77 DISALLOW_COPY_AND_ASSIGN(SurfaceFactoryCast); | 78 DISALLOW_COPY_AND_ASSIGN(SurfaceFactoryCast); |
| 78 }; | 79 }; |
| 79 | 80 |
| 80 } // namespace ui | 81 } // namespace ui |
| 81 | 82 |
| 82 #endif // UI_OZONE_PLATFORM_CAST_SURFACE_FACTORY_CAST_H_ | 83 #endif // UI_OZONE_PLATFORM_CAST_SURFACE_FACTORY_CAST_H_ |
| OLD | NEW |