OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef COMPONENTS_MUS_SURFACES_DISPLAY_COMPOSITOR_H_ | |
6 #define COMPONENTS_MUS_SURFACES_DISPLAY_COMPOSITOR_H_ | |
7 | |
8 #include "cc/surfaces/surface_factory.h" | |
9 #include "cc/surfaces/surface_factory_client.h" | |
10 #include "cc/surfaces/surface_id_allocator.h" | |
11 #include "components/mus/gles2/gpu_state.h" | |
12 #include "components/mus/surfaces/surfaces_state.h" | |
13 #include "ui/gfx/native_widget_types.h" | |
14 | |
15 namespace mus { | |
16 | |
17 class TopLevelDisplayClient; | |
18 | |
19 // TODO(fsamuel): This should become a mojo interface for the mus-gpu split. | |
rjkroege
2016/05/12 23:03:44
in the sequencing of this work, when do we mojo-i-
Fady Samuel
2016/05/12 23:13:45
Once mus/ws no longer directly refers to cc, then
| |
20 // TODO(fsamuel): This should not be a SurfaceFactoryClient. | |
21 // The DisplayCompositor receives CompositorFrames from all sources, | |
rjkroege
2016/05/12 23:03:44
this implies that DisplayCompositor is responsible
Fady Samuel
2016/05/12 23:13:45
Yes, SubmitCompositorFrame is async.
| |
22 // creates a top-level CompositorFrame once per tick, and generates graphical | |
23 // output. | |
24 class DisplayCompositor : public cc::SurfaceFactoryClient { | |
rjkroege
2016/05/12 23:03:44
how will these have their ownership in musgpu trac
Fady Samuel
2016/05/12 23:13:45
mus-ws connects to mojo:musgpu, requests a Display
| |
25 public: | |
26 DisplayCompositor(scoped_refptr<base::SingleThreadTaskRunner> task_runner, | |
27 gfx::AcceleratedWidget widget, | |
28 const scoped_refptr<GpuState>& gpu_state, | |
29 const scoped_refptr<SurfacesState>& surfaces_state); | |
30 ~DisplayCompositor() override; | |
31 | |
32 void SubmitCompositorFrame(std::unique_ptr<cc::CompositorFrame> frame, | |
rjkroege
2016/05/12 23:03:44
Please indicate when the callback gets invoked.
Fady Samuel
2016/05/12 23:13:45
Done.
| |
33 const base::Closure& callback); | |
34 | |
35 // TODO(fsamuel): This is used for surface hittesting and should not be | |
rjkroege
2016/05/12 23:03:44
per our previous discussion, musws needs to mainta
Fady Samuel
2016/05/12 23:13:45
See here: https://bugs.chromium.org/p/chromium/iss
| |
36 // exposed outside of DisplayCompositor. | |
37 const cc::SurfaceId& surface_id() const { return surface_id_; } | |
38 | |
39 void RequestCopyOfOutput( | |
rjkroege
2016/05/12 23:03:44
what is this for?
Fady Samuel
2016/05/12 23:13:45
Readback for screenshots.
| |
40 std::unique_ptr<cc::CopyOutputRequest> output_request); | |
41 | |
42 // TODO(fsamuel): Invent an async way to create a SurfaceNamespace | |
43 // A SurfaceNamespace can create CompositorFrameSinks where the client can | |
44 // make up the ID. | |
45 | |
46 private: | |
47 // SurfaceFactoryClient implementation. | |
48 void ReturnResources(const cc::ReturnedResourceArray& resources) override; | |
49 void SetBeginFrameSource(cc::BeginFrameSource* begin_frame_source) override; | |
50 | |
51 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | |
52 scoped_refptr<SurfacesState> surfaces_state_; | |
53 cc::SurfaceFactory factory_; | |
54 cc::SurfaceIdAllocator allocator_; | |
55 cc::SurfaceId surface_id_; | |
56 | |
57 gfx::Size display_size_; | |
58 std::unique_ptr<TopLevelDisplayClient> display_client_; | |
59 DISALLOW_COPY_AND_ASSIGN(DisplayCompositor); | |
60 }; | |
61 | |
62 } // namespace mus | |
63 | |
64 #endif // COMPONENTS_MUS_SURFACES_DISPLAY_COMPOSITOR_H_ | |
OLD | NEW |