OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_SURFACE_FACTORY_H_ | 5 #ifndef CC_SURFACES_SURFACE_FACTORY_H_ |
6 #define CC_SURFACES_SURFACE_FACTORY_H_ | 6 #define CC_SURFACES_SURFACE_FACTORY_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <unordered_map> | 9 #include <unordered_map> |
10 | 10 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 public: | 42 public: |
43 using DrawCallback = base::Callback<void(SurfaceDrawStatus)>; | 43 using DrawCallback = base::Callback<void(SurfaceDrawStatus)>; |
44 | 44 |
45 SurfaceFactory(SurfaceManager* manager, SurfaceFactoryClient* client); | 45 SurfaceFactory(SurfaceManager* manager, SurfaceFactoryClient* client); |
46 ~SurfaceFactory(); | 46 ~SurfaceFactory(); |
47 | 47 |
48 void Create(SurfaceId surface_id); | 48 void Create(SurfaceId surface_id); |
49 void Destroy(SurfaceId surface_id); | 49 void Destroy(SurfaceId surface_id); |
50 void DestroyAll(); | 50 void DestroyAll(); |
51 | 51 |
52 void SetBeginFrameSource(SurfaceId surface_id, | |
53 BeginFrameSource* begin_frame_source); | |
54 | |
55 // A frame can only be submitted to a surface created by this factory, | 52 // A frame can only be submitted to a surface created by this factory, |
56 // although the frame may reference surfaces created by other factories. | 53 // although the frame may reference surfaces created by other factories. |
57 // The callback is called the first time this frame is used to draw, or if | 54 // The callback is called the first time this frame is used to draw, or if |
58 // the frame is discarded. | 55 // the frame is discarded. |
59 void SubmitCompositorFrame(SurfaceId surface_id, | 56 void SubmitCompositorFrame(SurfaceId surface_id, |
60 scoped_ptr<CompositorFrame> frame, | 57 scoped_ptr<CompositorFrame> frame, |
61 const DrawCallback& callback); | 58 const DrawCallback& callback); |
62 void RequestCopyOfSurface(SurfaceId surface_id, | 59 void RequestCopyOfSurface(SurfaceId surface_id, |
63 scoped_ptr<CopyOutputRequest> copy_request); | 60 scoped_ptr<CopyOutputRequest> copy_request); |
64 | 61 |
(...skipping 23 matching lines...) Expand all Loading... |
88 using OwningSurfaceMap = | 85 using OwningSurfaceMap = |
89 std::unordered_map<SurfaceId, scoped_ptr<Surface>, SurfaceIdHash>; | 86 std::unordered_map<SurfaceId, scoped_ptr<Surface>, SurfaceIdHash>; |
90 OwningSurfaceMap surface_map_; | 87 OwningSurfaceMap surface_map_; |
91 | 88 |
92 DISALLOW_COPY_AND_ASSIGN(SurfaceFactory); | 89 DISALLOW_COPY_AND_ASSIGN(SurfaceFactory); |
93 }; | 90 }; |
94 | 91 |
95 } // namespace cc | 92 } // namespace cc |
96 | 93 |
97 #endif // CC_SURFACES_SURFACE_FACTORY_H_ | 94 #endif // CC_SURFACES_SURFACE_FACTORY_H_ |
OLD | NEW |