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/layer_tree_host_impl.h" | 5 #include "cc/trees/layer_tree_host_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 scoped_refptr<DelayBasedTimeSource> time_source) { | 138 scoped_refptr<DelayBasedTimeSource> time_source) { |
139 return make_scoped_ptr( | 139 return make_scoped_ptr( |
140 new LayerTreeHostImplTimeSourceAdapter(layer_tree_host_impl, | 140 new LayerTreeHostImplTimeSourceAdapter(layer_tree_host_impl, |
141 time_source)); | 141 time_source)); |
142 } | 142 } |
143 virtual ~LayerTreeHostImplTimeSourceAdapter() { | 143 virtual ~LayerTreeHostImplTimeSourceAdapter() { |
144 time_source_->SetClient(NULL); | 144 time_source_->SetClient(NULL); |
145 time_source_->SetActive(false); | 145 time_source_->SetActive(false); |
146 } | 146 } |
147 | 147 |
148 virtual void OnTimerTick() OVERRIDE { | 148 virtual void OnTimerTick() override { |
149 // In single threaded mode we attempt to simulate changing the current | 149 // In single threaded mode we attempt to simulate changing the current |
150 // thread by maintaining a fake thread id. When we switch from one | 150 // thread by maintaining a fake thread id. When we switch from one |
151 // thread to another, we construct DebugScopedSetXXXThread objects that | 151 // thread to another, we construct DebugScopedSetXXXThread objects that |
152 // update the thread id. This lets DCHECKS that ensure we're on the | 152 // update the thread id. This lets DCHECKS that ensure we're on the |
153 // right thread to work correctly in single threaded mode. The problem | 153 // right thread to work correctly in single threaded mode. The problem |
154 // here is that the timer tasks are run via the message loop, and when | 154 // here is that the timer tasks are run via the message loop, and when |
155 // they run, we've had no chance to construct a DebugScopedSetXXXThread | 155 // they run, we've had no chance to construct a DebugScopedSetXXXThread |
156 // object. The result is that we report that we're running on the main | 156 // object. The result is that we report that we're running on the main |
157 // thread. In multi-threaded mode, this timer is run on the compositor | 157 // thread. In multi-threaded mode, this timer is run on the compositor |
158 // thread, so to keep this consistent in single-threaded mode, we'll | 158 // thread, so to keep this consistent in single-threaded mode, we'll |
(...skipping 3216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3375 } | 3375 } |
3376 | 3376 |
3377 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { | 3377 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { |
3378 std::vector<PictureLayerImpl*>::iterator it = | 3378 std::vector<PictureLayerImpl*>::iterator it = |
3379 std::find(picture_layers_.begin(), picture_layers_.end(), layer); | 3379 std::find(picture_layers_.begin(), picture_layers_.end(), layer); |
3380 DCHECK(it != picture_layers_.end()); | 3380 DCHECK(it != picture_layers_.end()); |
3381 picture_layers_.erase(it); | 3381 picture_layers_.erase(it); |
3382 } | 3382 } |
3383 | 3383 |
3384 } // namespace cc | 3384 } // namespace cc |
OLD | NEW |