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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 // the local frame ids match, or creates a new surface with the given local | 57 // the local frame ids match, or creates a new surface with the given local |
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 LocalFrameId& local_frame_id, | 62 void SubmitCompositorFrame(const LocalFrameId& local_frame_id, |
63 CompositorFrame frame, | 63 CompositorFrame frame, |
64 const DrawCallback& callback); | 64 const DrawCallback& callback); |
65 void RequestCopyOfSurface(std::unique_ptr<CopyOutputRequest> copy_request); | 65 void RequestCopyOfSurface(std::unique_ptr<CopyOutputRequest> copy_request); |
66 | 66 |
67 // Evicts the current frame on the surface. All the resources | |
68 // will be released and Surface::HasFrame will return false. | |
69 void ClearSurface(); | |
70 | |
71 void WillDrawSurface(const LocalFrameId& id, const gfx::Rect& damage_rect); | 67 void WillDrawSurface(const LocalFrameId& id, const gfx::Rect& damage_rect); |
72 | 68 |
73 SurfaceFactoryClient* client() { return client_; } | 69 SurfaceFactoryClient* client() { return client_; } |
74 | 70 |
75 void ReceiveFromChild(const TransferableResourceArray& resources); | 71 void ReceiveFromChild(const TransferableResourceArray& resources); |
76 void RefResources(const TransferableResourceArray& resources); | 72 void RefResources(const TransferableResourceArray& resources); |
77 void UnrefResources(const ReturnedResourceArray& resources); | 73 void UnrefResources(const ReturnedResourceArray& resources); |
78 | 74 |
79 SurfaceManager* manager() { return manager_; } | 75 SurfaceManager* manager() { return manager_; } |
80 | 76 |
(...skipping 18 matching lines...) Expand all Loading... |
99 bool needs_sync_points_; | 95 bool needs_sync_points_; |
100 std::unique_ptr<Surface> current_surface_; | 96 std::unique_ptr<Surface> current_surface_; |
101 base::WeakPtrFactory<SurfaceFactory> weak_factory_; | 97 base::WeakPtrFactory<SurfaceFactory> weak_factory_; |
102 | 98 |
103 DISALLOW_COPY_AND_ASSIGN(SurfaceFactory); | 99 DISALLOW_COPY_AND_ASSIGN(SurfaceFactory); |
104 }; | 100 }; |
105 | 101 |
106 } // namespace cc | 102 } // namespace cc |
107 | 103 |
108 #endif // CC_SURFACES_SURFACE_FACTORY_H_ | 104 #endif // CC_SURFACES_SURFACE_FACTORY_H_ |
OLD | NEW |