Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(383)

Unified Diff: cc/surfaces/surface.h

Issue 2802023002: Remove SurfaceFactory And SurfaceFactoryClient (Closed)
Patch Set: Rebase SurfaceSynchronizationTest Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/surfaces/frame_sink_manager.cc ('k') | cc/surfaces/surface.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/surface.h
diff --git a/cc/surfaces/surface.h b/cc/surfaces/surface.h
index 63371d6000f996d1ef4c1ecc46510f86945e9716..08addefac36c05159f2f3c0dfc99ccef149b8ac9 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;
};
@@ -159,7 +162,7 @@ class CC_SURFACES_EXPORT Surface {
const 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_;
« no previous file with comments | « cc/surfaces/frame_sink_manager.cc ('k') | cc/surfaces/surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698