Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "services/ui/ws/compositor_frame_sink_client_binding.h" | |
| 6 | |
| 7 namespace ui { | |
| 8 namespace ws { | |
| 9 | |
| 10 CompositorFrameSinkClientBinding::CompositorFrameSinkClientBinding( | |
| 11 cc::mojom::MojoCompositorFrameSinkClient* sink_client, | |
| 12 cc::mojom::MojoCompositorFrameSinkClientRequest sink_client_request, | |
| 13 cc::mojom::MojoCompositorFrameSinkAssociatedPtr compositor_frame_sink, | |
| 14 cc::mojom::DisplayPrivateAssociatedPtr display_private) | |
| 15 : binding_(sink_client, std::move(sink_client_request)), | |
| 16 display_private_(std::move(display_private)), | |
| 17 compositor_frame_sink_(std::move(compositor_frame_sink)) {} | |
| 18 | |
| 19 CompositorFrameSinkClientBinding::~CompositorFrameSinkClientBinding() = default; | |
| 20 | |
| 21 void CompositorFrameSinkClientBinding::SetNeedsBeginFrame( | |
| 22 bool needs_begin_frame) { | |
| 23 compositor_frame_sink_->SetNeedsBeginFrame(needs_begin_frame); | |
| 24 } | |
| 25 | |
| 26 void CompositorFrameSinkClientBinding::SubmitCompositorFrame( | |
| 27 const cc::LocalSurfaceId& local_surface_id, | |
| 28 cc::CompositorFrame frame) { | |
| 29 if (local_surface_id != local_surface_id_) { | |
| 30 local_surface_id_ = local_surface_id; | |
| 31 gfx::Size frame_size = frame.render_pass_list.back()->output_rect.size(); | |
| 32 display_private_->ResizeDisplay(frame_size); | |
| 33 display_private_->SetLocalSurfaceId(local_surface_id_, | |
| 34 frame.metadata.device_scale_factor); | |
| 35 } | |
| 36 compositor_frame_sink_->SubmitCompositorFrame(local_surface_id_, | |
| 37 std::move(frame)); | |
| 38 compositor_frame_sink_->SetNeedsBeginFrame(false); | |
|
Fady Samuel
2017/05/19 14:40:33
Oops, just noticed this. It doesn't make sense to
Alex Z.
2017/05/19 14:42:23
Good catch. This line is removed.
| |
| 39 } | |
| 40 | |
| 41 void CompositorFrameSinkClientBinding::BeginFrameDidNotSwap( | |
| 42 const cc::BeginFrameAck& ack) { | |
| 43 compositor_frame_sink_->BeginFrameDidNotSwap(ack); | |
| 44 } | |
| 45 | |
| 46 void CompositorFrameSinkClientBinding::EvictCurrentSurface() { | |
| 47 compositor_frame_sink_->EvictCurrentSurface(); | |
| 48 } | |
| 49 | |
| 50 } // namespace ws | |
| 51 } // namespace ui | |
| OLD | NEW |