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 SERVICES_UI_PUBLIC_CPP_OUTPUT_SURFACE_H_ | 5 #ifndef SERVICES_UI_PUBLIC_CPP_COMPOSITOR_FRAME_SINK_H_ |
6 #define SERVICES_UI_PUBLIC_CPP_OUTPUT_SURFACE_H_ | 6 #define SERVICES_UI_PUBLIC_CPP_COMPOSITOR_FRAME_SINK_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "cc/output/output_surface.h" | 9 #include "cc/output/compositor_frame_sink.h" |
10 #include "cc/scheduler/begin_frame_source.h" | 10 #include "cc/scheduler/begin_frame_source.h" |
11 #include "cc/surfaces/surface_id.h" | 11 #include "cc/surfaces/surface_id.h" |
12 #include "mojo/public/cpp/bindings/binding.h" | 12 #include "mojo/public/cpp/bindings/binding.h" |
13 #include "services/ui/public/cpp/window_surface.h" | 13 #include "services/ui/public/cpp/window_surface.h" |
14 #include "services/ui/public/cpp/window_surface_client.h" | 14 #include "services/ui/public/cpp/window_surface_client.h" |
15 | 15 |
16 namespace gpu { | 16 namespace gpu { |
17 class GpuChannelHost; | 17 class GpuChannelHost; |
18 } | 18 } |
19 | 19 |
20 namespace ui { | 20 namespace ui { |
21 | 21 |
22 class OutputSurface : public cc::OutputSurface, public WindowSurfaceClient { | 22 class CompositorFrameSink : public cc::CompositorFrameSink, |
| 23 public WindowSurfaceClient { |
23 public: | 24 public: |
24 OutputSurface(scoped_refptr<gpu::GpuChannelHost> gpu_channel_host, | 25 CompositorFrameSink(scoped_refptr<gpu::GpuChannelHost> gpu_channel_host, |
25 std::unique_ptr<WindowSurface> surface); | 26 std::unique_ptr<WindowSurface> surface); |
26 ~OutputSurface() override; | 27 ~CompositorFrameSink() override; |
27 | 28 |
28 // cc::OutputSurface implementation. | 29 // cc::CompositorFrameSink implementation. |
29 void SwapBuffers(cc::CompositorFrame frame) override; | 30 void SwapBuffers(cc::CompositorFrame frame) override; |
30 bool BindToClient(cc::OutputSurfaceClient* client) override; | 31 bool BindToClient(cc::CompositorFrameSinkClient* client) override; |
31 void DetachFromClient() override; | 32 void DetachFromClient() override; |
32 void BindFramebuffer() override; | 33 void BindFramebuffer() override; |
33 uint32_t GetFramebufferCopyTextureFormat() override; | 34 uint32_t GetFramebufferCopyTextureFormat() override; |
34 | 35 |
35 private: | 36 private: |
36 // WindowSurfaceClient implementation: | 37 // WindowSurfaceClient implementation: |
37 void OnResourcesReturned( | 38 void OnResourcesReturned( |
38 WindowSurface* surface, | 39 WindowSurface* surface, |
39 mojo::Array<cc::ReturnedResource> resources) override; | 40 mojo::Array<cc::ReturnedResource> resources) override; |
40 | 41 |
41 void SwapBuffersComplete(); | 42 void SwapBuffersComplete(); |
42 | 43 |
43 std::unique_ptr<cc::BeginFrameSource> begin_frame_source_; | 44 std::unique_ptr<cc::BeginFrameSource> begin_frame_source_; |
44 std::unique_ptr<WindowSurface> surface_; | 45 std::unique_ptr<WindowSurface> surface_; |
45 | 46 |
46 DISALLOW_COPY_AND_ASSIGN(OutputSurface); | 47 DISALLOW_COPY_AND_ASSIGN(CompositorFrameSink); |
47 }; | 48 }; |
48 | 49 |
49 } // namespace ui | 50 } // namespace ui |
50 | 51 |
51 #endif // SERVICES_UI_PUBLIC_CPP_OUTPUT_SURFACE_H_ | 52 #endif // SERVICES_UI_PUBLIC_CPP_COMPOSITOR_FRAME_SINK_H_ |
OLD | NEW |