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

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

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
Index: services/ui/ws/compositor_frame_sink_client_binding.cc
diff --git a/services/ui/ws/compositor_frame_sink_client_binding.cc b/services/ui/ws/compositor_frame_sink_client_binding.cc
new file mode 100644
index 0000000000000000000000000000000000000000..9ce826cb8d50191182c47e5dc90424bbe008161f
--- /dev/null
+++ b/services/ui/ws/compositor_frame_sink_client_binding.cc
@@ -0,0 +1,50 @@
+// 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.
+
+#include "services/ui/ws/compositor_frame_sink_client_binding.h"
+
+namespace ui {
+namespace ws {
+
+CompositorFrameSinkClientBinding::CompositorFrameSinkClientBinding(
+ cc::mojom::MojoCompositorFrameSinkClient* sink_client,
+ cc::mojom::MojoCompositorFrameSinkClientRequest sink_client_request,
+ cc::mojom::MojoCompositorFrameSinkAssociatedPtr compositor_frame_sink,
+ cc::mojom::DisplayPrivateAssociatedPtr display_private)
+ : binding_(sink_client, std::move(sink_client_request)),
+ display_private_(std::move(display_private)),
+ compositor_frame_sink_(std::move(compositor_frame_sink)) {}
+
+CompositorFrameSinkClientBinding::~CompositorFrameSinkClientBinding() = default;
+
+void CompositorFrameSinkClientBinding::SetNeedsBeginFrame(
+ bool needs_begin_frame) {
+ compositor_frame_sink_->SetNeedsBeginFrame(needs_begin_frame);
+}
+
+void CompositorFrameSinkClientBinding::SubmitCompositorFrame(
+ const cc::LocalSurfaceId& local_surface_id,
+ cc::CompositorFrame frame) {
+ if (local_surface_id != local_surface_id_) {
+ local_surface_id_ = local_surface_id;
+ gfx::Size frame_size = frame.render_pass_list.back()->output_rect.size();
+ display_private_->ResizeDisplay(frame_size);
+ display_private_->SetLocalSurfaceId(local_surface_id_,
+ frame.metadata.device_scale_factor);
+ }
+ compositor_frame_sink_->SubmitCompositorFrame(local_surface_id_,
+ std::move(frame));
+}
+
+void CompositorFrameSinkClientBinding::BeginFrameDidNotSwap(
+ const cc::BeginFrameAck& ack) {
+ compositor_frame_sink_->BeginFrameDidNotSwap(ack);
+}
+
+void CompositorFrameSinkClientBinding::EvictCurrentSurface() {
+ compositor_frame_sink_->EvictCurrentSurface();
+}
+
+} // namespace ws
+} // namespace ui
« no previous file with comments | « services/ui/ws/compositor_frame_sink_client_binding.h ('k') | services/ui/ws/display_client_compositor_frame_sink.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698