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

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

Issue 2610513006: exo: Implement presentation interface. (Closed)
Patch Set: 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') | components/exo/surface.h » ('J')
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 29 matching lines...) Expand all
40 void AddResourceReleaseCallback( 40 void AddResourceReleaseCallback(
41 cc::ResourceId id, 41 cc::ResourceId id,
42 std::unique_ptr<cc::SingleReleaseCallback> callback); 42 std::unique_ptr<cc::SingleReleaseCallback> callback);
43 43
44 CompositorFrameSink* GetCompositorFrameSink() { return frame_sink_.get(); } 44 CompositorFrameSink* GetCompositorFrameSink() { return frame_sink_.get(); }
45 45
46 base::WeakPtr<CompositorFrameSinkHolder> GetWeakPtr() { 46 base::WeakPtr<CompositorFrameSinkHolder> GetWeakPtr() {
47 return weak_factory_.GetWeakPtr(); 47 return weak_factory_.GetWeakPtr();
48 } 48 }
49 49
50 using FrameCallback = base::Callback<void(base::TimeTicks frame_time)>;
51 void ActivateFrameCallbacks(std::list<FrameCallback>* frame_callbacks);
52 void CancelFrameCallbacks();
53
54 void SetNeedsBeginFrame(bool needs_begin_frame); 50 void SetNeedsBeginFrame(bool needs_begin_frame);
55 51
56 void Satisfy(const cc::SurfaceSequence& sequence); 52 void Satisfy(const cc::SurfaceSequence& sequence);
57 void Require(const cc::SurfaceId& id, const cc::SurfaceSequence& sequence); 53 void Require(const cc::SurfaceId& id, const cc::SurfaceSequence& sequence);
58 54
59 // Overridden from cc::mojom::MojoCompositorFrameSinkClient: 55 // Overridden from cc::mojom::MojoCompositorFrameSinkClient:
60 void DidReceiveCompositorFrameAck() override; 56 void DidReceiveCompositorFrameAck() override;
61 void OnBeginFrame(const cc::BeginFrameArgs& args) override; 57 void OnBeginFrame(const cc::BeginFrameArgs& args) override;
62 void ReclaimResources(const cc::ReturnedResourceArray& resources) override; 58 void ReclaimResources(const cc::ReturnedResourceArray& resources) override;
63 void WillDrawSurface() override; 59 void WillDrawSurface() override;
(...skipping 21 matching lines...) Expand all
85 // variables after running and erasing the callbacks. 81 // variables after running and erasing the callbacks.
86 using ResourceReleaseCallbackMap = 82 using ResourceReleaseCallbackMap =
87 std::map<int, 83 std::map<int,
88 std::pair<scoped_refptr<CompositorFrameSinkHolder>, 84 std::pair<scoped_refptr<CompositorFrameSinkHolder>,
89 std::unique_ptr<cc::SingleReleaseCallback>>>; 85 std::unique_ptr<cc::SingleReleaseCallback>>>;
90 ResourceReleaseCallbackMap release_callbacks_; 86 ResourceReleaseCallbackMap release_callbacks_;
91 87
92 Surface* surface_; 88 Surface* surface_;
93 std::unique_ptr<CompositorFrameSink> frame_sink_; 89 std::unique_ptr<CompositorFrameSink> frame_sink_;
94 90
95 std::list<FrameCallback> active_frame_callbacks_;
96 std::unique_ptr<cc::ExternalBeginFrameSource> begin_frame_source_; 91 std::unique_ptr<cc::ExternalBeginFrameSource> begin_frame_source_;
97 bool needs_begin_frame_ = false; 92 bool needs_begin_frame_ = false;
98 cc::BeginFrameArgs last_begin_frame_args_; 93 cc::BeginFrameArgs last_begin_frame_args_;
99 mojo::Binding<cc::mojom::MojoCompositorFrameSinkClient> binding_; 94 mojo::Binding<cc::mojom::MojoCompositorFrameSinkClient> binding_;
100 95
101 base::WeakPtrFactory<CompositorFrameSinkHolder> weak_factory_; 96 base::WeakPtrFactory<CompositorFrameSinkHolder> weak_factory_;
102 97
103 DISALLOW_COPY_AND_ASSIGN(CompositorFrameSinkHolder); 98 DISALLOW_COPY_AND_ASSIGN(CompositorFrameSinkHolder);
104 }; 99 };
105 100
106 } // namespace exo 101 } // namespace exo
107 102
108 #endif // COMPONENTS_EXO_COMPOSITOR_FRAME_SINK_HOLDER_H_ 103 #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') | components/exo/surface.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698