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

Unified Diff: cc/resource_provider.cc

Issue 12315046: cc: Make ResourceProvider correctly handle transferring mailbox-created resources (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments Created 7 years, 10 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 | cc/resource_provider_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resource_provider.cc
diff --git a/cc/resource_provider.cc b/cc/resource_provider.cc
index 0ac1e181d790758f93b2debbead555e19a7a8e24..5de3149343992b90422ee88d96a48ad2e17d839a 100644
--- a/cc/resource_provider.cc
+++ b/cc/resource_provider.cc
@@ -760,8 +760,12 @@ void ResourceProvider::receiveFromParent(const TransferableResourceList& resourc
DCHECK(resource->exported);
resource->exported = false;
DCHECK(resource->mailbox.Equals(it->mailbox));
- GLC(context3d, context3d->bindTexture(GL_TEXTURE_2D, resource->glId));
- GLC(context3d, context3d->consumeTextureCHROMIUM(GL_TEXTURE_2D, it->mailbox.name));
+ if (resource->glId) {
+ GLC(context3d, context3d->bindTexture(GL_TEXTURE_2D, resource->glId));
+ GLC(context3d, context3d->consumeTextureCHROMIUM(GL_TEXTURE_2D, it->mailbox.name));
+ } else {
+ resource->mailbox = TextureMailbox(resource->mailbox.name(), resource->mailbox.callback(), resources.sync_point);
+ }
if (resource->markedForDeletion)
deleteResourceInternal(mapIterator);
}
@@ -791,8 +795,13 @@ bool ResourceProvider::transferResource(WebGraphicsContext3D* context, ResourceI
} else
resource->mailbox = source->mailbox.name();
- GLC(context, context->bindTexture(GL_TEXTURE_2D, source->glId));
- GLC(context, context->produceTextureCHROMIUM(GL_TEXTURE_2D, resource->mailbox.name));
+ if (source->glId) {
+ GLC(context, context->bindTexture(GL_TEXTURE_2D, source->glId));
+ GLC(context, context->produceTextureCHROMIUM(GL_TEXTURE_2D, resource->mailbox.name));
+ } else if (source->mailbox.sync_point()) {
+ GLC(context3d, context3d->waitSyncPoint(source->mailbox.sync_point()));
+ source->mailbox.ResetSyncPoint();
+ }
return true;
}
« no previous file with comments | « no previous file | cc/resource_provider_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698