| 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 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 | 293 |
| 294 // Ensure all textures are returned so partial texture updates can happen |
| 295 // during the commit. Impl-side-painting doesn't upload during commits, so |
| 296 // is unaffected. |
| 297 if (!settings_.impl_side_painting) |
| 298 output_surface_->ForceReclaimResources(); |
| 299 |
| 294 if (UsePendingTreeForSync()) | 300 if (UsePendingTreeForSync()) |
| 295 CreatePendingTree(); | 301 CreatePendingTree(); |
| 296 } | 302 } |
| 297 | 303 |
| 298 void LayerTreeHostImpl::CommitComplete() { | 304 void LayerTreeHostImpl::CommitComplete() { |
| 299 TRACE_EVENT0("cc", "LayerTreeHostImpl::CommitComplete"); | 305 TRACE_EVENT0("cc", "LayerTreeHostImpl::CommitComplete"); |
| 300 | 306 |
| 301 if (pending_tree_) | 307 if (pending_tree_) |
| 302 pending_tree_->ApplyScrollDeltasSinceBeginMainFrame(); | 308 pending_tree_->ApplyScrollDeltasSinceBeginMainFrame(); |
| 303 sync_tree()->set_needs_update_draw_properties(); | 309 sync_tree()->set_needs_update_draw_properties(); |
| (...skipping 3173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3477 } | 3483 } |
| 3478 | 3484 |
| 3479 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { | 3485 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { |
| 3480 std::vector<PictureLayerImpl*>::iterator it = | 3486 std::vector<PictureLayerImpl*>::iterator it = |
| 3481 std::find(picture_layers_.begin(), picture_layers_.end(), layer); | 3487 std::find(picture_layers_.begin(), picture_layers_.end(), layer); |
| 3482 DCHECK(it != picture_layers_.end()); | 3488 DCHECK(it != picture_layers_.end()); |
| 3483 picture_layers_.erase(it); | 3489 picture_layers_.erase(it); |
| 3484 } | 3490 } |
| 3485 | 3491 |
| 3486 } // namespace cc | 3492 } // namespace cc |
| OLD | NEW |