| 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 1331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1342 void LayerTreeHostImpl::SetMemoryPolicy(const ManagedMemoryPolicy& policy) { | 1342 void LayerTreeHostImpl::SetMemoryPolicy(const ManagedMemoryPolicy& policy) { |
| 1343 SetManagedMemoryPolicy(policy); | 1343 SetManagedMemoryPolicy(policy); |
| 1344 | 1344 |
| 1345 // This is short term solution to synchronously drop tile resources when | 1345 // This is short term solution to synchronously drop tile resources when |
| 1346 // using synchronous compositing to avoid memory usage regression. | 1346 // using synchronous compositing to avoid memory usage regression. |
| 1347 // TODO(boliu): crbug.com/499004 to track removing this. | 1347 // TODO(boliu): crbug.com/499004 to track removing this. |
| 1348 if (!policy.bytes_limit_when_visible && resource_pool_ && | 1348 if (!policy.bytes_limit_when_visible && resource_pool_ && |
| 1349 settings_.using_synchronous_renderer_compositor) { | 1349 settings_.using_synchronous_renderer_compositor) { |
| 1350 ReleaseTreeResources(); | 1350 ReleaseTreeResources(); |
| 1351 CleanUpTileManager(); | 1351 CleanUpTileManager(); |
| 1352 |
| 1353 // Force a call to NotifyAllTileTasks completed - otherwise this logic may |
| 1354 // be skipped if no work was enqueued at the time the tile manager was |
| 1355 // destroyed. |
| 1356 NotifyAllTileTasksCompleted(); |
| 1357 |
| 1352 CreateTileManagerResources(); | 1358 CreateTileManagerResources(); |
| 1353 RecreateTreeResources(); | 1359 RecreateTreeResources(); |
| 1354 } | 1360 } |
| 1355 } | 1361 } |
| 1356 | 1362 |
| 1357 void LayerTreeHostImpl::SetTreeActivationCallback( | 1363 void LayerTreeHostImpl::SetTreeActivationCallback( |
| 1358 const base::Closure& callback) { | 1364 const base::Closure& callback) { |
| 1359 DCHECK(proxy_->IsImplThread()); | 1365 DCHECK(proxy_->IsImplThread()); |
| 1360 tree_activation_callback_ = callback; | 1366 tree_activation_callback_ = callback; |
| 1361 } | 1367 } |
| (...skipping 2245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3607 if (active_tree()) { | 3613 if (active_tree()) { |
| 3608 LayerAnimationValueProvider* layer = active_tree()->LayerById(layer_id); | 3614 LayerAnimationValueProvider* layer = active_tree()->LayerById(layer_id); |
| 3609 if (layer) | 3615 if (layer) |
| 3610 return layer->ScrollOffsetForAnimation(); | 3616 return layer->ScrollOffsetForAnimation(); |
| 3611 } | 3617 } |
| 3612 | 3618 |
| 3613 return gfx::ScrollOffset(); | 3619 return gfx::ScrollOffset(); |
| 3614 } | 3620 } |
| 3615 | 3621 |
| 3616 } // namespace cc | 3622 } // namespace cc |
| OLD | NEW |