| 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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 // values were applied and committed. | 286 // values were applied and committed. |
| 287 if (CommitEarlyOutHandledCommit(reason)) { | 287 if (CommitEarlyOutHandledCommit(reason)) { |
| 288 active_tree_->ApplySentScrollAndScaleDeltasFromAbortedCommit(); | 288 active_tree_->ApplySentScrollAndScaleDeltasFromAbortedCommit(); |
| 289 active_tree_->ResetContentsTexturesPurged(); | 289 active_tree_->ResetContentsTexturesPurged(); |
| 290 } | 290 } |
| 291 } | 291 } |
| 292 | 292 |
| 293 void LayerTreeHostImpl::BeginCommit() { | 293 void LayerTreeHostImpl::BeginCommit() { |
| 294 TRACE_EVENT0("cc", "LayerTreeHostImpl::BeginCommit"); | 294 TRACE_EVENT0("cc", "LayerTreeHostImpl::BeginCommit"); |
| 295 | 295 |
| 296 // Ensure all textures are returned so partial texture updates can happen |
| 297 // during the commit. Impl-side-painting doesn't upload during commits, so |
| 298 // is unaffected. |
| 299 if (!settings_.impl_side_painting) |
| 300 output_surface_->ForceReclaimResources(); |
| 301 |
| 296 if (UsePendingTreeForSync()) | 302 if (UsePendingTreeForSync()) |
| 297 CreatePendingTree(); | 303 CreatePendingTree(); |
| 298 } | 304 } |
| 299 | 305 |
| 300 void LayerTreeHostImpl::CommitComplete() { | 306 void LayerTreeHostImpl::CommitComplete() { |
| 301 TRACE_EVENT0("cc", "LayerTreeHostImpl::CommitComplete"); | 307 TRACE_EVENT0("cc", "LayerTreeHostImpl::CommitComplete"); |
| 302 | 308 |
| 303 if (pending_tree_) | 309 if (pending_tree_) |
| 304 pending_tree_->ApplyScrollDeltasSinceBeginMainFrame(); | 310 pending_tree_->ApplyScrollDeltasSinceBeginMainFrame(); |
| 305 sync_tree()->set_needs_update_draw_properties(); | 311 sync_tree()->set_needs_update_draw_properties(); |
| (...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 868 draw_result = DRAW_ABORTED_MISSING_HIGH_RES_CONTENT; | 874 draw_result = DRAW_ABORTED_MISSING_HIGH_RES_CONTENT; |
| 869 } | 875 } |
| 870 | 876 |
| 871 occlusion_tracker.LeaveLayer(it); | 877 occlusion_tracker.LeaveLayer(it); |
| 872 } | 878 } |
| 873 | 879 |
| 874 if (have_copy_request || | 880 if (have_copy_request || |
| 875 output_surface_->capabilities().draw_and_swap_full_viewport_every_frame) | 881 output_surface_->capabilities().draw_and_swap_full_viewport_every_frame) |
| 876 draw_result = DRAW_SUCCESS; | 882 draw_result = DRAW_SUCCESS; |
| 877 | 883 |
| 878 #if DCHECK_IS_ON | 884 #if DCHECK_IS_ON() |
| 879 for (const auto& render_pass : frame->render_passes) { | 885 for (const auto& render_pass : frame->render_passes) { |
| 880 for (const auto& quad : render_pass->quad_list) | 886 for (const auto& quad : render_pass->quad_list) |
| 881 DCHECK(quad->shared_quad_state); | 887 DCHECK(quad->shared_quad_state); |
| 882 DCHECK(frame->render_passes_by_id.find(render_pass->id) != | 888 DCHECK(frame->render_passes_by_id.find(render_pass->id) != |
| 883 frame->render_passes_by_id.end()); | 889 frame->render_passes_by_id.end()); |
| 884 } | 890 } |
| 885 #endif | 891 #endif |
| 886 DCHECK(frame->render_passes.back()->output_rect.origin().IsOrigin()); | 892 DCHECK(frame->render_passes.back()->output_rect.origin().IsOrigin()); |
| 887 | 893 |
| 888 if (!active_tree_->has_transparent_background()) { | 894 if (!active_tree_->has_transparent_background()) { |
| (...skipping 2612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3501 } | 3507 } |
| 3502 | 3508 |
| 3503 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { | 3509 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { |
| 3504 std::vector<PictureLayerImpl*>::iterator it = | 3510 std::vector<PictureLayerImpl*>::iterator it = |
| 3505 std::find(picture_layers_.begin(), picture_layers_.end(), layer); | 3511 std::find(picture_layers_.begin(), picture_layers_.end(), layer); |
| 3506 DCHECK(it != picture_layers_.end()); | 3512 DCHECK(it != picture_layers_.end()); |
| 3507 picture_layers_.erase(it); | 3513 picture_layers_.erase(it); |
| 3508 } | 3514 } |
| 3509 | 3515 |
| 3510 } // namespace cc | 3516 } // namespace cc |
| OLD | NEW |