| 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 |
| 67 void WillDrawSurface(const LocalFrameId& id, const gfx::Rect& damage_rect); | 71 void WillDrawSurface(const LocalFrameId& id, const gfx::Rect& damage_rect); |
| 68 | 72 |
| 69 SurfaceFactoryClient* client() { return client_; } | 73 SurfaceFactoryClient* client() { return client_; } |
| 70 | 74 |
| 71 void ReceiveFromChild(const TransferableResourceArray& resources); | 75 void ReceiveFromChild(const TransferableResourceArray& resources); |
| 72 void RefResources(const TransferableResourceArray& resources); | 76 void RefResources(const TransferableResourceArray& resources); |
| 73 void UnrefResources(const ReturnedResourceArray& resources); | 77 void UnrefResources(const ReturnedResourceArray& resources); |
| 74 | 78 |
| 75 SurfaceManager* manager() { return manager_; } | 79 SurfaceManager* manager() { return manager_; } |
| 76 | 80 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 95 bool needs_sync_points_; | 99 bool needs_sync_points_; |
| 96 std::unique_ptr<Surface> current_surface_; | 100 std::unique_ptr<Surface> current_surface_; |
| 97 base::WeakPtrFactory<SurfaceFactory> weak_factory_; | 101 base::WeakPtrFactory<SurfaceFactory> weak_factory_; |
| 98 | 102 |
| 99 DISALLOW_COPY_AND_ASSIGN(SurfaceFactory); | 103 DISALLOW_COPY_AND_ASSIGN(SurfaceFactory); |
| 100 }; | 104 }; |
| 101 | 105 |
| 102 } // namespace cc | 106 } // namespace cc |
| 103 | 107 |
| 104 #endif // CC_SURFACES_SURFACE_FACTORY_H_ | 108 #endif // CC_SURFACES_SURFACE_FACTORY_H_ |
| OLD | NEW |