Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Side by Side Diff: components/mus/surfaces/display_compositor.h

Issue 1976663003: Pull parts of TopLevelDisplayClient into DisplayCompositor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resize on new CompositorFrame Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/mus/surfaces/BUILD.gn ('k') | components/mus/surfaces/display_compositor.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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_
OLDNEW
« no previous file with comments | « components/mus/surfaces/BUILD.gn ('k') | components/mus/surfaces/display_compositor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698