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 <memory> | 8 #include <memory> |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 23 matching lines...) Expand all Loading... |
34 // longer being used. This is the only class most users of surfaces will need to | 34 // longer being used. This is the only class most users of surfaces will need to |
35 // directly interact with. | 35 // directly interact with. |
36 class CC_SURFACES_EXPORT SurfaceFactory : public PendingFrameObserver { | 36 class CC_SURFACES_EXPORT SurfaceFactory : public PendingFrameObserver { |
37 public: | 37 public: |
38 using DrawCallback = base::Callback<void()>; | 38 using DrawCallback = base::Callback<void()>; |
39 using WillDrawCallback = | 39 using WillDrawCallback = |
40 base::RepeatingCallback<void(const LocalSurfaceId&, const gfx::Rect&)>; | 40 base::RepeatingCallback<void(const LocalSurfaceId&, const gfx::Rect&)>; |
41 | 41 |
42 SurfaceFactory(const FrameSinkId& frame_sink_id, | 42 SurfaceFactory(const FrameSinkId& frame_sink_id, |
43 SurfaceManager* manager, | 43 SurfaceManager* manager, |
44 SurfaceFactoryClient* client); | 44 SurfaceFactoryClient* client, |
| 45 SurfaceResourceHolderClient* resource_holder_client); |
45 ~SurfaceFactory() override; | 46 ~SurfaceFactory() override; |
46 | 47 |
47 const FrameSinkId& frame_sink_id() const { return frame_sink_id_; } | 48 const FrameSinkId& frame_sink_id() const { return frame_sink_id_; } |
48 | 49 |
49 // Destroys the current surface. You need to call this method before the | 50 // Destroys the current surface. You need to call this method before the |
50 // factory is destroyed, or when you would like to get rid of the surface as | 51 // factory is destroyed, or when you would like to get rid of the surface as |
51 // soon as possible (otherwise, the next time you call SubmitCompositorFrame | 52 // soon as possible (otherwise, the next time you call SubmitCompositorFrame |
52 // the old surface will be dealt with). | 53 // the old surface will be dealt with). |
53 void EvictSurface(); | 54 void EvictSurface(); |
54 | 55 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 bool seen_first_frame_activation_ = false; | 105 bool seen_first_frame_activation_ = false; |
105 std::unique_ptr<Surface> current_surface_; | 106 std::unique_ptr<Surface> current_surface_; |
106 base::WeakPtrFactory<SurfaceFactory> weak_factory_; | 107 base::WeakPtrFactory<SurfaceFactory> weak_factory_; |
107 | 108 |
108 DISALLOW_COPY_AND_ASSIGN(SurfaceFactory); | 109 DISALLOW_COPY_AND_ASSIGN(SurfaceFactory); |
109 }; | 110 }; |
110 | 111 |
111 } // namespace cc | 112 } // namespace cc |
112 | 113 |
113 #endif // CC_SURFACES_SURFACE_FACTORY_H_ | 114 #endif // CC_SURFACES_SURFACE_FACTORY_H_ |
OLD | NEW |