summaryrefslogtreecommitdiffstats
path: root/cc/resources/resource_pool.cc
diff options
context:
space:
mode:
authorreveman@chromium.org <reveman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-15 00:57:17 +0000
committerreveman@chromium.org <reveman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-15 00:57:17 +0000
commit19a0335675f0a0f7f880dca6e116e11c9f82888e (patch)
tree3d8db8c9237945a5a6ceeee74bc9cd5130cb94b3 /cc/resources/resource_pool.cc
parentdcd6bae0625819d1fc9259707acee88c6971d344 (diff)
downloadchromium_src-19a0335675f0a0f7f880dca6e116e11c9f82888e.zip
chromium_src-19a0335675f0a0f7f880dca6e116e11c9f82888e.tar.gz
chromium_src-19a0335675f0a0f7f880dca6e116e11c9f82888e.tar.bz2
cc: Add CopyResource function to ResourceProvider API.
This provides an efficient mechanism for copying a resource. Source and destination resources must have matching dimensions and format. Source resource can be backed by an image but destination cannot. CopyResource creates the appropritate read lock fence to prevent unsafe access to source image before the operation has completed. Also moves the toggle of frame based read lock fences out of the ResourcePool to not conflict with the read lock fences needed for CopyResource. BUG=269808 Review URL: https://codereview.chromium.org/234403005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@263761 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/resources/resource_pool.cc')
-rw-r--r--cc/resources/resource_pool.cc6
1 files changed, 0 insertions, 6 deletions
diff --git a/cc/resources/resource_pool.cc b/cc/resources/resource_pool.cc
index 7170a39..31b9b27 100644
--- a/cc/resources/resource_pool.cc
+++ b/cc/resources/resource_pool.cc
@@ -51,16 +51,10 @@ scoped_ptr<ScopedResource> ResourcePool::AcquireResource(
return make_scoped_ptr(resource);
}
- // Create new resource.
scoped_ptr<ScopedResource> resource =
ScopedResource::Create(resource_provider_);
resource->AllocateManaged(size, target_, format_);
- // Extend all read locks on all resources until the resource is
- // finished being used, such that we know when resources are
- // truly safe to recycle.
- resource_provider_->EnableReadLockFences(resource->id(), true);
-
memory_usage_bytes_ += resource->bytes();
++resource_count_;
return resource.Pass();