| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 COMPONENTS_MUS_SURFACES_DIRECT_OUTPUT_SURFACE_OZONE_H_ | 5 #ifndef COMPONENTS_MUS_SURFACES_DIRECT_OUTPUT_SURFACE_OZONE_H_ |
| 6 #define COMPONENTS_MUS_SURFACES_DIRECT_OUTPUT_SURFACE_OZONE_H_ | 6 #define COMPONENTS_MUS_SURFACES_DIRECT_OUTPUT_SURFACE_OZONE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| 11 #include "cc/output/context_provider.h" | 11 #include "cc/output/context_provider.h" |
| 12 #include "cc/output/output_surface.h" | 12 #include "cc/output/output_surface.h" |
| 13 #include "cc/scheduler/begin_frame_source.h" | 13 #include "cc/scheduler/begin_frame_source.h" |
| 14 #include "components/display_compositor/gl_helper.h" |
| 15 #include "components/mus/surfaces/ozone_gpu_memory_buffer_manager.h" |
| 14 #include "ui/gfx/geometry/size.h" | 16 #include "ui/gfx/geometry/size.h" |
| 15 #include "ui/gfx/native_widget_types.h" | 17 #include "ui/gfx/native_widget_types.h" |
| 16 #include "ui/gfx/swap_result.h" | 18 #include "ui/gfx/swap_result.h" |
| 17 #include "ui/gl/gl_surface.h" | 19 #include "ui/gl/gl_surface.h" |
| 18 | 20 |
| 21 namespace display_compositor { |
| 22 class BufferQueue; |
| 23 } |
| 24 |
| 19 namespace ui { | 25 namespace ui { |
| 20 class LatencyInfo; | 26 class LatencyInfo; |
| 21 } // namespace ui | 27 } // namespace ui |
| 22 | 28 |
| 23 namespace cc { | 29 namespace cc { |
| 24 class CompositorFrame; | 30 class CompositorFrame; |
| 25 } // namespace cc | 31 } // namespace cc |
| 26 | 32 |
| 27 namespace mus { | 33 namespace mus { |
| 28 | 34 |
| 29 class BufferQueue; | |
| 30 class SurfacesContextProvider; | 35 class SurfacesContextProvider; |
| 31 | 36 |
| 32 // An OutputSurface implementation that directly draws and swap to a GL | 37 // An OutputSurface implementation that directly draws and swap to a GL |
| 33 // "surfaceless" surface (aka one backed by a buffer managed explicitly in | 38 // "surfaceless" surface (aka one backed by a buffer managed explicitly in |
| 34 // mus/ozone. This class is adapted from | 39 // mus/ozone. This class is adapted from |
| 35 // GpuSurfacelessBrowserCompositorOutputSurface. | 40 // GpuSurfacelessBrowserCompositorOutputSurface. |
| 36 class DirectOutputSurfaceOzone : public cc::OutputSurface { | 41 class DirectOutputSurfaceOzone : public cc::OutputSurface { |
| 37 public: | 42 public: |
| 38 DirectOutputSurfaceOzone( | 43 DirectOutputSurfaceOzone( |
| 39 const scoped_refptr<SurfacesContextProvider>& context_provider, | 44 const scoped_refptr<SurfacesContextProvider>& context_provider, |
| (...skipping 15 matching lines...) Expand all Loading... |
| 55 unsigned GetOverlayTextureId() const override; | 60 unsigned GetOverlayTextureId() const override; |
| 56 bool BindToClient(cc::OutputSurfaceClient* client) override; | 61 bool BindToClient(cc::OutputSurfaceClient* client) override; |
| 57 | 62 |
| 58 // Taken from BrowserCompositor specific API. | 63 // Taken from BrowserCompositor specific API. |
| 59 void OnUpdateVSyncParametersFromGpu(base::TimeTicks timebase, | 64 void OnUpdateVSyncParametersFromGpu(base::TimeTicks timebase, |
| 60 base::TimeDelta interval); | 65 base::TimeDelta interval); |
| 61 | 66 |
| 62 // Called when a swap completion is sent from the GPU process. | 67 // Called when a swap completion is sent from the GPU process. |
| 63 void OnGpuSwapBuffersCompleted(gfx::SwapResult result); | 68 void OnGpuSwapBuffersCompleted(gfx::SwapResult result); |
| 64 | 69 |
| 65 std::unique_ptr<BufferQueue> output_surface_; | 70 display_compositor::GLHelper gl_helper_; |
| 71 OzoneGpuMemoryBufferManager gpu_memory_buffer_manager_; |
| 72 std::unique_ptr<display_compositor::BufferQueue> output_surface_; |
| 66 std::unique_ptr<cc::SyntheticBeginFrameSource> synthetic_begin_frame_source_; | 73 std::unique_ptr<cc::SyntheticBeginFrameSource> synthetic_begin_frame_source_; |
| 67 | 74 |
| 68 base::WeakPtrFactory<DirectOutputSurfaceOzone> weak_ptr_factory_; | 75 base::WeakPtrFactory<DirectOutputSurfaceOzone> weak_ptr_factory_; |
| 69 }; | 76 }; |
| 70 | 77 |
| 71 } // namespace mus | 78 } // namespace mus |
| 72 | 79 |
| 73 #endif // COMPONENTS_MUS_SURFACES_DIRECT_OUTPUT_SURFACE_OZONE_H_ | 80 #endif // COMPONENTS_MUS_SURFACES_DIRECT_OUTPUT_SURFACE_OZONE_H_ |
| OLD | NEW |