| 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 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 if (CommitEarlyOutHandledCommit(reason)) { | 290 if (CommitEarlyOutHandledCommit(reason)) { |
| 291 active_tree_->ApplySentScrollAndScaleDeltasFromAbortedCommit(); | 291 active_tree_->ApplySentScrollAndScaleDeltasFromAbortedCommit(); |
| 292 active_tree_->ResetContentsTexturesPurged(); | 292 active_tree_->ResetContentsTexturesPurged(); |
| 293 } | 293 } |
| 294 } | 294 } |
| 295 | 295 |
| 296 void LayerTreeHostImpl::BeginCommit() { | 296 void LayerTreeHostImpl::BeginCommit() { |
| 297 TRACE_EVENT0("cc", "LayerTreeHostImpl::BeginCommit"); | 297 TRACE_EVENT0("cc", "LayerTreeHostImpl::BeginCommit"); |
| 298 | 298 |
| 299 // Ensure all textures are returned so partial texture updates can happen | 299 // Ensure all textures are returned so partial texture updates can happen |
| 300 // during the commit. Impl-side-painting doesn't upload during commits, so | 300 // during the commit. |
| 301 // is unaffected. | 301 // TODO(ericrk): We should not need to ForceReclaimResources when using |
| 302 if (!settings_.impl_side_painting && output_surface_) | 302 // Impl-side-painting as it doesn't upload during commits. However, |
| 303 // Display::Draw currently relies on resource being reclaimed to block drawing |
| 304 // between BeginCommit / Swap. See crbug.com/489515. |
| 305 if (output_surface_) |
| 303 output_surface_->ForceReclaimResources(); | 306 output_surface_->ForceReclaimResources(); |
| 304 | 307 |
| 305 if (settings_.impl_side_painting && !proxy_->CommitToActiveTree()) | 308 if (settings_.impl_side_painting && !proxy_->CommitToActiveTree()) |
| 306 CreatePendingTree(); | 309 CreatePendingTree(); |
| 307 } | 310 } |
| 308 | 311 |
| 309 void LayerTreeHostImpl::CommitComplete() { | 312 void LayerTreeHostImpl::CommitComplete() { |
| 310 TRACE_EVENT0("cc", "LayerTreeHostImpl::CommitComplete"); | 313 TRACE_EVENT0("cc", "LayerTreeHostImpl::CommitComplete"); |
| 311 | 314 |
| 312 // LayerTreeHost may have changed the GPU rasterization flags state, which | 315 // LayerTreeHost may have changed the GPU rasterization flags state, which |
| (...skipping 3121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3434 new_target.SetToMin(layer_impl->MaxScrollOffset()); | 3437 new_target.SetToMin(layer_impl->MaxScrollOffset()); |
| 3435 | 3438 |
| 3436 curve->UpdateTarget( | 3439 curve->UpdateTarget( |
| 3437 animation->TrimTimeToCurrentIteration(CurrentBeginFrameArgs().frame_time) | 3440 animation->TrimTimeToCurrentIteration(CurrentBeginFrameArgs().frame_time) |
| 3438 .InSecondsF(), | 3441 .InSecondsF(), |
| 3439 new_target); | 3442 new_target); |
| 3440 | 3443 |
| 3441 return true; | 3444 return true; |
| 3442 } | 3445 } |
| 3443 } // namespace cc | 3446 } // namespace cc |
| OLD | NEW |