OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef SERVICES_UI_PUBLIC_CPP_COMPOSITOR_FRAME_SINK_H_ | |
6 #define SERVICES_UI_PUBLIC_CPP_COMPOSITOR_FRAME_SINK_H_ | |
7 | |
8 #include "base/macros.h" | |
9 #include "cc/output/compositor_frame_sink.h" | |
10 #include "cc/output/context_provider.h" | |
11 #include "cc/scheduler/begin_frame_source.h" | |
12 #include "cc/surfaces/surface_id.h" | |
13 #include "mojo/public/cpp/bindings/binding.h" | |
14 #include "services/ui/public/cpp/window_surface.h" | |
15 #include "services/ui/public/cpp/window_surface_client.h" | |
16 | |
17 namespace gpu { | |
18 class GpuChannelHost; | |
19 } | |
20 | |
21 namespace ui { | |
22 | |
23 class CompositorFrameSink : public cc::CompositorFrameSink, | |
24 public WindowSurfaceClient { | |
25 public: | |
26 CompositorFrameSink(scoped_refptr<cc::ContextProvider> context_provider, | |
27 std::unique_ptr<WindowSurface> surface); | |
28 ~CompositorFrameSink() override; | |
29 | |
30 // cc::CompositorFrameSink implementation. | |
31 bool BindToClient(cc::CompositorFrameSinkClient* client) override; | |
32 void DetachFromClient() override; | |
33 void SubmitCompositorFrame(cc::CompositorFrame frame) override; | |
34 | |
35 private: | |
36 // WindowSurfaceClient implementation: | |
37 void DidReceiveCompositorFrameAck() override; | |
38 void ReclaimResources(const cc::ReturnedResourceArray& resources) override; | |
39 | |
40 std::unique_ptr<cc::BeginFrameSource> begin_frame_source_; | |
41 std::unique_ptr<WindowSurface> surface_; | |
42 | |
43 DISALLOW_COPY_AND_ASSIGN(CompositorFrameSink); | |
44 }; | |
45 | |
46 } // namespace ui | |
47 | |
48 #endif // SERVICES_UI_PUBLIC_CPP_COMPOSITOR_FRAME_SINK_H_ | |
OLD | NEW |