| 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/service/frame_sinks/gpu_root_compositor_frame_sink.h" | 5 #include "components/viz/service/frame_sinks/gpu_root_compositor_frame_sink.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" |
| 9 #include "components/viz/service/display/display.h" | 10 #include "components/viz/service/display/display.h" |
| 10 #include "components/viz/service/frame_sinks/compositor_frame_sink_support.h" | 11 #include "components/viz/service/frame_sinks/compositor_frame_sink_support.h" |
| 11 #include "components/viz/service/frame_sinks/frame_sink_manager.h" | 12 #include "components/viz/service/frame_sinks/frame_sink_manager.h" |
| 12 | 13 |
| 13 namespace viz { | 14 namespace viz { |
| 14 | 15 |
| 15 GpuRootCompositorFrameSink::GpuRootCompositorFrameSink( | 16 GpuRootCompositorFrameSink::GpuRootCompositorFrameSink( |
| 16 GpuCompositorFrameSinkDelegate* delegate, | 17 GpuCompositorFrameSinkDelegate* delegate, |
| 17 FrameSinkManager* frame_sink_manager, | 18 FrameSinkManager* frame_sink_manager, |
| 18 const FrameSinkId& frame_sink_id, | 19 const FrameSinkId& frame_sink_id, |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 support_->RequestCopyOfSurface(std::move(request)); | 112 support_->RequestCopyOfSurface(std::move(request)); |
| 112 } | 113 } |
| 113 | 114 |
| 114 void GpuRootCompositorFrameSink::DisplayOutputSurfaceLost() { | 115 void GpuRootCompositorFrameSink::DisplayOutputSurfaceLost() { |
| 115 // TODO(staraz): Implement this. Client should hear about context/output | 116 // TODO(staraz): Implement this. Client should hear about context/output |
| 116 // surface lost. | 117 // surface lost. |
| 117 } | 118 } |
| 118 | 119 |
| 119 void GpuRootCompositorFrameSink::DisplayWillDrawAndSwap( | 120 void GpuRootCompositorFrameSink::DisplayWillDrawAndSwap( |
| 120 bool will_draw_and_swap, | 121 bool will_draw_and_swap, |
| 121 const cc::RenderPassList& render_pass) {} | 122 const cc::RenderPassList& render_pass) { |
| 123 hit_test_aggregator_.PostTaskAggregate(display_->CurrentSurfaceId()); |
| 124 } |
| 122 | 125 |
| 123 void GpuRootCompositorFrameSink::DisplayDidDrawAndSwap() {} | 126 void GpuRootCompositorFrameSink::DisplayDidDrawAndSwap() {} |
| 124 | 127 |
| 125 void GpuRootCompositorFrameSink::DidReceiveCompositorFrameAck( | 128 void GpuRootCompositorFrameSink::DidReceiveCompositorFrameAck( |
| 126 const std::vector<cc::ReturnedResource>& resources) { | 129 const std::vector<cc::ReturnedResource>& resources) { |
| 127 if (client_) | 130 if (client_) |
| 128 client_->DidReceiveCompositorFrameAck(resources); | 131 client_->DidReceiveCompositorFrameAck(resources); |
| 129 } | 132 } |
| 130 | 133 |
| 131 void GpuRootCompositorFrameSink::OnBeginFrame(const cc::BeginFrameArgs& args) { | 134 void GpuRootCompositorFrameSink::OnBeginFrame(const cc::BeginFrameArgs& args) { |
| 135 hit_test_aggregator_.Swap(); |
| 132 if (client_) | 136 if (client_) |
| 133 client_->OnBeginFrame(args); | 137 client_->OnBeginFrame(args); |
| 134 } | 138 } |
| 135 | 139 |
| 136 void GpuRootCompositorFrameSink::ReclaimResources( | 140 void GpuRootCompositorFrameSink::ReclaimResources( |
| 137 const std::vector<cc::ReturnedResource>& resources) { | 141 const std::vector<cc::ReturnedResource>& resources) { |
| 138 if (client_) | 142 if (client_) |
| 139 client_->ReclaimResources(resources); | 143 client_->ReclaimResources(resources); |
| 140 } | 144 } |
| 141 | 145 |
| 142 void GpuRootCompositorFrameSink::WillDrawSurface( | 146 void GpuRootCompositorFrameSink::WillDrawSurface( |
| 143 const LocalSurfaceId& local_surface_id, | 147 const LocalSurfaceId& local_surface_id, |
| 144 const gfx::Rect& damage_rect) {} | 148 const gfx::Rect& damage_rect) {} |
| 145 | 149 |
| 146 void GpuRootCompositorFrameSink::OnClientConnectionLost() { | 150 void GpuRootCompositorFrameSink::OnClientConnectionLost() { |
| 147 delegate_->OnClientConnectionLost(support_->frame_sink_id()); | 151 delegate_->OnClientConnectionLost(support_->frame_sink_id()); |
| 148 } | 152 } |
| 149 | 153 |
| 150 void GpuRootCompositorFrameSink::OnPrivateConnectionLost() { | 154 void GpuRootCompositorFrameSink::OnPrivateConnectionLost() { |
| 151 delegate_->OnPrivateConnectionLost(support_->frame_sink_id()); | 155 delegate_->OnPrivateConnectionLost(support_->frame_sink_id()); |
| 152 } | 156 } |
| 153 | 157 |
| 154 } // namespace viz | 158 } // namespace viz |
| OLD | NEW |