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

Side by Side Diff: components/viz/frame_sinks/mojo_frame_sink_manager.h

Issue 2811083002: Move frame eviction into components (Closed)
Patch Set: Rebase Created 3 years, 8 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/viz/frame_sinks/frame_evictor.cc ('k') | components/viz/frame_sinks/viz_export.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 COMPONENTS_VIZ_FRAME_SINKS_MOJO_FRAME_SINK_MANAGER_H_ 5 #ifndef COMPONENTS_VIZ_FRAME_SINKS_MOJO_FRAME_SINK_MANAGER_H_
6 #define COMPONENTS_VIZ_FRAME_SINKS_MOJO_FRAME_SINK_MANAGER_H_ 6 #define COMPONENTS_VIZ_FRAME_SINKS_MOJO_FRAME_SINK_MANAGER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
11 #include <unordered_map> 11 #include <unordered_map>
12 12
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "base/threading/thread_checker.h" 14 #include "base/threading/thread_checker.h"
15 #include "cc/ipc/frame_sink_manager.mojom.h" 15 #include "cc/ipc/frame_sink_manager.mojom.h"
16 #include "cc/surfaces/frame_sink_id.h" 16 #include "cc/surfaces/frame_sink_id.h"
17 #include "cc/surfaces/surface_manager.h" 17 #include "cc/surfaces/surface_manager.h"
18 #include "cc/surfaces/surface_observer.h" 18 #include "cc/surfaces/surface_observer.h"
19 #include "components/viz/frame_sinks/gpu_compositor_frame_sink_delegate.h" 19 #include "components/viz/frame_sinks/gpu_compositor_frame_sink_delegate.h"
20 #include "components/viz/frame_sinks/viz_export.h"
20 #include "gpu/ipc/common/surface_handle.h" 21 #include "gpu/ipc/common/surface_handle.h"
21 #include "mojo/public/cpp/bindings/binding.h" 22 #include "mojo/public/cpp/bindings/binding.h"
22 23
23 namespace viz { 24 namespace viz {
24 25
25 class DisplayProvider; 26 class DisplayProvider;
26 27
27 // MojoFrameSinkManager manages state associated with CompositorFrameSinks. It 28 // MojoFrameSinkManager manages state associated with CompositorFrameSinks. It
28 // provides a Mojo interface to create CompositorFrameSinks, manages BeginFrame 29 // provides a Mojo interface to create CompositorFrameSinks, manages BeginFrame
29 // hierarchy and manages surface lifetime. 30 // hierarchy and manages surface lifetime.
30 // 31 //
31 // This is intended to be created in the viz or GPU process. For mus+ash this 32 // This is intended to be created in the viz or GPU process. For mus+ash this
32 // will be true after the mus process split. For non-mus Chrome this will be 33 // will be true after the mus process split. For non-mus Chrome this will be
33 // created in the browser process, at least until GPU implementations can be 34 // created in the browser process, at least until GPU implementations can be
34 // unified. 35 // unified.
35 class MojoFrameSinkManager : public cc::SurfaceObserver, 36 class VIZ_EXPORT MojoFrameSinkManager
36 public GpuCompositorFrameSinkDelegate, 37 : public cc::SurfaceObserver,
37 public cc::mojom::FrameSinkManager { 38 public NON_EXPORTED_BASE(GpuCompositorFrameSinkDelegate),
39 public NON_EXPORTED_BASE(cc::mojom::FrameSinkManager) {
38 public: 40 public:
39 MojoFrameSinkManager(bool use_surface_references, 41 MojoFrameSinkManager(bool use_surface_references,
40 DisplayProvider* display_provider, 42 DisplayProvider* display_provider,
41 cc::mojom::FrameSinkManagerRequest request, 43 cc::mojom::FrameSinkManagerRequest request,
42 cc::mojom::FrameSinkManagerClientPtr client); 44 cc::mojom::FrameSinkManagerClientPtr client);
43 ~MojoFrameSinkManager() override; 45 ~MojoFrameSinkManager() override;
44 46
45 cc::SurfaceManager* surface_manager() { return &manager_; } 47 cc::SurfaceManager* surface_manager() { return &manager_; }
46 48
47 // cc::mojom::MojoFrameSinkManager implementation: 49 // cc::mojom::MojoFrameSinkManager implementation:
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 104
103 cc::mojom::FrameSinkManagerClientPtr client_; 105 cc::mojom::FrameSinkManagerClientPtr client_;
104 mojo::Binding<cc::mojom::FrameSinkManager> binding_; 106 mojo::Binding<cc::mojom::FrameSinkManager> binding_;
105 107
106 DISALLOW_COPY_AND_ASSIGN(MojoFrameSinkManager); 108 DISALLOW_COPY_AND_ASSIGN(MojoFrameSinkManager);
107 }; 109 };
108 110
109 } // namespace viz 111 } // namespace viz
110 112
111 #endif // COMPONENTS_VIZ_FRAME_SINKS_MOJO_FRAME_SINK_MANAGER_H_ 113 #endif // COMPONENTS_VIZ_FRAME_SINKS_MOJO_FRAME_SINK_MANAGER_H_
OLDNEW
« no previous file with comments | « components/viz/frame_sinks/frame_evictor.cc ('k') | components/viz/frame_sinks/viz_export.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698