Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(989)

Side by Side Diff: cc/resources/resource_pool.cc

Issue 1415583004: cc: Remove references to managed resources (and cleanup) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: protected -> private Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | cc/resources/resource_provider.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_pool.h" 5 #include "cc/resources/resource_pool.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/format_macros.h" 9 #include "base/format_macros.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 in_use_resources_.set(resource->id(), unused_resources_.take(it)); 105 in_use_resources_.set(resource->id(), unused_resources_.take(it));
106 in_use_memory_usage_bytes_ += ResourceUtil::UncheckedSizeInBytes<size_t>( 106 in_use_memory_usage_bytes_ += ResourceUtil::UncheckedSizeInBytes<size_t>(
107 resource->size(), resource->format()); 107 resource->size(), resource->format());
108 return resource; 108 return resource;
109 } 109 }
110 110
111 scoped_ptr<PoolResource> pool_resource = 111 scoped_ptr<PoolResource> pool_resource =
112 PoolResource::Create(resource_provider_); 112 PoolResource::Create(resource_provider_);
113 GLenum target = 113 GLenum target =
114 target_ ? target_ : resource_provider_->GetImageTextureTarget(format); 114 target_ ? target_ : resource_provider_->GetImageTextureTarget(format);
115 pool_resource->AllocateManaged(size, target, format); 115 pool_resource->AllocateWithTextureTarget(size, target, format);
116 116
117 DCHECK(ResourceUtil::VerifySizeInBytes<size_t>(pool_resource->size(), 117 DCHECK(ResourceUtil::VerifySizeInBytes<size_t>(pool_resource->size(),
118 pool_resource->format())); 118 pool_resource->format()));
119 total_memory_usage_bytes_ += ResourceUtil::UncheckedSizeInBytes<size_t>( 119 total_memory_usage_bytes_ += ResourceUtil::UncheckedSizeInBytes<size_t>(
120 pool_resource->size(), pool_resource->format()); 120 pool_resource->size(), pool_resource->format());
121 ++total_resource_count_; 121 ++total_resource_count_;
122 122
123 Resource* resource = pool_resource.get(); 123 Resource* resource = pool_resource.get();
124 in_use_resources_.set(resource->id(), pool_resource.Pass()); 124 in_use_resources_.set(resource->id(), pool_resource.Pass());
125 in_use_memory_usage_bytes_ += ResourceUtil::UncheckedSizeInBytes<size_t>( 125 in_use_memory_usage_bytes_ += ResourceUtil::UncheckedSizeInBytes<size_t>(
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 for (const auto& resource : busy_resources_) { 296 for (const auto& resource : busy_resources_) {
297 resource->OnMemoryDump(pmd, resource_provider_, false /* is_free */); 297 resource->OnMemoryDump(pmd, resource_provider_, false /* is_free */);
298 } 298 }
299 for (const auto& entry : in_use_resources_) { 299 for (const auto& entry : in_use_resources_) {
300 entry.second->OnMemoryDump(pmd, resource_provider_, false /* is_free */); 300 entry.second->OnMemoryDump(pmd, resource_provider_, false /* is_free */);
301 } 301 }
302 return true; 302 return true;
303 } 303 }
304 304
305 } // namespace cc 305 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/resources/resource_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698