Chromium Code Reviews| 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 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 283 // by the main thread, so the active tree needs to be updated as if these sent | 283 // by the main thread, so the active tree needs to be updated as if these sent |
| 284 // values were applied and committed. | 284 // values were applied and committed. |
| 285 if (CommitEarlyOutHandledCommit(reason)) { | 285 if (CommitEarlyOutHandledCommit(reason)) { |
| 286 active_tree_->ApplySentScrollAndScaleDeltasFromAbortedCommit(); | 286 active_tree_->ApplySentScrollAndScaleDeltasFromAbortedCommit(); |
| 287 active_tree_->ResetContentsTexturesPurged(); | 287 active_tree_->ResetContentsTexturesPurged(); |
| 288 } | 288 } |
| 289 } | 289 } |
| 290 | 290 |
| 291 void LayerTreeHostImpl::BeginCommit() { | 291 void LayerTreeHostImpl::BeginCommit() { |
| 292 TRACE_EVENT0("cc", "LayerTreeHostImpl::BeginCommit"); | 292 TRACE_EVENT0("cc", "LayerTreeHostImpl::BeginCommit"); |
| 293 DCHECK(output_surface_); | |
|
danakj
2015/01/08 21:04:34
nit: no need to dcheck, we'll crash if it's null o
| |
| 294 output_surface_->ForceReclaimResources(); | |
| 293 | 295 |
| 294 if (UsePendingTreeForSync()) | 296 if (UsePendingTreeForSync()) |
| 295 CreatePendingTree(); | 297 CreatePendingTree(); |
| 296 } | 298 } |
| 297 | 299 |
| 298 void LayerTreeHostImpl::CommitComplete() { | 300 void LayerTreeHostImpl::CommitComplete() { |
| 299 TRACE_EVENT0("cc", "LayerTreeHostImpl::CommitComplete"); | 301 TRACE_EVENT0("cc", "LayerTreeHostImpl::CommitComplete"); |
| 300 | 302 |
| 301 if (pending_tree_) | 303 if (pending_tree_) |
| 302 pending_tree_->ApplyScrollDeltasSinceBeginMainFrame(); | 304 pending_tree_->ApplyScrollDeltasSinceBeginMainFrame(); |
| (...skipping 3174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3477 } | 3479 } |
| 3478 | 3480 |
| 3479 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { | 3481 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { |
| 3480 std::vector<PictureLayerImpl*>::iterator it = | 3482 std::vector<PictureLayerImpl*>::iterator it = |
| 3481 std::find(picture_layers_.begin(), picture_layers_.end(), layer); | 3483 std::find(picture_layers_.begin(), picture_layers_.end(), layer); |
| 3482 DCHECK(it != picture_layers_.end()); | 3484 DCHECK(it != picture_layers_.end()); |
| 3483 picture_layers_.erase(it); | 3485 picture_layers_.erase(it); |
| 3484 } | 3486 } |
| 3485 | 3487 |
| 3486 } // namespace cc | 3488 } // namespace cc |
| OLD | NEW |