| 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/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/memory/shared_memory.h" | 9 #include "base/memory/shared_memory.h" |
| 10 #include "content/common/android/sync_compositor_messages.h" | 10 #include "content/common/android/sync_compositor_messages.h" |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 params->min_page_scale_factor = min_page_scale_factor_; | 154 params->min_page_scale_factor = min_page_scale_factor_; |
| 155 params->max_page_scale_factor = max_page_scale_factor_; | 155 params->max_page_scale_factor = max_page_scale_factor_; |
| 156 params->need_animate_scroll = need_animate_scroll_; | 156 params->need_animate_scroll = need_animate_scroll_; |
| 157 params->need_invalidate_count = need_invalidate_count_; | 157 params->need_invalidate_count = need_invalidate_count_; |
| 158 params->need_begin_frame = need_begin_frame_; | 158 params->need_begin_frame = need_begin_frame_; |
| 159 params->did_activate_pending_tree_count = did_activate_pending_tree_count_; | 159 params->did_activate_pending_tree_count = did_activate_pending_tree_count_; |
| 160 } | 160 } |
| 161 | 161 |
| 162 void SynchronousCompositorProxy::OnMessageReceived( | 162 void SynchronousCompositorProxy::OnMessageReceived( |
| 163 const IPC::Message& message) { | 163 const IPC::Message& message) { |
| 164 if (output_surface_ && output_surface_->OnMessageReceived(message)) |
| 165 return; |
| 166 |
| 164 IPC_BEGIN_MESSAGE_MAP(SynchronousCompositorProxy, message) | 167 IPC_BEGIN_MESSAGE_MAP(SynchronousCompositorProxy, message) |
| 165 IPC_MESSAGE_HANDLER(SyncCompositorMsg_HandleInputEvent, HandleInputEvent) | 168 IPC_MESSAGE_HANDLER(SyncCompositorMsg_HandleInputEvent, HandleInputEvent) |
| 166 IPC_MESSAGE_HANDLER(SyncCompositorMsg_BeginFrame, BeginFrame) | 169 IPC_MESSAGE_HANDLER(SyncCompositorMsg_BeginFrame, BeginFrame) |
| 167 IPC_MESSAGE_HANDLER(SyncCompositorMsg_ComputeScroll, OnComputeScroll) | 170 IPC_MESSAGE_HANDLER(SyncCompositorMsg_ComputeScroll, OnComputeScroll) |
| 168 IPC_MESSAGE_HANDLER_DELAY_REPLY(SyncCompositorMsg_DemandDrawHw, | 171 IPC_MESSAGE_HANDLER_DELAY_REPLY(SyncCompositorMsg_DemandDrawHw, |
| 169 DemandDrawHw) | 172 DemandDrawHw) |
| 170 IPC_MESSAGE_HANDLER(SyncCompositorMsg_SetSharedMemory, SetSharedMemory) | 173 IPC_MESSAGE_HANDLER(SyncCompositorMsg_SetSharedMemory, SetSharedMemory) |
| 171 IPC_MESSAGE_HANDLER(SyncCompositorMsg_ZeroSharedMemory, ZeroSharedMemory) | 174 IPC_MESSAGE_HANDLER(SyncCompositorMsg_ZeroSharedMemory, ZeroSharedMemory) |
| 172 IPC_MESSAGE_HANDLER_DELAY_REPLY(SyncCompositorMsg_DemandDrawSw, | 175 IPC_MESSAGE_HANDLER_DELAY_REPLY(SyncCompositorMsg_DemandDrawSw, |
| 173 DemandDrawSw) | 176 DemandDrawSw) |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 output_surface_->SetMemoryPolicy(bytes_limit_); | 417 output_surface_->SetMemoryPolicy(bytes_limit_); |
| 415 } | 418 } |
| 416 if (common_params.update_root_scroll_offset && | 419 if (common_params.update_root_scroll_offset && |
| 417 total_scroll_offset_ != common_params.root_scroll_offset) { | 420 total_scroll_offset_ != common_params.root_scroll_offset) { |
| 418 total_scroll_offset_ = common_params.root_scroll_offset; | 421 total_scroll_offset_ = common_params.root_scroll_offset; |
| 419 input_handler_proxy_->SynchronouslySetRootScrollOffset( | 422 input_handler_proxy_->SynchronouslySetRootScrollOffset( |
| 420 total_scroll_offset_); | 423 total_scroll_offset_); |
| 421 } | 424 } |
| 422 begin_frame_source_->SetBeginFrameSourcePaused( | 425 begin_frame_source_->SetBeginFrameSourcePaused( |
| 423 common_params.begin_frame_source_paused); | 426 common_params.begin_frame_source_paused); |
| 424 if (output_surface_ && !common_params.ack.resources.empty()) { | |
| 425 output_surface_->ReturnResources( | |
| 426 common_params.output_surface_id_for_returned_resources, | |
| 427 common_params.ack); | |
| 428 } | |
| 429 } | 427 } |
| 430 | 428 |
| 431 } // namespace content | 429 } // namespace content |
| OLD | NEW |