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); |
boliu
2016/06/24 23:44:45
alternative is to remove this DCHECK, since it's c
| |
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; |
61 if (output_surface_) { | 63 if (output_surface_) { |
62 output_surface_->SetSyncClient(this); | 64 output_surface_->SetSyncClient(this); |
63 } | 65 } |
64 } | 66 } |
65 | 67 |
66 void SynchronousCompositorProxy::SetNeedsSynchronousAnimateInput() { | 68 void SynchronousCompositorProxy::SetNeedsSynchronousAnimateInput() { |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
330 | 332 |
331 void SynchronousCompositorProxy::SetScroll( | 333 void SynchronousCompositorProxy::SetScroll( |
332 const gfx::ScrollOffset& new_total_scroll_offset) { | 334 const gfx::ScrollOffset& new_total_scroll_offset) { |
333 if (total_scroll_offset_ == new_total_scroll_offset) | 335 if (total_scroll_offset_ == new_total_scroll_offset) |
334 return; | 336 return; |
335 total_scroll_offset_ = new_total_scroll_offset; | 337 total_scroll_offset_ = new_total_scroll_offset; |
336 input_handler_proxy_->SynchronouslySetRootScrollOffset(total_scroll_offset_); | 338 input_handler_proxy_->SynchronouslySetRootScrollOffset(total_scroll_offset_); |
337 } | 339 } |
338 | 340 |
339 } // namespace content | 341 } // namespace content |
OLD | NEW |