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

Side by Side Diff: content/browser/android/in_process/synchronous_compositor_impl.cc

Issue 1620053002: sync compositor: Merge input path with chrome (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tests Created 4 years, 9 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/browser/android/in_process/synchronous_compositor_impl.h" 5 #include "content/browser/android/in_process/synchronous_compositor_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 DCHECK(registered_with_client_); 272 DCHECK(registered_with_client_);
273 } 273 }
274 if (begin_frame_source_) 274 if (begin_frame_source_)
275 begin_frame_source_->BeginFrame(args); 275 begin_frame_source_->BeginFrame(args);
276 } 276 }
277 277
278 void SynchronousCompositorImpl::UpdateNeedsBeginFrames() { 278 void SynchronousCompositorImpl::UpdateNeedsBeginFrames() {
279 rwhva_->OnSetNeedsBeginFrames(is_active_ && renderer_needs_begin_frames_); 279 rwhva_->OnSetNeedsBeginFrames(is_active_ && renderer_needs_begin_frames_);
280 } 280 }
281 281
282 void SynchronousCompositorImpl::DidOverscroll( 282 void SynchronousCompositorImpl::DidOverscrollInProc(
283 const DidOverscrollParams& params) { 283 const DidOverscrollParams& params) {
284 if (registered_with_client_) { 284 if (registered_with_client_) {
285 compositor_client_->DidOverscroll(params.accumulated_overscroll, 285 compositor_client_->DidOverscroll(params.accumulated_overscroll,
286 params.latest_overscroll_delta, 286 params.latest_overscroll_delta,
287 params.current_fling_velocity); 287 params.current_fling_velocity);
288 } 288 }
289 } 289 }
290 290
291 void SynchronousCompositorImpl::DidStopFlinging() { 291 void SynchronousCompositorImpl::DidStopFlinging() {
292 // It's important that the fling-end notification follow the same path as it 292 // It's important that the fling-end notification follow the same path as it
293 // takes on other platforms (using an IPC). This ensures consistent 293 // takes on other platforms (using an IPC). This ensures consistent
294 // bookkeeping at all stages of the input pipeline. 294 // bookkeeping at all stages of the input pipeline.
295 rwhva_->GetRenderWidgetHost()->GetProcess()->OnMessageReceived( 295 rwhva_->GetRenderWidgetHost()->GetProcess()->OnMessageReceived(
296 InputHostMsg_DidStopFlinging(routing_id_)); 296 InputHostMsg_DidStopFlinging(routing_id_));
297 } 297 }
298 298
299 InputEventAckState SynchronousCompositorImpl::HandleInputEvent( 299 InputEventAckState SynchronousCompositorImpl::HandleInputEvent(
300 const blink::WebInputEvent& input_event) { 300 const blink::WebInputEvent& input_event) {
301 DCHECK(CalledOnValidThread()); 301 DCHECK(CalledOnValidThread());
302 return g_factory.Get().synchronous_input_event_filter()->HandleInputEvent( 302 return g_factory.Get().synchronous_input_event_filter()->HandleInputEvent(
303 routing_id_, input_event); 303 routing_id_, input_event);
304 } 304 }
305 305
306 void SynchronousCompositorImpl::DidOverscroll(
307 const DidOverscrollParams& params) {
308 // Intentional No-op.
tdresser 2016/02/29 16:42:49 Comment why this should be a no-op.
boliu 2016/02/29 21:04:40 Actually should really a NOTREACHED. Done.
309 }
310
306 bool SynchronousCompositorImpl::OnMessageReceived(const IPC::Message& message) { 311 bool SynchronousCompositorImpl::OnMessageReceived(const IPC::Message& message) {
307 NOTREACHED(); 312 NOTREACHED();
308 return false; 313 return false;
309 } 314 }
310 315
311 void SynchronousCompositorImpl::DidBecomeCurrent() { 316 void SynchronousCompositorImpl::DidBecomeCurrent() {
312 // This is single process synchronous compositor. There is only one 317 // This is single process synchronous compositor. There is only one
313 // RenderViewHost. DidBecomeCurrent could be called before the renderer 318 // RenderViewHost. DidBecomeCurrent could be called before the renderer
314 // objects are initialized. So hold off calling DidBecomeCurrent until 319 // objects are initialized. So hold off calling DidBecomeCurrent until
315 // RegisterWithClient. Intentional no-op here. 320 // RegisterWithClient. Intentional no-op here.
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 } 364 }
360 } 365 }
361 366
362 // Not using base::NonThreadSafe as we want to enforce a more exacting threading 367 // Not using base::NonThreadSafe as we want to enforce a more exacting threading
363 // requirement: SynchronousCompositorImpl() must only be used on the UI thread. 368 // requirement: SynchronousCompositorImpl() must only be used on the UI thread.
364 bool SynchronousCompositorImpl::CalledOnValidThread() const { 369 bool SynchronousCompositorImpl::CalledOnValidThread() const {
365 return BrowserThread::CurrentlyOn(BrowserThread::UI); 370 return BrowserThread::CurrentlyOn(BrowserThread::UI);
366 } 371 }
367 372
368 } // namespace content 373 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698