| 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
|
|
|