| 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/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 | 308 |
| 309 void SynchronousCompositorHost::ReturnResources( | 309 void SynchronousCompositorHost::ReturnResources( |
| 310 uint32_t output_surface_id, | 310 uint32_t output_surface_id, |
| 311 const cc::CompositorFrameAck& frame_ack) { | 311 const cc::CompositorFrameAck& frame_ack) { |
| 312 DCHECK(!frame_ack.resources.empty()); | 312 DCHECK(!frame_ack.resources.empty()); |
| 313 sender_->Send(new SyncCompositorMsg_ReclaimResources( | 313 sender_->Send(new SyncCompositorMsg_ReclaimResources( |
| 314 routing_id_, output_surface_id, frame_ack)); | 314 routing_id_, output_surface_id, frame_ack)); |
| 315 } | 315 } |
| 316 | 316 |
| 317 void SynchronousCompositorHost::SetMemoryPolicy(size_t bytes_limit) { | 317 void SynchronousCompositorHost::SetMemoryPolicy(size_t bytes_limit) { |
| 318 if (bytes_limit_ == bytes_limit) | 318 sender_->Send( |
| 319 return; | 319 new SyncCompositorMsg_SetMemoryPolicy(routing_id_, bytes_limit)); |
| 320 | 320 bytes_limit_ = bytes_limit; |
| 321 if (sender_->Send( | |
| 322 new SyncCompositorMsg_SetMemoryPolicy(routing_id_, bytes_limit))) { | |
| 323 bytes_limit_ = bytes_limit; | |
| 324 } | |
| 325 } | 321 } |
| 326 | 322 |
| 327 void SynchronousCompositorHost::DidChangeRootLayerScrollOffset( | 323 void SynchronousCompositorHost::DidChangeRootLayerScrollOffset( |
| 328 const gfx::ScrollOffset& root_offset) { | 324 const gfx::ScrollOffset& root_offset) { |
| 329 if (root_scroll_offset_ == root_offset) | 325 if (root_scroll_offset_ == root_offset) |
| 330 return; | 326 return; |
| 331 root_scroll_offset_ = root_offset; | 327 root_scroll_offset_ = root_offset; |
| 332 sender_->Send( | 328 sender_->Send( |
| 333 new SyncCompositorMsg_SetScroll(routing_id_, root_scroll_offset_)); | 329 new SyncCompositorMsg_SetScroll(routing_id_, root_scroll_offset_)); |
| 334 } | 330 } |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 481 params.scrollable_size, params.page_scale_factor, | 477 params.scrollable_size, params.page_scale_factor, |
| 482 params.min_page_scale_factor, params.max_page_scale_factor); | 478 params.min_page_scale_factor, params.max_page_scale_factor); |
| 483 } | 479 } |
| 484 } | 480 } |
| 485 | 481 |
| 486 void SynchronousCompositorHost::UpdateNeedsBeginFrames() { | 482 void SynchronousCompositorHost::UpdateNeedsBeginFrames() { |
| 487 rwhva_->OnSetNeedsBeginFrames(is_active_ && need_begin_frame_); | 483 rwhva_->OnSetNeedsBeginFrames(is_active_ && need_begin_frame_); |
| 488 } | 484 } |
| 489 | 485 |
| 490 } // namespace content | 486 } // namespace content |
| OLD | NEW |