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 <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 1467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1478 | 1478 |
1479 void LayerTreeHostImpl::DidSwapBuffersComplete() { | 1479 void LayerTreeHostImpl::DidSwapBuffersComplete() { |
1480 client_->DidSwapBuffersCompleteOnImplThread(); | 1480 client_->DidSwapBuffersCompleteOnImplThread(); |
1481 } | 1481 } |
1482 | 1482 |
1483 void LayerTreeHostImpl::DidReceiveTextureInUseResponses( | 1483 void LayerTreeHostImpl::DidReceiveTextureInUseResponses( |
1484 const gpu::TextureInUseResponses& responses) { | 1484 const gpu::TextureInUseResponses& responses) { |
1485 NOTREACHED(); | 1485 NOTREACHED(); |
1486 } | 1486 } |
1487 | 1487 |
1488 void LayerTreeHostImpl::ReclaimResources(const CompositorFrameAck* ack) { | 1488 void LayerTreeHostImpl::ReclaimResources( |
| 1489 const ReturnedResourceArray& resources) { |
1489 // TODO(piman): We may need to do some validation on this ack before | 1490 // TODO(piman): We may need to do some validation on this ack before |
1490 // processing it. | 1491 // processing it. |
1491 if (renderer_) | 1492 if (renderer_) |
1492 renderer_->ReceiveSwapBuffersAck(*ack); | 1493 renderer_->ReclaimResources(resources); |
1493 | 1494 |
1494 // In OOM, we now might be able to release more resources that were held | 1495 // In OOM, we now might be able to release more resources that were held |
1495 // because they were exported. | 1496 // because they were exported. |
1496 if (resource_pool_) { | 1497 if (resource_pool_) { |
1497 if (resource_pool_->memory_usage_bytes()) { | 1498 if (resource_pool_->memory_usage_bytes()) { |
1498 const size_t kMegabyte = 1024 * 1024; | 1499 const size_t kMegabyte = 1024 * 1024; |
1499 | 1500 |
1500 // This is a good time to log memory usage. A chunk of work has just | 1501 // This is a good time to log memory usage. A chunk of work has just |
1501 // completed but none of the memory used for that work has likely been | 1502 // completed but none of the memory used for that work has likely been |
1502 // freed. | 1503 // freed. |
(...skipping 2519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4022 return task_runner_provider_->HasImplThread(); | 4023 return task_runner_provider_->HasImplThread(); |
4023 } | 4024 } |
4024 | 4025 |
4025 bool LayerTreeHostImpl::CommitToActiveTree() const { | 4026 bool LayerTreeHostImpl::CommitToActiveTree() const { |
4026 // In single threaded mode we skip the pending tree and commit directly to the | 4027 // In single threaded mode we skip the pending tree and commit directly to the |
4027 // active tree. | 4028 // active tree. |
4028 return !task_runner_provider_->HasImplThread(); | 4029 return !task_runner_provider_->HasImplThread(); |
4029 } | 4030 } |
4030 | 4031 |
4031 } // namespace cc | 4032 } // namespace cc |
OLD | NEW |