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/browser/android/synchronous_compositor_host.h" | 5 #include "content/browser/android/synchronous_compositor_host.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/containers/hash_tables.h" | 9 #include "base/containers/hash_tables.h" |
10 #include "base/memory/shared_memory.h" | 10 #include "base/memory/shared_memory.h" |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 } | 330 } |
331 | 331 |
332 void SynchronousCompositorHost::SetIsActive(bool is_active) { | 332 void SynchronousCompositorHost::SetIsActive(bool is_active) { |
333 if (is_active_ == is_active) | 333 if (is_active_ == is_active) |
334 return; | 334 return; |
335 is_active_ = is_active; | 335 is_active_ = is_active; |
336 UpdateNeedsBeginFrames(); | 336 UpdateNeedsBeginFrames(); |
337 SendAsyncCompositorStateIfNeeded(); | 337 SendAsyncCompositorStateIfNeeded(); |
338 } | 338 } |
339 | 339 |
| 340 void SynchronousCompositorHost::SynchronizeWithRenderer() { |
| 341 SyncCompositorCommonBrowserParams common_browser_params; |
| 342 PopulateCommonParams(&common_browser_params); |
| 343 SyncCompositorCommonRendererParams common_renderer_params; |
| 344 if (!sender_->Send(new SyncCompositorMsg_SynchronousUpdateState( |
| 345 routing_id_, common_browser_params, &common_renderer_params))) { |
| 346 return; |
| 347 } |
| 348 ProcessCommonParams(common_renderer_params); |
| 349 } |
| 350 |
340 void SynchronousCompositorHost::OnComputeScroll( | 351 void SynchronousCompositorHost::OnComputeScroll( |
341 base::TimeTicks animation_time) { | 352 base::TimeTicks animation_time) { |
342 if (!need_animate_scroll_) | 353 if (!need_animate_scroll_) |
343 return; | 354 return; |
344 need_animate_scroll_ = false; | 355 need_animate_scroll_ = false; |
345 | 356 |
346 SyncCompositorCommonBrowserParams common_browser_params; | 357 SyncCompositorCommonBrowserParams common_browser_params; |
347 PopulateCommonParams(&common_browser_params); | 358 PopulateCommonParams(&common_browser_params); |
348 SyncCompositorCommonRendererParams common_renderer_params; | 359 SyncCompositorCommonRendererParams common_renderer_params; |
349 sender_->Send(new SyncCompositorMsg_ComputeScroll( | 360 sender_->Send(new SyncCompositorMsg_ComputeScroll( |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 params.scrollable_size, params.page_scale_factor, | 461 params.scrollable_size, params.page_scale_factor, |
451 params.min_page_scale_factor, params.max_page_scale_factor); | 462 params.min_page_scale_factor, params.max_page_scale_factor); |
452 } | 463 } |
453 } | 464 } |
454 | 465 |
455 void SynchronousCompositorHost::UpdateNeedsBeginFrames() { | 466 void SynchronousCompositorHost::UpdateNeedsBeginFrames() { |
456 rwhva_->OnSetNeedsBeginFrames(is_active_ && need_begin_frame_); | 467 rwhva_->OnSetNeedsBeginFrames(is_active_ && need_begin_frame_); |
457 } | 468 } |
458 | 469 |
459 } // namespace content | 470 } // namespace content |
OLD | NEW |