| 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 #include <unordered_map> | 10 #include <unordered_map> |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 // A frame can only be submitted to a surface created by this factory, | 64 // A frame can only be submitted to a surface created by this factory, |
| 65 // although the frame may reference surfaces created by other factories. | 65 // although the frame may reference surfaces created by other factories. |
| 66 // The callback is called the first time this frame is used to draw, or if | 66 // The callback is called the first time this frame is used to draw, or if |
| 67 // the frame is discarded. | 67 // the frame is discarded. |
| 68 void SubmitCompositorFrame(const LocalFrameId& local_frame_id, | 68 void SubmitCompositorFrame(const LocalFrameId& local_frame_id, |
| 69 CompositorFrame frame, | 69 CompositorFrame frame, |
| 70 const DrawCallback& callback); | 70 const DrawCallback& callback); |
| 71 void RequestCopyOfSurface(const LocalFrameId& local_frame_id, | 71 void RequestCopyOfSurface(const LocalFrameId& local_frame_id, |
| 72 std::unique_ptr<CopyOutputRequest> copy_request); | 72 std::unique_ptr<CopyOutputRequest> copy_request); |
| 73 | 73 |
| 74 // Evicts the current frame on the surface. All the resources |
| 75 // will be released and Surface::HasFrame will return false. |
| 76 void ClearSurface(const LocalFrameId& local_frame_id); |
| 77 |
| 74 void WillDrawSurface(const LocalFrameId& id, const gfx::Rect& damage_rect); | 78 void WillDrawSurface(const LocalFrameId& id, const gfx::Rect& damage_rect); |
| 75 | 79 |
| 76 SurfaceFactoryClient* client() { return client_; } | 80 SurfaceFactoryClient* client() { return client_; } |
| 77 | 81 |
| 78 void ReceiveFromChild(const TransferableResourceArray& resources); | 82 void ReceiveFromChild(const TransferableResourceArray& resources); |
| 79 void RefResources(const TransferableResourceArray& resources); | 83 void RefResources(const TransferableResourceArray& resources); |
| 80 void UnrefResources(const ReturnedResourceArray& resources); | 84 void UnrefResources(const ReturnedResourceArray& resources); |
| 81 | 85 |
| 82 SurfaceManager* manager() { return manager_; } | 86 SurfaceManager* manager() { return manager_; } |
| 83 | 87 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 104 OwningSurfaceMap surface_map_; | 108 OwningSurfaceMap surface_map_; |
| 105 | 109 |
| 106 base::WeakPtrFactory<SurfaceFactory> weak_factory_; | 110 base::WeakPtrFactory<SurfaceFactory> weak_factory_; |
| 107 | 111 |
| 108 DISALLOW_COPY_AND_ASSIGN(SurfaceFactory); | 112 DISALLOW_COPY_AND_ASSIGN(SurfaceFactory); |
| 109 }; | 113 }; |
| 110 | 114 |
| 111 } // namespace cc | 115 } // namespace cc |
| 112 | 116 |
| 113 #endif // CC_SURFACES_SURFACE_FACTORY_H_ | 117 #endif // CC_SURFACES_SURFACE_FACTORY_H_ |
| OLD | NEW |