From 51883faa0a6104c390251f57ebc794f714cf98d0 Mon Sep 17 00:00:00 2001 From: reveman Date: Wed, 29 Oct 2014 14:04:40 -0700 Subject: 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} --- cc/resources/resource_pool.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'cc/resources/resource_pool.cc') 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); -- cgit v1.1