OLD | NEW |
---|---|
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 30 matching lines...) Expand all Loading... | |
41 CompositorFrameSink* GetCompositorFrameSink() { return frame_sink_.get(); } | 41 CompositorFrameSink* GetCompositorFrameSink() { return frame_sink_.get(); } |
42 | 42 |
43 base::WeakPtr<CompositorFrameSinkHolder> GetWeakPtr() { | 43 base::WeakPtr<CompositorFrameSinkHolder> GetWeakPtr() { |
44 return weak_factory_.GetWeakPtr(); | 44 return weak_factory_.GetWeakPtr(); |
45 } | 45 } |
46 | 46 |
47 // Overridden from cc::mojom::MojoCompositorFrameSinkClient: | 47 // Overridden from cc::mojom::MojoCompositorFrameSinkClient: |
48 void DidReceiveCompositorFrameAck() override; | 48 void DidReceiveCompositorFrameAck() override; |
49 void OnBeginFrame(const cc::BeginFrameArgs& args) override; | 49 void OnBeginFrame(const cc::BeginFrameArgs& args) override; |
50 void ReclaimResources(const cc::ReturnedResourceArray& resources) override; | 50 void ReclaimResources(const cc::ReturnedResourceArray& resources) override; |
51 void WillDrawSurface(const cc::LocalSurfaceId& local_surface_id, | |
Fady Samuel
2017/04/07 14:43:12
Can't delete this I think.
Alex Z.
2017/04/07 14:51:04
It's the one in exo::CompositorFrameSink that I sh
| |
52 const gfx::Rect& damage_rect) override; | |
53 | 51 |
54 // Overridden from cc::ExternalBeginFrameSourceClient: | 52 // Overridden from cc::ExternalBeginFrameSourceClient: |
55 void OnNeedsBeginFrames(bool needs_begin_frames) override; | 53 void OnNeedsBeginFrames(bool needs_begin_frames) override; |
56 void OnDidFinishFrame(const cc::BeginFrameAck& ack) override; | 54 void OnDidFinishFrame(const cc::BeginFrameAck& ack) override; |
57 | 55 |
58 // Overridden from SurfaceObserver: | 56 // Overridden from SurfaceObserver: |
59 void OnSurfaceDestroying(Surface* surface) override; | 57 void OnSurfaceDestroying(Surface* surface) override; |
60 | 58 |
61 private: | 59 private: |
62 friend class base::RefCounted<CompositorFrameSinkHolder>; | 60 friend class base::RefCounted<CompositorFrameSinkHolder>; |
63 | 61 |
64 ~CompositorFrameSinkHolder() override; | 62 ~CompositorFrameSinkHolder() override; |
65 | 63 |
66 // A collection of callbacks used to release resources. | 64 // A collection of callbacks used to release resources. |
67 using ResourceReleaseCallbackMap = std::map<int, cc::ReleaseCallback>; | 65 using ResourceReleaseCallbackMap = std::map<int, cc::ReleaseCallback>; |
68 ResourceReleaseCallbackMap release_callbacks_; | 66 ResourceReleaseCallbackMap release_callbacks_; |
69 | 67 |
70 Surface* surface_; | 68 Surface* surface_; |
71 std::unique_ptr<CompositorFrameSink> frame_sink_; | 69 std::unique_ptr<CompositorFrameSink> frame_sink_; |
72 std::unique_ptr<cc::ExternalBeginFrameSource> begin_frame_source_; | 70 std::unique_ptr<cc::ExternalBeginFrameSource> begin_frame_source_; |
73 | 71 |
74 base::WeakPtrFactory<CompositorFrameSinkHolder> weak_factory_; | 72 base::WeakPtrFactory<CompositorFrameSinkHolder> weak_factory_; |
75 | 73 |
76 DISALLOW_COPY_AND_ASSIGN(CompositorFrameSinkHolder); | 74 DISALLOW_COPY_AND_ASSIGN(CompositorFrameSinkHolder); |
77 }; | 75 }; |
78 | 76 |
79 } // namespace exo | 77 } // namespace exo |
80 | 78 |
81 #endif // COMPONENTS_EXO_COMPOSITOR_FRAME_SINK_HOLDER_H_ | 79 #endif // COMPONENTS_EXO_COMPOSITOR_FRAME_SINK_HOLDER_H_ |
OLD | NEW |