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