| 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 SERVICES_UI_SURFACES_COMPOSITOR_FRAME_SINK_H_ | 5 #ifndef SERVICES_UI_SURFACES_COMPOSITOR_FRAME_SINK_H_ |
| 6 #define SERVICES_UI_SURFACES_COMPOSITOR_FRAME_SINK_H_ | 6 #define SERVICES_UI_SURFACES_COMPOSITOR_FRAME_SINK_H_ |
| 7 | 7 |
| 8 #include "cc/surfaces/display_client.h" | 8 #include "cc/surfaces/display_client.h" |
| 9 #include "cc/surfaces/surface.h" | 9 #include "cc/surfaces/surface.h" |
| 10 #include "cc/surfaces/surface_factory.h" | 10 #include "cc/surfaces/surface_factory.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 | 26 |
| 27 // TODO(fsamuel): This should become a mojo interface for the mus-gpu split. | 27 // TODO(fsamuel): This should become a mojo interface for the mus-gpu split. |
| 28 // TODO(fsamuel): This should not be a SurfaceFactoryClient. | 28 // TODO(fsamuel): This should not be a SurfaceFactoryClient. |
| 29 // The CompositorFrameSink receives CompositorFrames from all sources, | 29 // The CompositorFrameSink receives CompositorFrames from all sources, |
| 30 // creates a top-level CompositorFrame once per tick, and generates graphical | 30 // creates a top-level CompositorFrame once per tick, and generates graphical |
| 31 // output. | 31 // output. |
| 32 class CompositorFrameSink : public cc::SurfaceFactoryClient, | 32 class CompositorFrameSink : public cc::SurfaceFactoryClient, |
| 33 public cc::DisplayClient { | 33 public cc::DisplayClient { |
| 34 public: | 34 public: |
| 35 CompositorFrameSink( | 35 CompositorFrameSink( |
| 36 const cc::FrameSinkId& frame_sink_id, |
| 36 scoped_refptr<base::SingleThreadTaskRunner> task_runner, | 37 scoped_refptr<base::SingleThreadTaskRunner> task_runner, |
| 37 gfx::AcceleratedWidget widget, | 38 gfx::AcceleratedWidget widget, |
| 38 scoped_refptr<gpu::GpuChannelHost> gpu_channel, | 39 scoped_refptr<gpu::GpuChannelHost> gpu_channel, |
| 39 const scoped_refptr<DisplayCompositor>& display_compositor); | 40 const scoped_refptr<DisplayCompositor>& display_compositor); |
| 40 ~CompositorFrameSink() override; | 41 ~CompositorFrameSink() override; |
| 41 | 42 |
| 42 // CompositorFrameSink embedders submit a CompositorFrame when content on the | 43 // CompositorFrameSink embedders submit a CompositorFrame when content on the |
| 43 // display should be changed. A well-behaving embedder should only submit | 44 // display should be changed. A well-behaving embedder should only submit |
| 44 // a CompositorFrame once per BeginFrame tick. The callback is called the | 45 // a CompositorFrame once per BeginFrame tick. The callback is called the |
| 45 // first time this frame is used to draw, or if the frame is discarded. | 46 // first time this frame is used to draw, or if the frame is discarded. |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 | 80 |
| 80 gfx::Size display_size_; | 81 gfx::Size display_size_; |
| 81 std::unique_ptr<cc::Display> display_; | 82 std::unique_ptr<cc::Display> display_; |
| 82 DISALLOW_COPY_AND_ASSIGN(CompositorFrameSink); | 83 DISALLOW_COPY_AND_ASSIGN(CompositorFrameSink); |
| 83 }; | 84 }; |
| 84 | 85 |
| 85 } // nanmespace surfaces | 86 } // nanmespace surfaces |
| 86 } // namespace ui | 87 } // namespace ui |
| 87 | 88 |
| 88 #endif // SERVICES_UI_SURFACES_COMPOSITOR_FRAME_SINK_H_ | 89 #endif // SERVICES_UI_SURFACES_COMPOSITOR_FRAME_SINK_H_ |
| OLD | NEW |