| 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 "cc/ipc/cc_param_traits.h" | 10 #include "cc/ipc/cc_param_traits.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 min_page_scale_factor_(0.f), | 40 min_page_scale_factor_(0.f), |
| 41 max_page_scale_factor_(0.f), | 41 max_page_scale_factor_(0.f), |
| 42 need_animate_scroll_(false), | 42 need_animate_scroll_(false), |
| 43 need_invalidate_count_(0u), | 43 need_invalidate_count_(0u), |
| 44 did_activate_pending_tree_count_(0u) { | 44 did_activate_pending_tree_count_(0u) { |
| 45 DCHECK(input_handler_proxy_); | 45 DCHECK(input_handler_proxy_); |
| 46 input_handler_proxy_->SetOnlySynchronouslyAnimateRootFlings(this); | 46 input_handler_proxy_->SetOnlySynchronouslyAnimateRootFlings(this); |
| 47 } | 47 } |
| 48 | 48 |
| 49 SynchronousCompositorProxy::~SynchronousCompositorProxy() { | 49 SynchronousCompositorProxy::~SynchronousCompositorProxy() { |
| 50 SetOutputSurface(nullptr); | 50 // The OutputSurface is destroyed/removed by the compositor before shutting |
| 51 // down everything. |
| 52 DCHECK_EQ(output_surface_, nullptr); |
| 51 input_handler_proxy_->SetOnlySynchronouslyAnimateRootFlings(nullptr); | 53 input_handler_proxy_->SetOnlySynchronouslyAnimateRootFlings(nullptr); |
| 52 } | 54 } |
| 53 | 55 |
| 54 void SynchronousCompositorProxy::SetOutputSurface( | 56 void SynchronousCompositorProxy::SetOutputSurface( |
| 55 SynchronousCompositorOutputSurface* output_surface) { | 57 SynchronousCompositorOutputSurface* output_surface) { |
| 56 DCHECK_NE(output_surface_, output_surface); | 58 DCHECK_NE(output_surface_, output_surface); |
| 57 if (output_surface_) { | 59 if (output_surface_) { |
| 58 output_surface_->SetSyncClient(nullptr); | 60 output_surface_->SetSyncClient(nullptr); |
| 59 } | 61 } |
| 60 output_surface_ = output_surface; | 62 output_surface_ = output_surface; |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 | 329 |
| 328 void SynchronousCompositorProxy::SetScroll( | 330 void SynchronousCompositorProxy::SetScroll( |
| 329 const gfx::ScrollOffset& new_total_scroll_offset) { | 331 const gfx::ScrollOffset& new_total_scroll_offset) { |
| 330 if (total_scroll_offset_ == new_total_scroll_offset) | 332 if (total_scroll_offset_ == new_total_scroll_offset) |
| 331 return; | 333 return; |
| 332 total_scroll_offset_ = new_total_scroll_offset; | 334 total_scroll_offset_ = new_total_scroll_offset; |
| 333 input_handler_proxy_->SynchronouslySetRootScrollOffset(total_scroll_offset_); | 335 input_handler_proxy_->SynchronouslySetRootScrollOffset(total_scroll_offset_); |
| 334 } | 336 } |
| 335 | 337 |
| 336 } // namespace content | 338 } // namespace content |
| OLD | NEW |