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

Unified Diff: cc/resources/resource_provider.cc

Issue 2130213002: cc: Do not synchronize on deletion of non-internal resources. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cc: Do not synchronize on deletion of non-internal resources. Created 4 years, 5 months 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/resource_provider.cc
diff --git a/cc/resources/resource_provider.cc b/cc/resources/resource_provider.cc
index e9803961e5dd40f270e871938079b19956d57052..7a626a2f4a8a348acf86b6dd585b888f244501f0 100644
--- a/cc/resources/resource_provider.cc
+++ b/cc/resources/resource_provider.cc
@@ -703,7 +703,8 @@ void ResourceProvider::DeleteResourceInternal(ResourceMap::iterator it,
bool lost_resource =
resource->lost || exported_resource_lost || gpu_resource_lost;
- if (!lost_resource &&
+ // Wait on sync token before deleting resources we own.
+ if (!lost_resource && resource->origin == Resource::INTERNAL &&
resource->synchronization_state() == Resource::NEEDS_WAIT) {
DCHECK(resource->allocated);
DCHECK(IsGpuResourceType(resource->type));
@@ -744,6 +745,7 @@ void ResourceProvider::DeleteResourceInternal(ResourceMap::iterator it,
GLES2Interface* gl = ContextGL();
DCHECK(gl);
if (resource->gl_id) {
+ DCHECK_NE(Resource::NEEDS_WAIT, resource->synchronization_state());
gl->DeleteTextures(1, &resource->gl_id);
resource->gl_id = 0;
if (!lost_resource) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698