summaryrefslogtreecommitdiffstats
path: root/cc/resources/resource_pool.cc
diff options
context:
space:
mode:
authorreveman <reveman@chromium.org>2014-10-29 14:04:40 -0700
committerCommit bot <commit-bot@chromium.org>2014-10-29 21:04:53 +0000
commit51883faa0a6104c390251f57ebc794f714cf98d0 (patch)
treee287b106ca95f8a6b799a3dd061107796dbfdf1a /cc/resources/resource_pool.cc
parentcae3ac4afe15aca930e55c72cc929a7b830be2db (diff)
downloadchromium_src-51883faa0a6104c390251f57ebc794f714cf98d0.zip
chromium_src-51883faa0a6104c390251f57ebc794f714cf98d0.tar.gz
chromium_src-51883faa0a6104c390251f57ebc794f714cf98d0.tar.bz2
cc: Detect miss-behaving fence extensions when using 1-copy rasterizer.
This adds a wait_if_needed parameter to ResourcePool::CheckBusyResources. CheckBusyResources will use existing ResourceProvider API to wait for any read locks to complete if needed by a resource prior to checking if it's still busy when this parameter is true. 1-copy rasterizer will use this functionality after too many failed attempts to check if copy operations have completed. This provides a reliable method to detect drivers with miss-behaving fence extensions. BUG=406404 Review URL: https://codereview.chromium.org/683263004 Cr-Commit-Position: refs/heads/master@{#301926}
Diffstat (limited to 'cc/resources/resource_pool.cc')
-rw-r--r--cc/resources/resource_pool.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/cc/resources/resource_pool.cc b/cc/resources/resource_pool.cc
index 31b9b27..45f36e2 100644
--- a/cc/resources/resource_pool.cc
+++ b/cc/resources/resource_pool.cc
@@ -105,12 +105,15 @@ bool ResourcePool::ResourceUsageTooHigh() {
return false;
}
-void ResourcePool::CheckBusyResources() {
+void ResourcePool::CheckBusyResources(bool wait_if_needed) {
ResourceList::iterator it = busy_resources_.begin();
while (it != busy_resources_.end()) {
ScopedResource* resource = *it;
+ if (wait_if_needed)
+ resource_provider_->WaitReadLockIfNeeded(resource->id());
+
if (resource_provider_->CanLockForWrite(resource->id())) {
DidFinishUsingResource(resource);
it = busy_resources_.erase(it);