OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/viz/frame_sinks/gpu_root_compositor_frame_sink.h" | 5 #include "components/viz/frame_sinks/gpu_root_compositor_frame_sink.h" |
6 | 6 |
7 #include "cc/surfaces/compositor_frame_sink_support.h" | 7 #include "cc/surfaces/compositor_frame_sink_support.h" |
8 #include "cc/surfaces/display.h" | 8 #include "cc/surfaces/display.h" |
9 | 9 |
10 namespace viz { | 10 namespace viz { |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 DCHECK(display_); | 67 DCHECK(display_); |
68 display_->SetOutputIsSecure(secure); | 68 display_->SetOutputIsSecure(secure); |
69 } | 69 } |
70 | 70 |
71 void GpuRootCompositorFrameSink::SetLocalSurfaceId( | 71 void GpuRootCompositorFrameSink::SetLocalSurfaceId( |
72 const cc::LocalSurfaceId& local_surface_id, | 72 const cc::LocalSurfaceId& local_surface_id, |
73 float scale_factor) { | 73 float scale_factor) { |
74 display_->SetLocalSurfaceId(local_surface_id, scale_factor); | 74 display_->SetLocalSurfaceId(local_surface_id, scale_factor); |
75 } | 75 } |
76 | 76 |
77 void GpuRootCompositorFrameSink::EvictCurrentSurface() { | |
78 support_->EvictCurrentSurface(); | |
79 } | |
80 | |
81 void GpuRootCompositorFrameSink::SetNeedsBeginFrame(bool needs_begin_frame) { | 77 void GpuRootCompositorFrameSink::SetNeedsBeginFrame(bool needs_begin_frame) { |
82 support_->SetNeedsBeginFrame(needs_begin_frame); | 78 support_->SetNeedsBeginFrame(needs_begin_frame); |
83 } | 79 } |
84 | 80 |
85 void GpuRootCompositorFrameSink::SubmitCompositorFrame( | 81 void GpuRootCompositorFrameSink::SubmitCompositorFrame( |
86 const cc::LocalSurfaceId& local_surface_id, | 82 const cc::LocalSurfaceId& local_surface_id, |
87 cc::CompositorFrame frame) { | 83 cc::CompositorFrame frame) { |
88 if (!support_->SubmitCompositorFrame(local_surface_id, std::move(frame))) { | 84 if (!support_->SubmitCompositorFrame(local_surface_id, std::move(frame))) { |
89 compositor_frame_sink_binding_.Close(); | 85 compositor_frame_sink_binding_.Close(); |
90 OnClientConnectionLost(); | 86 OnClientConnectionLost(); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 } | 142 } |
147 | 143 |
148 void GpuRootCompositorFrameSink::OnPrivateConnectionLost() { | 144 void GpuRootCompositorFrameSink::OnPrivateConnectionLost() { |
149 private_connection_lost_ = true; | 145 private_connection_lost_ = true; |
150 // Request destruction of |this| only if both connections are lost. | 146 // Request destruction of |this| only if both connections are lost. |
151 delegate_->OnPrivateConnectionLost(support_->frame_sink_id(), | 147 delegate_->OnPrivateConnectionLost(support_->frame_sink_id(), |
152 client_connection_lost_); | 148 client_connection_lost_); |
153 } | 149 } |
154 | 150 |
155 } // namespace viz | 151 } // namespace viz |
OLD | NEW |