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

Unified Diff: services/ui/ws/compositor_frame_sink_client_binding.h

Issue 2890913002: Add CompositorFrameSinkClientBinding To Be Used By FrameGenerator (Closed)
Patch Set: Remove redundant SetNeedsBeginFrame 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 | « services/ui/ws/BUILD.gn ('k') | services/ui/ws/compositor_frame_sink_client_binding.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/ws/compositor_frame_sink_client_binding.h
diff --git a/services/ui/ws/compositor_frame_sink_client_binding.h b/services/ui/ws/compositor_frame_sink_client_binding.h
new file mode 100644
index 0000000000000000000000000000000000000000..5d455841c59792c7dae137b7fcea57e4f3618288
--- /dev/null
+++ b/services/ui/ws/compositor_frame_sink_client_binding.h
@@ -0,0 +1,51 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SERVICES_UI_WS_COMPOSITOR_FRAME_SINK_CLIENT_BINDING_H_
+#define SERVICES_UI_WS_COMPOSITOR_FRAME_SINK_CLIENT_BINDING_H_
+
+#include "base/macros.h"
+#include "cc/ipc/frame_sink_manager.mojom.h"
+#include "cc/ipc/mojo_compositor_frame_sink.mojom.h"
+#include "cc/surfaces/local_surface_id_allocator.h"
+#include "mojo/public/cpp/bindings/binding.h"
+
+namespace ui {
+namespace ws {
+
+// CompositorFrameSinkClientBinding manages the binding between a FrameGenerator
+// and its MojoCompositorFrameSink. CompositorFrameSinkClientBinding exists so
+// that a mock implementation of MojoCompositorFrameSink can be injected for
+// tests. FrameGenerator owns its associated CompositorFrameSinkClientBinding.
+class CompositorFrameSinkClientBinding
+ : public cc::mojom::MojoCompositorFrameSink {
+ public:
+ CompositorFrameSinkClientBinding(
+ cc::mojom::MojoCompositorFrameSinkClient* sink_client,
+ cc::mojom::MojoCompositorFrameSinkClientRequest sink_client_request,
+ cc::mojom::MojoCompositorFrameSinkAssociatedPtr compositor_frame_sink,
+ cc::mojom::DisplayPrivateAssociatedPtr display_private);
+ ~CompositorFrameSinkClientBinding() override;
+
+ private:
+ // cc::mojom::MojoCompositorFrameSink implementation:
+ void SubmitCompositorFrame(const cc::LocalSurfaceId& local_surface_id,
+ cc::CompositorFrame frame) override;
+ void SetNeedsBeginFrame(bool needs_begin_frame) override;
+ void BeginFrameDidNotSwap(const cc::BeginFrameAck& ack) override;
+ void EvictCurrentSurface() override;
+
+ mojo::Binding<cc::mojom::MojoCompositorFrameSinkClient> binding_;
+ cc::mojom::DisplayPrivateAssociatedPtr display_private_;
+ cc::mojom::MojoCompositorFrameSinkAssociatedPtr compositor_frame_sink_;
+ cc::LocalSurfaceId local_surface_id_;
+ cc::LocalSurfaceIdAllocator id_allocator_;
+ gfx::Size last_submitted_frame_size_;
+
+ DISALLOW_COPY_AND_ASSIGN(CompositorFrameSinkClientBinding);
+};
+}
+}
+
+#endif // SERVICES_UI_WS_COMPOSITOR_FRAME_SINK_CLIENT_BINDING_H_
« no previous file with comments | « services/ui/ws/BUILD.gn ('k') | services/ui/ws/compositor_frame_sink_client_binding.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698