| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/renderer/android/synchronous_compositor_proxy.h" | 5 #include "content/renderer/android/synchronous_compositor_proxy.h" |
| 6 | 6 |
| 7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/memory/shared_memory.h" | 8 #include "base/memory/shared_memory.h" |
| 9 #include "content/common/android/sync_compositor_messages.h" | 9 #include "content/common/android/sync_compositor_messages.h" |
| 10 #include "content/common/cc_messages.h" | 10 #include "content/common/cc_messages.h" |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 DCHECK(!(hardware_draw_reply_ && software_draw_reply_)); | 350 DCHECK(!(hardware_draw_reply_ && software_draw_reply_)); |
| 351 if (hardware_draw_reply_) { | 351 if (hardware_draw_reply_) { |
| 352 SwapBuffersHw(frame); | 352 SwapBuffersHw(frame); |
| 353 } else if (software_draw_reply_) { | 353 } else if (software_draw_reply_) { |
| 354 SwapBuffersSw(frame); | 354 SwapBuffersSw(frame); |
| 355 } | 355 } |
| 356 } | 356 } |
| 357 | 357 |
| 358 void SynchronousCompositorProxy::OnComputeScroll( | 358 void SynchronousCompositorProxy::OnComputeScroll( |
| 359 const SyncCompositorCommonBrowserParams& common_params, | 359 const SyncCompositorCommonBrowserParams& common_params, |
| 360 base::TimeTicks animation_time, | 360 base::TimeTicks animation_time) { |
| 361 SyncCompositorCommonRendererParams* common_renderer_params) { | |
| 362 DCHECK(!inside_receive_); | |
| 363 base::AutoReset<bool> scoped_inside_receive(&inside_receive_, true); | |
| 364 | |
| 365 ProcessCommonParams(common_params); | 361 ProcessCommonParams(common_params); |
| 366 if (need_animate_scroll_) { | 362 if (need_animate_scroll_) { |
| 367 need_animate_scroll_ = false; | 363 need_animate_scroll_ = false; |
| 368 input_handler_proxy_->SynchronouslyAnimate(animation_time); | 364 input_handler_proxy_->SynchronouslyAnimate(animation_time); |
| 369 } | 365 } |
| 370 PopulateCommonParams(common_renderer_params); | |
| 371 } | 366 } |
| 372 | 367 |
| 373 void SynchronousCompositorProxy::DidOverscroll( | 368 void SynchronousCompositorProxy::DidOverscroll( |
| 374 const DidOverscrollParams& did_overscroll_params) { | 369 const DidOverscrollParams& did_overscroll_params) { |
| 375 SyncCompositorCommonRendererParams params; | 370 SyncCompositorCommonRendererParams params; |
| 376 PopulateCommonParams(¶ms); | 371 PopulateCommonParams(¶ms); |
| 377 Send(new SyncCompositorHostMsg_OverScroll(routing_id_, params, | 372 Send(new SyncCompositorHostMsg_OverScroll(routing_id_, params, |
| 378 did_overscroll_params)); | 373 did_overscroll_params)); |
| 379 } | 374 } |
| 380 | 375 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 391 total_scroll_offset_); | 386 total_scroll_offset_); |
| 392 } | 387 } |
| 393 begin_frame_source_->SetBeginFrameSourcePaused( | 388 begin_frame_source_->SetBeginFrameSourcePaused( |
| 394 common_params.begin_frame_source_paused); | 389 common_params.begin_frame_source_paused); |
| 395 if (!common_params.ack.resources.empty()) { | 390 if (!common_params.ack.resources.empty()) { |
| 396 output_surface_->ReturnResources(common_params.ack); | 391 output_surface_->ReturnResources(common_params.ack); |
| 397 } | 392 } |
| 398 } | 393 } |
| 399 | 394 |
| 400 } // namespace content | 395 } // namespace content |
| OLD | NEW |