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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 // frame id, destroys the old one, and submits the frame to this new surface. | 58 // frame id, destroys the old one, and submits the frame to this new surface. |
59 // The frame can contain references to any surface, regardless of which | 59 // The frame can contain references to any surface, regardless of which |
60 // factory owns it. The callback is called the first time this frame is used | 60 // factory owns it. The callback is called the first time this frame is used |
61 // to draw, or if the frame is discarded. | 61 // to draw, or if the frame is discarded. |
62 void SubmitCompositorFrame(const LocalSurfaceId& local_surface_id, | 62 void SubmitCompositorFrame(const LocalSurfaceId& local_surface_id, |
63 CompositorFrame frame, | 63 CompositorFrame frame, |
64 const DrawCallback& callback, | 64 const DrawCallback& callback, |
65 const WillDrawCallback& will_draw_callback); | 65 const WillDrawCallback& will_draw_callback); |
66 void RequestCopyOfSurface(std::unique_ptr<CopyOutputRequest> copy_request); | 66 void RequestCopyOfSurface(std::unique_ptr<CopyOutputRequest> copy_request); |
67 | 67 |
68 // Evicts the current frame on the surface. All the resources | |
69 // will be released and Surface::HasFrame will return false. | |
70 void ClearSurface(); | |
71 | |
72 SurfaceFactoryClient* client() { return client_; } | 68 SurfaceFactoryClient* client() { return client_; } |
73 | 69 |
74 void ReceiveFromChild(const TransferableResourceArray& resources); | 70 void ReceiveFromChild(const TransferableResourceArray& resources); |
75 void RefResources(const TransferableResourceArray& resources); | 71 void RefResources(const TransferableResourceArray& resources); |
76 void UnrefResources(const ReturnedResourceArray& resources); | 72 void UnrefResources(const ReturnedResourceArray& resources); |
77 | 73 |
78 SurfaceManager* manager() { return manager_; } | 74 SurfaceManager* manager() { return manager_; } |
79 | 75 |
80 Surface* current_surface_for_testing() { return current_surface_.get(); } | 76 Surface* current_surface_for_testing() { return current_surface_.get(); } |
81 | 77 |
(...skipping 23 matching lines...) Expand all Loading... |
105 bool seen_first_frame_activation_ = false; | 101 bool seen_first_frame_activation_ = false; |
106 std::unique_ptr<Surface> current_surface_; | 102 std::unique_ptr<Surface> current_surface_; |
107 base::WeakPtrFactory<SurfaceFactory> weak_factory_; | 103 base::WeakPtrFactory<SurfaceFactory> weak_factory_; |
108 | 104 |
109 DISALLOW_COPY_AND_ASSIGN(SurfaceFactory); | 105 DISALLOW_COPY_AND_ASSIGN(SurfaceFactory); |
110 }; | 106 }; |
111 | 107 |
112 } // namespace cc | 108 } // namespace cc |
113 | 109 |
114 #endif // CC_SURFACES_SURFACE_FACTORY_H_ | 110 #endif // CC_SURFACES_SURFACE_FACTORY_H_ |
OLD | NEW |