| Index: cc/surfaces/surface.h
|
| diff --git a/cc/surfaces/surface.h b/cc/surfaces/surface.h
|
| index b43b1dafcd055c203ba5b249d93cce8211b40522..e7b0cfa8a3249e4c123625be36f9937a249fffba 100644
|
| --- a/cc/surfaces/surface.h
|
| +++ b/cc/surfaces/surface.h
|
| @@ -19,9 +19,9 @@
|
| #include "base/memory/weak_ptr.h"
|
| #include "base/optional.h"
|
| #include "cc/output/copy_output_request.h"
|
| +#include "cc/surfaces/compositor_frame_sink_support.h"
|
| #include "cc/surfaces/frame_sink_id.h"
|
| #include "cc/surfaces/pending_frame_observer.h"
|
| -#include "cc/surfaces/surface_factory.h"
|
| #include "cc/surfaces/surface_id.h"
|
| #include "cc/surfaces/surface_sequence.h"
|
| #include "cc/surfaces/surfaces_export.h"
|
| @@ -35,14 +35,15 @@ namespace cc {
|
|
|
| class CompositorFrame;
|
| class CopyOutputRequest;
|
| -class SurfaceFactory;
|
|
|
| class CC_SURFACES_EXPORT Surface {
|
| public:
|
| - using DrawCallback = SurfaceFactory::DrawCallback;
|
| - using WillDrawCallback = SurfaceFactory::WillDrawCallback;
|
| + using WillDrawCallback =
|
| + base::RepeatingCallback<void(const LocalSurfaceId&, const gfx::Rect&)>;
|
|
|
| - Surface(const SurfaceId& id, base::WeakPtr<SurfaceFactory> factory);
|
| + Surface(
|
| + const SurfaceId& id,
|
| + base::WeakPtr<CompositorFrameSinkSupport> compositor_frame_sink_support);
|
| ~Surface();
|
|
|
| const SurfaceId& surface_id() const { return surface_id_; }
|
| @@ -58,7 +59,7 @@ class CC_SURFACES_EXPORT Surface {
|
| // |will_draw_callback| is called when |surface| is scheduled for a draw and
|
| // there is visible damage.
|
| void QueueFrame(CompositorFrame frame,
|
| - const DrawCallback& draw_callback,
|
| + const base::Closure& draw_callback,
|
| const WillDrawCallback& will_draw_callback);
|
| void RequestCopyOfOutput(std::unique_ptr<CopyOutputRequest> copy_request);
|
|
|
| @@ -93,7 +94,9 @@ class CC_SURFACES_EXPORT Surface {
|
| void RunDrawCallback();
|
| void RunWillDrawCallback(const gfx::Rect& damage_rect);
|
|
|
| - base::WeakPtr<SurfaceFactory> factory() { return factory_; }
|
| + base::WeakPtr<CompositorFrameSinkSupport> compositor_frame_sink_support() {
|
| + return compositor_frame_sink_support_;
|
| + }
|
|
|
| // Add a SurfaceSequence that must be satisfied before the Surface is
|
| // destroyed.
|
| @@ -127,13 +130,13 @@ class CC_SURFACES_EXPORT Surface {
|
| private:
|
| struct FrameData {
|
| FrameData(CompositorFrame&& frame,
|
| - const DrawCallback& draw_callback,
|
| + const base::Closure& draw_callback,
|
| const WillDrawCallback& will_draw_callback);
|
| FrameData(FrameData&& other);
|
| ~FrameData();
|
| FrameData& operator=(FrameData&& other);
|
| CompositorFrame frame;
|
| - DrawCallback draw_callback;
|
| + base::Closure draw_callback;
|
| WillDrawCallback will_draw_callback;
|
| };
|
|
|
| @@ -155,7 +158,7 @@ class CC_SURFACES_EXPORT Surface {
|
|
|
| SurfaceId surface_id_;
|
| SurfaceId previous_frame_surface_id_;
|
| - base::WeakPtr<SurfaceFactory> factory_;
|
| + base::WeakPtr<CompositorFrameSinkSupport> compositor_frame_sink_support_;
|
|
|
| base::Optional<FrameData> pending_frame_data_;
|
| base::Optional<FrameData> active_frame_data_;
|
|
|