| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 "cc/trees/single_thread_proxy.h" | 5 #include "cc/trees/single_thread_proxy.h" |
| 6 | 6 |
| 7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "base/profiler/scoped_tracker.h" | 9 #include "base/profiler/scoped_tracker.h" |
| 10 #include "base/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 layer_tree_host_impl_ = layer_tree_host_->CreateLayerTreeHostImpl(this); | 101 layer_tree_host_impl_ = layer_tree_host_->CreateLayerTreeHostImpl(this); |
| 102 } | 102 } |
| 103 | 103 |
| 104 SingleThreadProxy::~SingleThreadProxy() { | 104 SingleThreadProxy::~SingleThreadProxy() { |
| 105 TRACE_EVENT0("cc", "SingleThreadProxy::~SingleThreadProxy"); | 105 TRACE_EVENT0("cc", "SingleThreadProxy::~SingleThreadProxy"); |
| 106 DCHECK(task_runner_provider_->IsMainThread()); | 106 DCHECK(task_runner_provider_->IsMainThread()); |
| 107 // Make sure Stop() got called or never Started. | 107 // Make sure Stop() got called or never Started. |
| 108 DCHECK(!layer_tree_host_impl_); | 108 DCHECK(!layer_tree_host_impl_); |
| 109 } | 109 } |
| 110 | 110 |
| 111 void SingleThreadProxy::FinishAllRendering() { | |
| 112 TRACE_EVENT0("cc", "SingleThreadProxy::FinishAllRendering"); | |
| 113 DCHECK(task_runner_provider_->IsMainThread()); | |
| 114 { | |
| 115 DebugScopedSetImplThread impl(task_runner_provider_); | |
| 116 layer_tree_host_impl_->FinishAllRendering(); | |
| 117 } | |
| 118 } | |
| 119 | |
| 120 bool SingleThreadProxy::IsStarted() const { | 111 bool SingleThreadProxy::IsStarted() const { |
| 121 DCHECK(task_runner_provider_->IsMainThread()); | 112 DCHECK(task_runner_provider_->IsMainThread()); |
| 122 return !!layer_tree_host_impl_; | 113 return !!layer_tree_host_impl_; |
| 123 } | 114 } |
| 124 | 115 |
| 125 bool SingleThreadProxy::CommitToActiveTree() const { | 116 bool SingleThreadProxy::CommitToActiveTree() const { |
| 126 // With SingleThreadProxy we skip the pending tree and commit directly to the | 117 // With SingleThreadProxy we skip the pending tree and commit directly to the |
| 127 // active tree. | 118 // active tree. |
| 128 return true; | 119 return true; |
| 129 } | 120 } |
| (...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 886 void SingleThreadProxy::DidFinishImplFrame() { | 877 void SingleThreadProxy::DidFinishImplFrame() { |
| 887 layer_tree_host_impl_->DidFinishImplFrame(); | 878 layer_tree_host_impl_->DidFinishImplFrame(); |
| 888 #if DCHECK_IS_ON() | 879 #if DCHECK_IS_ON() |
| 889 DCHECK(inside_impl_frame_) | 880 DCHECK(inside_impl_frame_) |
| 890 << "DidFinishImplFrame called while not inside an impl frame!"; | 881 << "DidFinishImplFrame called while not inside an impl frame!"; |
| 891 inside_impl_frame_ = false; | 882 inside_impl_frame_ = false; |
| 892 #endif | 883 #endif |
| 893 } | 884 } |
| 894 | 885 |
| 895 } // namespace cc | 886 } // namespace cc |
| OLD | NEW |