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

Side by Side Diff: components/viz/frame_sinks/gpu_root_compositor_frame_sink.cc

Issue 2908783002: WIP Hittest Component.
Patch Set: reviewer comments Created 3 years, 6 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 unified diff | Download patch
OLDNEW
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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 support_->RequestCopyOfSurface(std::move(request)); 107 support_->RequestCopyOfSurface(std::move(request));
108 } 108 }
109 109
110 void GpuRootCompositorFrameSink::DisplayOutputSurfaceLost() { 110 void GpuRootCompositorFrameSink::DisplayOutputSurfaceLost() {
111 // TODO(staraz): Implement this. Client should hear about context/output 111 // TODO(staraz): Implement this. Client should hear about context/output
112 // surface lost. 112 // surface lost.
113 } 113 }
114 114
115 void GpuRootCompositorFrameSink::DisplayWillDrawAndSwap( 115 void GpuRootCompositorFrameSink::DisplayWillDrawAndSwap(
116 bool will_draw_and_swap, 116 bool will_draw_and_swap,
117 const cc::RenderPassList& render_pass) {} 117 const cc::RenderPassList& render_pass) {
118 hit_test_aggregator_.Aggregate(display_->CurrentSurfaceId());
119 }
118 120
119 void GpuRootCompositorFrameSink::DisplayDidDrawAndSwap() {} 121 void GpuRootCompositorFrameSink::DisplayDidDrawAndSwap() {}
120 122
121 void GpuRootCompositorFrameSink::DidReceiveCompositorFrameAck( 123 void GpuRootCompositorFrameSink::DidReceiveCompositorFrameAck(
122 const cc::ReturnedResourceArray& resources) { 124 const cc::ReturnedResourceArray& resources) {
123 if (client_) 125 if (client_)
124 client_->DidReceiveCompositorFrameAck(resources); 126 client_->DidReceiveCompositorFrameAck(resources);
125 } 127 }
126 128
127 void GpuRootCompositorFrameSink::OnBeginFrame(const cc::BeginFrameArgs& args) { 129 void GpuRootCompositorFrameSink::OnBeginFrame(const cc::BeginFrameArgs& args) {
130 hit_test_aggregator_.Swap();
128 if (client_) 131 if (client_)
129 client_->OnBeginFrame(args); 132 client_->OnBeginFrame(args);
130 } 133 }
131 134
132 void GpuRootCompositorFrameSink::ReclaimResources( 135 void GpuRootCompositorFrameSink::ReclaimResources(
133 const cc::ReturnedResourceArray& resources) { 136 const cc::ReturnedResourceArray& resources) {
134 if (client_) 137 if (client_)
135 client_->ReclaimResources(resources); 138 client_->ReclaimResources(resources);
136 } 139 }
137 140
138 void GpuRootCompositorFrameSink::WillDrawSurface( 141 void GpuRootCompositorFrameSink::WillDrawSurface(
139 const cc::LocalSurfaceId& local_surface_id, 142 const cc::LocalSurfaceId& local_surface_id,
140 const gfx::Rect& damage_rect) {} 143 const gfx::Rect& damage_rect) {}
141 144
142 void GpuRootCompositorFrameSink::OnClientConnectionLost() { 145 void GpuRootCompositorFrameSink::OnClientConnectionLost() {
143 client_connection_lost_ = true; 146 client_connection_lost_ = true;
144 // Request destruction of |this| only if both connections are lost. 147 // Request destruction of |this| only if both connections are lost.
145 delegate_->OnClientConnectionLost(support_->frame_sink_id(), 148 delegate_->OnClientConnectionLost(support_->frame_sink_id(),
146 private_connection_lost_); 149 private_connection_lost_);
147 } 150 }
148 151
149 void GpuRootCompositorFrameSink::OnPrivateConnectionLost() { 152 void GpuRootCompositorFrameSink::OnPrivateConnectionLost() {
150 private_connection_lost_ = true; 153 private_connection_lost_ = true;
151 // Request destruction of |this| only if both connections are lost. 154 // Request destruction of |this| only if both connections are lost.
152 delegate_->OnPrivateConnectionLost(support_->frame_sink_id(), 155 delegate_->OnPrivateConnectionLost(support_->frame_sink_id(),
153 client_connection_lost_); 156 client_connection_lost_);
154 } 157 }
155 158
156 } // namespace viz 159 } // namespace viz
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698