summaryrefslogtreecommitdiffstats
path: root/cc/resources/resource_pool.h
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.h
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.h')
-rw-r--r--cc/resources/resource_pool.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/cc/resources/resource_pool.h b/cc/resources/resource_pool.h
index 8123152..5f481e9 100644
--- a/cc/resources/resource_pool.h
+++ b/cc/resources/resource_pool.h
@@ -40,6 +40,7 @@ class CC_EXPORT ResourcePool {
size_t acquired_memory_usage_bytes() const {
return memory_usage_bytes_ - unused_memory_usage_bytes_;
}
+ size_t total_resource_count() const { return resource_count_; }
size_t acquired_resource_count() const {
return resource_count_ - unused_resources_.size();
}