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

Unified Diff: cc/resources/resource_pool.cc

Issue 83883002: cc: Allow TEXTURE_RECTANGLE_ARB to be used for tile textures. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address review feedback Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/resources/resource_pool.h ('k') | cc/resources/resource_provider.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/resource_pool.cc
diff --git a/cc/resources/resource_pool.cc b/cc/resources/resource_pool.cc
index 52810232688146df8948373e292ef72cd1f377eb..254837fc94f5eb467be278dc750b6b5bbe4af210 100644
--- a/cc/resources/resource_pool.cc
+++ b/cc/resources/resource_pool.cc
@@ -10,9 +10,11 @@ namespace cc {
ResourcePool::Resource::Resource(cc::ResourceProvider* resource_provider,
gfx::Size size,
+ GLenum target,
ResourceFormat format)
: cc::Resource(resource_provider->CreateManagedResource(
size,
+ target,
GL_CLAMP_TO_EDGE,
ResourceProvider::TextureUsageAny,
format),
@@ -28,8 +30,12 @@ ResourcePool::Resource::~Resource() {
resource_provider_->DeleteResource(id());
}
-ResourcePool::ResourcePool(ResourceProvider* resource_provider)
+ResourcePool::ResourcePool(ResourceProvider* resource_provider,
+ GLenum target,
+ ResourceFormat format)
: resource_provider_(resource_provider),
+ target_(target),
+ format_(format),
max_memory_usage_bytes_(0),
max_unused_memory_usage_bytes_(0),
max_resource_count_(0),
@@ -52,7 +58,7 @@ ResourcePool::~ResourcePool() {
}
scoped_ptr<ResourcePool::Resource> ResourcePool::AcquireResource(
- gfx::Size size, ResourceFormat format) {
+ gfx::Size size) {
for (ResourceList::iterator it = unused_resources_.begin();
it != unused_resources_.end(); ++it) {
Resource* resource = *it;
@@ -60,8 +66,6 @@ scoped_ptr<ResourcePool::Resource> ResourcePool::AcquireResource(
if (resource->size() != size)
continue;
- if (resource->format() != format)
- continue;
unused_resources_.erase(it);
unused_memory_usage_bytes_ -= resource->bytes();
@@ -69,7 +73,8 @@ scoped_ptr<ResourcePool::Resource> ResourcePool::AcquireResource(
}
// Create new resource.
- Resource* resource = new Resource(resource_provider_, size, format);
+ Resource* resource = new Resource(
+ resource_provider_, size, target_, format_);
// Extend all read locks on all resources until the resource is
// finished being used, such that we know when resources are
« no previous file with comments | « cc/resources/resource_pool.h ('k') | cc/resources/resource_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698