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 | 9 |
10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 // factory's client when they are no longer being used. This is the only class | 33 // factory's client when they are no longer being used. This is the only class |
34 // most users of surfaces will need to directly interact with. | 34 // most users of surfaces will need to directly interact with. |
35 class CC_SURFACES_EXPORT SurfaceFactory | 35 class CC_SURFACES_EXPORT SurfaceFactory |
36 : public base::SupportsWeakPtr<SurfaceFactory> { | 36 : public base::SupportsWeakPtr<SurfaceFactory> { |
37 public: | 37 public: |
38 SurfaceFactory(SurfaceManager* manager, SurfaceFactoryClient* client); | 38 SurfaceFactory(SurfaceManager* manager, SurfaceFactoryClient* client); |
39 ~SurfaceFactory(); | 39 ~SurfaceFactory(); |
40 | 40 |
41 void Create(SurfaceId surface_id, const gfx::Size& size); | 41 void Create(SurfaceId surface_id, const gfx::Size& size); |
42 void Destroy(SurfaceId surface_id); | 42 void Destroy(SurfaceId surface_id); |
43 void DestroyOnSequence(SurfaceId surface_id, | |
44 const std::set<SurfaceSequence>& dependency_set); | |
45 void DestroyAll(); | 43 void DestroyAll(); |
46 // A frame can only be submitted to a surface created by this factory, | 44 // A frame can only be submitted to a surface created by this factory, |
47 // although the frame may reference surfaces created by other factories. | 45 // although the frame may reference surfaces created by other factories. |
48 // The callback is called the first time this frame is used to draw. | 46 // The callback is called the first time this frame is used to draw. |
49 void SubmitFrame(SurfaceId surface_id, | 47 void SubmitFrame(SurfaceId surface_id, |
50 scoped_ptr<CompositorFrame> frame, | 48 scoped_ptr<CompositorFrame> frame, |
51 const base::Closure& callback); | 49 const base::Closure& callback); |
52 void RequestCopyOfSurface(SurfaceId surface_id, | 50 void RequestCopyOfSurface(SurfaceId surface_id, |
53 scoped_ptr<CopyOutputRequest> copy_request); | 51 scoped_ptr<CopyOutputRequest> copy_request); |
54 | 52 |
(...skipping 12 matching lines...) Expand all Loading... |
67 | 65 |
68 typedef base::ScopedPtrHashMap<SurfaceId, Surface> OwningSurfaceMap; | 66 typedef base::ScopedPtrHashMap<SurfaceId, Surface> OwningSurfaceMap; |
69 base::ScopedPtrHashMap<SurfaceId, Surface> surface_map_; | 67 base::ScopedPtrHashMap<SurfaceId, Surface> surface_map_; |
70 | 68 |
71 DISALLOW_COPY_AND_ASSIGN(SurfaceFactory); | 69 DISALLOW_COPY_AND_ASSIGN(SurfaceFactory); |
72 }; | 70 }; |
73 | 71 |
74 } // namespace cc | 72 } // namespace cc |
75 | 73 |
76 #endif // CC_SURFACES_SURFACE_FACTORY_H_ | 74 #endif // CC_SURFACES_SURFACE_FACTORY_H_ |
OLD | NEW |