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/resources/resource_provider.h" | 5 #include "cc/resources/resource_provider.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 | 9 |
10 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
(...skipping 1422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1433 } | 1433 } |
1434 | 1434 |
1435 void ResourceProvider::ReceiveReturnsFromParent( | 1435 void ResourceProvider::ReceiveReturnsFromParent( |
1436 const ReturnedResourceArray& resources) { | 1436 const ReturnedResourceArray& resources) { |
1437 DCHECK(thread_checker_.CalledOnValidThread()); | 1437 DCHECK(thread_checker_.CalledOnValidThread()); |
1438 GLES2Interface* gl = ContextGL(); | 1438 GLES2Interface* gl = ContextGL(); |
1439 | 1439 |
1440 int child_id = 0; | 1440 int child_id = 0; |
1441 ResourceIdArray resources_for_child; | 1441 ResourceIdArray resources_for_child; |
1442 | 1442 |
1443 std::vector<std::pair<ReturnedResource, ResourceMap::iterator> > | 1443 std::vector<std::pair<ReturnedResource, ResourceMap::iterator>> |
1444 sorted_resources; | 1444 sorted_resources; |
1445 | 1445 |
1446 for (ReturnedResourceArray::const_iterator it = resources.begin(); | 1446 for (ReturnedResourceArray::const_iterator it = resources.begin(); |
1447 it != resources.end(); | 1447 it != resources.end(); |
1448 ++it) { | 1448 ++it) { |
1449 ResourceId local_id = it->id; | 1449 ResourceId local_id = it->id; |
1450 ResourceMap::iterator map_iterator = resources_.find(local_id); | 1450 ResourceMap::iterator map_iterator = resources_.find(local_id); |
1451 | 1451 |
1452 // Resource was already lost (e.g. it belonged to a child that was | 1452 // Resource was already lost (e.g. it belonged to a child that was |
1453 // destroyed). | 1453 // destroyed). |
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2091 ContextProvider* context_provider = output_surface_->context_provider(); | 2091 ContextProvider* context_provider = output_surface_->context_provider(); |
2092 return context_provider ? context_provider->ContextGL() : NULL; | 2092 return context_provider ? context_provider->ContextGL() : NULL; |
2093 } | 2093 } |
2094 | 2094 |
2095 class GrContext* ResourceProvider::GrContext() const { | 2095 class GrContext* ResourceProvider::GrContext() const { |
2096 ContextProvider* context_provider = output_surface_->context_provider(); | 2096 ContextProvider* context_provider = output_surface_->context_provider(); |
2097 return context_provider ? context_provider->GrContext() : NULL; | 2097 return context_provider ? context_provider->GrContext() : NULL; |
2098 } | 2098 } |
2099 | 2099 |
2100 } // namespace cc | 2100 } // namespace cc |
OLD | NEW |