Chromium Code Reviews| Index: cc/surfaces/surface_factory.h |
| diff --git a/cc/surfaces/surface_factory.h b/cc/surfaces/surface_factory.h |
| index 3a6431596bc9cc470e8ef4fdbae1520988543e14..b56a0b8fb8805cb82e87a0d1b213c8b9515cf022 100644 |
| --- a/cc/surfaces/surface_factory.h |
| +++ b/cc/surfaces/surface_factory.h |
| @@ -7,7 +7,6 @@ |
| #include <memory> |
| #include <set> |
| -#include <unordered_map> |
| #include "base/callback_forward.h" |
| #include "base/macros.h" |
| @@ -46,21 +45,12 @@ class CC_SURFACES_EXPORT SurfaceFactory { |
| const FrameSinkId& frame_sink_id() const { return frame_sink_id_; } |
| - void Create(const LocalFrameId& local_frame_id); |
| - void Destroy(const LocalFrameId& local_frame_id); |
| - |
| - // Destroys all surfaces. |
| - void DestroyAll(); |
| + void EvictFrame(); |
|
piman
2016/11/12 00:19:10
EvictSurface maybe?
Trying to get consistent nami
danakj
2016/11/12 00:27:21
Please add a comment to explain what this does and
|
| // Destroys and disown all surfaces, and reset all resource references. This |
|
danakj
2016/11/12 00:27:21
does the meaning of "all surfaces" change now?
Saman Sami
2016/11/14 23:39:01
Done.
|
| // is useful when resources are invalid (e.g. lost context). |
| void Reset(); |
| - // Set that the current frame on new_id is to be treated as the successor to |
| - // the current frame on old_id for the purposes of calculating damage. |
| - void SetPreviousFrameSurface(const LocalFrameId& new_id, |
| - const LocalFrameId& old_id); |
| - |
| // A frame can only be submitted to a surface created by this factory, |
|
piman
2016/11/12 00:19:10
Documentation should be updated.
Saman Sami
2016/11/14 23:39:01
Done.
|
| // although the frame may reference surfaces created by other factories. |
| // The callback is called the first time this frame is used to draw, or if |
| @@ -68,8 +58,7 @@ class CC_SURFACES_EXPORT SurfaceFactory { |
| void SubmitCompositorFrame(const LocalFrameId& local_frame_id, |
| CompositorFrame frame, |
| const DrawCallback& callback); |
| - void RequestCopyOfSurface(const LocalFrameId& local_frame_id, |
| - std::unique_ptr<CopyOutputRequest> copy_request); |
| + void RequestCopyOfSurface(std::unique_ptr<CopyOutputRequest> copy_request); |
| void WillDrawSurface(const LocalFrameId& id, const gfx::Rect& damage_rect); |
| @@ -92,17 +81,15 @@ class CC_SURFACES_EXPORT SurfaceFactory { |
| void DidDestroySurfaceManager() { manager_ = nullptr; } |
| private: |
| - FrameSinkId frame_sink_id_; |
| + std::unique_ptr<Surface> Create(const LocalFrameId& local_frame_id); |
| + void Destroy(std::unique_ptr<Surface> surface); |
| + |
| + const FrameSinkId frame_sink_id_; |
| SurfaceManager* manager_; |
| SurfaceFactoryClient* client_; |
| SurfaceResourceHolder holder_; |
| - |
| bool needs_sync_points_; |
| - |
| - using OwningSurfaceMap = std:: |
| - unordered_map<LocalFrameId, std::unique_ptr<Surface>, LocalFrameIdHash>; |
| - OwningSurfaceMap surface_map_; |
| - |
| + std::unique_ptr<Surface> current_surface_; |
| base::WeakPtrFactory<SurfaceFactory> weak_factory_; |
| DISALLOW_COPY_AND_ASSIGN(SurfaceFactory); |