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

Side by Side Diff: cc/surfaces/compositor_frame_sink_support.h

Issue 2684933003: Move frame_sink_id management to framesink_manager.cc/h from (Closed)
Patch Set: Created 3 years, 10 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 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 CC_SURFACES_COMPOSITOR_FRAME_SINK_SUPPORT_H_ 5 #ifndef CC_SURFACES_COMPOSITOR_FRAME_SINK_SUPPORT_H_
6 #define CC_SURFACES_COMPOSITOR_FRAME_SINK_SUPPORT_H_ 6 #define CC_SURFACES_COMPOSITOR_FRAME_SINK_SUPPORT_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "cc/output/compositor_frame.h" 10 #include "cc/output/compositor_frame.h"
11 #include "cc/scheduler/begin_frame_source.h" 11 #include "cc/scheduler/begin_frame_source.h"
12 #include "cc/surfaces/display.h" 12 #include "cc/surfaces/display.h"
13 #include "cc/surfaces/display_client.h" 13 #include "cc/surfaces/display_client.h"
14 #include "cc/surfaces/surface_factory.h" 14 #include "cc/surfaces/surface_factory.h"
15 #include "cc/surfaces/surface_factory_client.h" 15 #include "cc/surfaces/surface_factory_client.h"
16 #include "cc/surfaces/surfaces_export.h" 16 #include "cc/surfaces/surfaces_export.h"
17 17
18 namespace cc { 18 namespace cc {
19 19
20 class CompositorFrameSinkSupportClient; 20 class CompositorFrameSinkSupportClient;
21 class Display; 21 class Display;
22 class SurfaceManager; 22 class SurfaceManager;
23 class FrameSinkManager;
23 24
24 class CC_SURFACES_EXPORT CompositorFrameSinkSupport 25 class CC_SURFACES_EXPORT CompositorFrameSinkSupport
25 : public NON_EXPORTED_BASE(DisplayClient), 26 : public NON_EXPORTED_BASE(DisplayClient),
26 public SurfaceFactoryClient, 27 public SurfaceFactoryClient,
27 public BeginFrameObserver { 28 public BeginFrameObserver {
28 public: 29 public:
29 CompositorFrameSinkSupport( 30 CompositorFrameSinkSupport(
30 CompositorFrameSinkSupportClient* client, 31 CompositorFrameSinkSupportClient* client,
31 SurfaceManager* surface_manager, 32 SurfaceManager* surface_manager,
33 FrameSinkManager* framesink_manager,
32 const FrameSinkId& frame_sink_id, 34 const FrameSinkId& frame_sink_id,
33 std::unique_ptr<Display> display, 35 std::unique_ptr<Display> display,
34 std::unique_ptr<BeginFrameSource> display_begin_frame_source); 36 std::unique_ptr<BeginFrameSource> display_begin_frame_source);
35 37
36 ~CompositorFrameSinkSupport() override; 38 ~CompositorFrameSinkSupport() override;
37 39
38 const FrameSinkId& frame_sink_id() const { return frame_sink_id_; } 40 const FrameSinkId& frame_sink_id() const { return frame_sink_id_; }
39 41
40 void EvictFrame(); 42 void EvictFrame();
41 void SetNeedsBeginFrame(bool needs_begin_frame); 43 void SetNeedsBeginFrame(bool needs_begin_frame);
(...skipping 25 matching lines...) Expand all
67 // BeginFrameObserver implementation. 69 // BeginFrameObserver implementation.
68 void OnBeginFrame(const BeginFrameArgs& args) override; 70 void OnBeginFrame(const BeginFrameArgs& args) override;
69 const BeginFrameArgs& LastUsedBeginFrameArgs() const override; 71 const BeginFrameArgs& LastUsedBeginFrameArgs() const override;
70 void OnBeginFrameSourcePausedChanged(bool paused) override; 72 void OnBeginFrameSourcePausedChanged(bool paused) override;
71 73
72 void UpdateNeedsBeginFramesInternal(); 74 void UpdateNeedsBeginFramesInternal();
73 75
74 CompositorFrameSinkSupportClient* const client_; 76 CompositorFrameSinkSupportClient* const client_;
75 77
76 SurfaceManager* const surface_manager_; 78 SurfaceManager* const surface_manager_;
79 FrameSinkManager* const framesink_manager_;
77 80
78 const FrameSinkId frame_sink_id_; 81 const FrameSinkId frame_sink_id_;
79 82
80 // GpuCompositorFrameSink holds a Display and its BeginFrameSource if it 83 // GpuCompositorFrameSink holds a Display and its BeginFrameSource if it
81 // created with non-null gpu::SurfaceHandle. In the window server, the display 84 // created with non-null gpu::SurfaceHandle. In the window server, the display
82 // root window's CompositorFrameSink will have a valid gpu::SurfaceHandle. 85 // root window's CompositorFrameSink will have a valid gpu::SurfaceHandle.
83 std::unique_ptr<BeginFrameSource> display_begin_frame_source_; 86 std::unique_ptr<BeginFrameSource> display_begin_frame_source_;
84 std::unique_ptr<Display> display_; 87 std::unique_ptr<Display> display_;
85 88
86 SurfaceFactory surface_factory_; 89 SurfaceFactory surface_factory_;
(...skipping 18 matching lines...) Expand all
105 std::unordered_set<FrameSinkId, FrameSinkIdHash> child_frame_sinks_; 108 std::unordered_set<FrameSinkId, FrameSinkIdHash> child_frame_sinks_;
106 109
107 base::WeakPtrFactory<CompositorFrameSinkSupport> weak_factory_; 110 base::WeakPtrFactory<CompositorFrameSinkSupport> weak_factory_;
108 111
109 DISALLOW_COPY_AND_ASSIGN(CompositorFrameSinkSupport); 112 DISALLOW_COPY_AND_ASSIGN(CompositorFrameSinkSupport);
110 }; 113 };
111 114
112 } // namespace cc 115 } // namespace cc
113 116
114 #endif // CC_SURFACES_COMPOSITOR_FRAME_SINK_SUPPORT_H_ 117 #endif // CC_SURFACES_COMPOSITOR_FRAME_SINK_SUPPORT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698