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

Unified Diff: cc/surfaces/surface.h

Issue 2802023002: Remove SurfaceFactory And SurfaceFactoryClient (Closed)
Patch Set: Change Ref/UnrefResources to public Created 3 years, 8 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
Index: cc/surfaces/surface.h
diff --git a/cc/surfaces/surface.h b/cc/surfaces/surface.h
index 603036fe90e069fe4f8203e81c2944e0f4e66721..ffafa3b340dd296fefec32f9e1fa6b34ef1c2679 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,16 @@ namespace cc {
class CompositorFrame;
class CopyOutputRequest;
-class SurfaceFactory;
class CC_SURFACES_EXPORT Surface {
public:
- using DrawCallback = SurfaceFactory::DrawCallback;
- using WillDrawCallback = SurfaceFactory::WillDrawCallback;
+ using DrawCallback = base::Callback<void()>;
danakj 2017/05/03 16:08:39 this is written base::Closure
Alex Z. 2017/05/03 18:07:37 Done.
danakj 2017/05/05 16:04:19 FWIW I was okay with the typedef, but I mean Callb
+ 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_; }
@@ -93,7 +95,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.
@@ -155,7 +159,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_;

Powered by Google App Engine
This is Rietveld 408576698