| 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 CC_SURFACES_DIRECT_COMPOSITOR_FRAME_SINK_H_ | 5 #ifndef CC_SURFACES_DIRECT_COMPOSITOR_FRAME_SINK_H_ |
| 6 #define CC_SURFACES_DIRECT_COMPOSITOR_FRAME_SINK_H_ | 6 #define CC_SURFACES_DIRECT_COMPOSITOR_FRAME_SINK_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/threading/thread_checker.h" | 9 #include "base/threading/thread_checker.h" |
| 10 #include "cc/output/compositor_frame_sink.h" | 10 #include "cc/output/compositor_frame_sink.h" |
| 11 #include "cc/scheduler/begin_frame_source.h" | 11 #include "cc/scheduler/begin_frame_source.h" |
| 12 #include "cc/surfaces/compositor_frame_sink_support.h" | 12 #include "cc/surfaces/compositor_frame_sink_support.h" |
| 13 #include "cc/surfaces/compositor_frame_sink_support_client.h" | 13 #include "cc/surfaces/compositor_frame_sink_support_client.h" |
| 14 #include "cc/surfaces/display_client.h" | 14 #include "cc/surfaces/display_client.h" |
| 15 #include "cc/surfaces/local_surface_id_allocator.h" |
| 15 #include "cc/surfaces/surface_factory.h" | 16 #include "cc/surfaces/surface_factory.h" |
| 16 #include "cc/surfaces/surface_factory_client.h" | 17 #include "cc/surfaces/surface_factory_client.h" |
| 17 #include "cc/surfaces/surface_id_allocator.h" | |
| 18 #include "cc/surfaces/surfaces_export.h" | 18 #include "cc/surfaces/surfaces_export.h" |
| 19 | 19 |
| 20 namespace cc { | 20 namespace cc { |
| 21 class Display; | 21 class Display; |
| 22 class SurfaceIdAllocator; | 22 class LocalSurfaceIdAllocator; |
| 23 class SurfaceManager; | 23 class SurfaceManager; |
| 24 | 24 |
| 25 // This class submits compositor frames to an in-process Display, with the | 25 // This class submits compositor frames to an in-process Display, with the |
| 26 // client's frame being the root surface of the Display. | 26 // client's frame being the root surface of the Display. |
| 27 class CC_SURFACES_EXPORT DirectCompositorFrameSink | 27 class CC_SURFACES_EXPORT DirectCompositorFrameSink |
| 28 : public CompositorFrameSink, | 28 : public CompositorFrameSink, |
| 29 public NON_EXPORTED_BASE(CompositorFrameSinkSupportClient), | 29 public NON_EXPORTED_BASE(CompositorFrameSinkSupportClient), |
| 30 public ExternalBeginFrameSourceClient, | 30 public ExternalBeginFrameSourceClient, |
| 31 public NON_EXPORTED_BASE(DisplayClient) { | 31 public NON_EXPORTED_BASE(DisplayClient) { |
| 32 public: | 32 public: |
| 33 // The underlying Display, SurfaceManager, and SurfaceIdAllocator must outlive | 33 // The underlying Display, SurfaceManager, and LocalSurfaceIdAllocator must |
| 34 // this class. | 34 // outlive this class. |
| 35 DirectCompositorFrameSink( | 35 DirectCompositorFrameSink( |
| 36 const FrameSinkId& frame_sink_id, | 36 const FrameSinkId& frame_sink_id, |
| 37 SurfaceManager* surface_manager, | 37 SurfaceManager* surface_manager, |
| 38 Display* display, | 38 Display* display, |
| 39 scoped_refptr<ContextProvider> context_provider, | 39 scoped_refptr<ContextProvider> context_provider, |
| 40 scoped_refptr<ContextProvider> worker_context_provider, | 40 scoped_refptr<ContextProvider> worker_context_provider, |
| 41 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, | 41 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, |
| 42 SharedBitmapManager* shared_bitmap_manager); | 42 SharedBitmapManager* shared_bitmap_manager); |
| 43 DirectCompositorFrameSink( | 43 DirectCompositorFrameSink( |
| 44 const FrameSinkId& frame_sink_id, | 44 const FrameSinkId& frame_sink_id, |
| (...skipping 24 matching lines...) Expand all Loading... |
| 69 | 69 |
| 70 // ExternalBeginFrameSourceClient implementation: | 70 // ExternalBeginFrameSourceClient implementation: |
| 71 void OnNeedsBeginFrames(bool needs_begin_frame) override; | 71 void OnNeedsBeginFrames(bool needs_begin_frame) override; |
| 72 | 72 |
| 73 // This class is only meant to be used on a single thread. | 73 // This class is only meant to be used on a single thread. |
| 74 base::ThreadChecker thread_checker_; | 74 base::ThreadChecker thread_checker_; |
| 75 | 75 |
| 76 const FrameSinkId frame_sink_id_; | 76 const FrameSinkId frame_sink_id_; |
| 77 LocalSurfaceId delegated_local_surface_id_; | 77 LocalSurfaceId delegated_local_surface_id_; |
| 78 SurfaceManager* surface_manager_; | 78 SurfaceManager* surface_manager_; |
| 79 SurfaceIdAllocator surface_id_allocator_; | 79 LocalSurfaceIdAllocator local_surface_id_allocator_; |
| 80 Display* display_; | 80 Display* display_; |
| 81 gfx::Size last_swap_frame_size_; | 81 gfx::Size last_swap_frame_size_; |
| 82 bool is_lost_ = false; | 82 bool is_lost_ = false; |
| 83 std::unique_ptr<CompositorFrameSinkSupport> support_; | 83 std::unique_ptr<CompositorFrameSinkSupport> support_; |
| 84 std::unique_ptr<ExternalBeginFrameSource> begin_frame_source_; | 84 std::unique_ptr<ExternalBeginFrameSource> begin_frame_source_; |
| 85 | 85 |
| 86 DISALLOW_COPY_AND_ASSIGN(DirectCompositorFrameSink); | 86 DISALLOW_COPY_AND_ASSIGN(DirectCompositorFrameSink); |
| 87 }; | 87 }; |
| 88 | 88 |
| 89 } // namespace cc | 89 } // namespace cc |
| 90 | 90 |
| 91 #endif // CC_SURFACES_DIRECT_COMPOSITOR_FRAME_SINK_H_ | 91 #endif // CC_SURFACES_DIRECT_COMPOSITOR_FRAME_SINK_H_ |
| OLD | NEW |