| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/layers/delegated_renderer_layer_impl.h" | 5 #include "cc/layers/delegated_renderer_layer_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 SetRenderPasses(&frame_data->render_pass_list); | 110 SetRenderPasses(&frame_data->render_pass_list); |
| 111 resources_.swap(used_resources); | 111 resources_.swap(used_resources); |
| 112 } | 112 } |
| 113 } | 113 } |
| 114 | 114 |
| 115 ResourceProvider::ResourceIdArray unused_resources; | 115 ResourceProvider::ResourceIdArray unused_resources; |
| 116 for (ResourceProvider::ResourceIdMap::const_iterator it = | 116 for (ResourceProvider::ResourceIdMap::const_iterator it = |
| 117 resource_map.begin(); | 117 resource_map.begin(); |
| 118 it != resource_map.end(); | 118 it != resource_map.end(); |
| 119 ++it) { | 119 ++it) { |
| 120 bool resource_is_in_current_frame = resources_.count(it->second) > 0; | 120 bool resource_is_in_current_frame = resources_.count(it->second); |
| 121 bool resource_is_in_use = resource_provider->InUseByConsumer(it->second); | 121 bool resource_is_in_use = resource_provider->InUseByConsumer(it->second); |
| 122 if (!resource_is_in_current_frame && !resource_is_in_use) | 122 if (!resource_is_in_current_frame && !resource_is_in_use) |
| 123 unused_resources.push_back(it->second); | 123 unused_resources.push_back(it->second); |
| 124 } | 124 } |
| 125 resource_provider->PrepareSendToChild( | 125 resource_provider->PrepareSendToChild( |
| 126 child_id_, unused_resources, resources_for_ack); | 126 child_id_, unused_resources, resources_for_ack); |
| 127 } | 127 } |
| 128 | 128 |
| 129 void DelegatedRendererLayerImpl::SetDisplaySize(gfx::Size size) { | 129 void DelegatedRendererLayerImpl::SetDisplaySize(gfx::Size size) { |
| 130 if (display_size_ == size) | 130 if (display_size_ == size) |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 void DelegatedRendererLayerImpl::ClearChildId() { | 420 void DelegatedRendererLayerImpl::ClearChildId() { |
| 421 if (!child_id_) | 421 if (!child_id_) |
| 422 return; | 422 return; |
| 423 | 423 |
| 424 ResourceProvider* resource_provider = layer_tree_impl()->resource_provider(); | 424 ResourceProvider* resource_provider = layer_tree_impl()->resource_provider(); |
| 425 resource_provider->DestroyChild(child_id_); | 425 resource_provider->DestroyChild(child_id_); |
| 426 child_id_ = 0; | 426 child_id_ = 0; |
| 427 } | 427 } |
| 428 | 428 |
| 429 } // namespace cc | 429 } // namespace cc |
| OLD | NEW |