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

Unified Diff: cc/resources/video_resource_updater.cc

Issue 14007004: cc: Don't do produce/consume on the texture id given in VideoFrame. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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 | « cc/resources/video_resource_updater.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/video_resource_updater.cc
diff --git a/cc/resources/video_resource_updater.cc b/cc/resources/video_resource_updater.cc
index a2365ed5aeee38e93f2f1c045c28593ee18a6c2a..11bfc314d1160604a7a6f4d6f0d1cac5b6b865e5 100644
--- a/cc/resources/video_resource_updater.cc
+++ b/cc/resources/video_resource_updater.cc
@@ -19,7 +19,8 @@ const unsigned kRGBResourceFormat = GL_RGBA;
namespace cc {
-VideoFrameExternalResources::VideoFrameExternalResources() : type(NONE) {}
+VideoFrameExternalResources::VideoFrameExternalResources()
+ : type(NONE), hardware_resource(0) {}
VideoFrameExternalResources::~VideoFrameExternalResources() {}
@@ -289,8 +290,7 @@ VideoFrameExternalResources VideoResourceUpdater::CreateForSoftwarePlanes(
}
VideoFrameExternalResources VideoResourceUpdater::CreateForHardwarePlanes(
- const scoped_refptr<media::VideoFrame>& video_frame,
- const TextureMailbox::ReleaseCallback& release_callback) {
+ const scoped_refptr<media::VideoFrame>& video_frame) {
if (!VerifyFrame(video_frame))
return VideoFrameExternalResources();
@@ -322,37 +322,25 @@ VideoFrameExternalResources VideoResourceUpdater::CreateForHardwarePlanes(
return VideoFrameExternalResources();
}
- gpu::Mailbox mailbox;
- GLC(context, context->genMailboxCHROMIUM(mailbox.name));
- GLC(context, context->bindTexture(GL_TEXTURE_2D, video_frame->texture_id()));
- GLC(context, context->produceTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name));
- GLC(context, context->bindTexture(GL_TEXTURE_2D, 0));
+ external_resources.hardware_resource =
+ resource_provider_->CreateResourceFromExternalTexture(
+ video_frame->texture_id());
TextureMailbox::ReleaseCallback callback_to_return_resource =
base::Bind(&ReturnTexture,
base::Unretained(resource_provider_),
- release_callback,
- video_frame->texture_id(),
- mailbox);
- external_resources.mailboxes.push_back(
- TextureMailbox(mailbox, callback_to_return_resource));
+ external_resources.hardware_resource);
+ external_resources.hardware_release_callback = callback_to_return_resource;
return external_resources;
}
// static
void VideoResourceUpdater::ReturnTexture(
ResourceProvider* resource_provider,
- TextureMailbox::ReleaseCallback callback,
- unsigned texture_id,
- gpu::Mailbox mailbox,
+ unsigned resource_id,
unsigned sync_point,
bool lost_resource) {
- WebKit::WebGraphicsContext3D* context =
- resource_provider->GraphicsContext3D();
- GLC(context, context->bindTexture(GL_TEXTURE_2D, texture_id));
no sievers 2013/04/13 01:14:30 Hey when you reland, be sure to use the right text
danakj 2013/04/13 16:47:25 Ohh right. Thanks, I shall pay attention to that
- GLC(context, context->consumeTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name));
- GLC(context, context->bindTexture(GL_TEXTURE_2D, 0));
- callback.Run(sync_point, lost_resource);
+ resource_provider->DeleteResource(resource_id);
}
// static
« no previous file with comments | « cc/resources/video_resource_updater.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698