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

Side by Side Diff: components/exo/compositor_frame_sink_holder.h

Issue 2610513006: exo: Implement presentation interface. (Closed)
Patch Set: dcastagna nits Created 3 years, 11 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 | « no previous file | components/exo/compositor_frame_sink_holder.cc » ('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 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 COMPONENTS_EXO_COMPOSITOR_FRAME_SINK_HOLDER_H_ 5 #ifndef COMPONENTS_EXO_COMPOSITOR_FRAME_SINK_HOLDER_H_
6 #define COMPONENTS_EXO_COMPOSITOR_FRAME_SINK_HOLDER_H_ 6 #define COMPONENTS_EXO_COMPOSITOR_FRAME_SINK_HOLDER_H_
7 7
8 #include <list> 8 #include <list>
9 #include <map> 9 #include <map>
10 #include <memory> 10 #include <memory>
(...skipping 28 matching lines...) Expand all
39 bool HasReleaseCallbackForResource(cc::ResourceId id); 39 bool HasReleaseCallbackForResource(cc::ResourceId id);
40 void SetResourceReleaseCallback(cc::ResourceId id, 40 void SetResourceReleaseCallback(cc::ResourceId id,
41 const cc::ReleaseCallback& callback); 41 const cc::ReleaseCallback& callback);
42 42
43 CompositorFrameSink* GetCompositorFrameSink() { return frame_sink_.get(); } 43 CompositorFrameSink* GetCompositorFrameSink() { return frame_sink_.get(); }
44 44
45 base::WeakPtr<CompositorFrameSinkHolder> GetWeakPtr() { 45 base::WeakPtr<CompositorFrameSinkHolder> GetWeakPtr() {
46 return weak_factory_.GetWeakPtr(); 46 return weak_factory_.GetWeakPtr();
47 } 47 }
48 48
49 using FrameCallback = base::Callback<void(base::TimeTicks frame_time)>;
50 void ActivateFrameCallbacks(std::list<FrameCallback>* frame_callbacks);
51 void CancelFrameCallbacks();
52
53 void SetNeedsBeginFrame(bool needs_begin_frame); 49 void SetNeedsBeginFrame(bool needs_begin_frame);
54 50
55 void Satisfy(const cc::SurfaceSequence& sequence); 51 void Satisfy(const cc::SurfaceSequence& sequence);
56 void Require(const cc::SurfaceId& id, const cc::SurfaceSequence& sequence); 52 void Require(const cc::SurfaceId& id, const cc::SurfaceSequence& sequence);
57 53
58 // Overridden from cc::mojom::MojoCompositorFrameSinkClient: 54 // Overridden from cc::mojom::MojoCompositorFrameSinkClient:
59 void DidReceiveCompositorFrameAck() override; 55 void DidReceiveCompositorFrameAck() override;
60 void OnBeginFrame(const cc::BeginFrameArgs& args) override; 56 void OnBeginFrame(const cc::BeginFrameArgs& args) override;
61 void ReclaimResources(const cc::ReturnedResourceArray& resources) override; 57 void ReclaimResources(const cc::ReturnedResourceArray& resources) override;
62 void WillDrawSurface() override; 58 void WillDrawSurface() override;
(...skipping 15 matching lines...) Expand all
78 74
79 void UpdateNeedsBeginFrame(); 75 void UpdateNeedsBeginFrame();
80 76
81 // A collection of callbacks used to release resources. 77 // A collection of callbacks used to release resources.
82 using ResourceReleaseCallbackMap = std::map<int, cc::ReleaseCallback>; 78 using ResourceReleaseCallbackMap = std::map<int, cc::ReleaseCallback>;
83 ResourceReleaseCallbackMap release_callbacks_; 79 ResourceReleaseCallbackMap release_callbacks_;
84 80
85 Surface* surface_; 81 Surface* surface_;
86 std::unique_ptr<CompositorFrameSink> frame_sink_; 82 std::unique_ptr<CompositorFrameSink> frame_sink_;
87 83
88 std::list<FrameCallback> active_frame_callbacks_;
89 std::unique_ptr<cc::ExternalBeginFrameSource> begin_frame_source_; 84 std::unique_ptr<cc::ExternalBeginFrameSource> begin_frame_source_;
90 bool needs_begin_frame_ = false; 85 bool needs_begin_frame_ = false;
91 cc::BeginFrameArgs last_begin_frame_args_; 86 cc::BeginFrameArgs last_begin_frame_args_;
92 mojo::Binding<cc::mojom::MojoCompositorFrameSinkClient> binding_; 87 mojo::Binding<cc::mojom::MojoCompositorFrameSinkClient> binding_;
93 88
94 base::WeakPtrFactory<CompositorFrameSinkHolder> weak_factory_; 89 base::WeakPtrFactory<CompositorFrameSinkHolder> weak_factory_;
95 90
96 DISALLOW_COPY_AND_ASSIGN(CompositorFrameSinkHolder); 91 DISALLOW_COPY_AND_ASSIGN(CompositorFrameSinkHolder);
97 }; 92 };
98 93
99 } // namespace exo 94 } // namespace exo
100 95
101 #endif // COMPONENTS_EXO_COMPOSITOR_FRAME_SINK_HOLDER_H_ 96 #endif // COMPONENTS_EXO_COMPOSITOR_FRAME_SINK_HOLDER_H_
OLDNEW
« no previous file with comments | « no previous file | components/exo/compositor_frame_sink_holder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698