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

Unified Diff: cc/resources/video_resource_updater.cc

Issue 23648014: cc: Move TextureMailbox::ReleaseCallback to SingleReleaseCallback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: releasecallback: SingleReleaseCallback Created 7 years, 3 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') | cc/test/layer_tree_pixel_test.h » ('j') | 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 f278c590630ca8ed12258820edce1c0830d03d00..d07ff35b1a097a6718602addcc7511606f39f9ae 100644
--- a/cc/resources/video_resource_updater.cc
+++ b/cc/resources/video_resource_updater.cc
@@ -271,13 +271,12 @@ VideoFrameExternalResources VideoResourceUpdater::CreateForSoftwarePlanes(
plane_resources[0].resource_format,
gpu::Mailbox()
};
- TextureMailbox::ReleaseCallback callback_to_free_resource =
- base::Bind(&RecycleResource,
- AsWeakPtr(),
- recycle_data);
+
external_resources.software_resources.push_back(
plane_resources[0].resource_id);
- external_resources.software_release_callback = callback_to_free_resource;
+ external_resources.software_release_callback =
+ base::Bind(&RecycleResource, AsWeakPtr(), recycle_data);
+
external_resources.type = VideoFrameExternalResources::SOFTWARE_RESOURCE;
return external_resources;
@@ -307,13 +306,11 @@ VideoFrameExternalResources VideoResourceUpdater::CreateForSoftwarePlanes(
plane_resources[i].resource_format,
plane_resources[i].mailbox
};
- TextureMailbox::ReleaseCallback callback_to_free_resource =
- base::Bind(&RecycleResource,
- AsWeakPtr(),
- recycle_data);
+
external_resources.mailboxes.push_back(
- TextureMailbox(plane_resources[i].mailbox,
- callback_to_free_resource));
+ TextureMailbox(plane_resources[i].mailbox));
+ external_resources.release_callbacks.push_back(
+ base::Bind(&RecycleResource, AsWeakPtr(), recycle_data));
}
external_resources.type = VideoFrameExternalResources::YUV_RESOURCE;
@@ -358,14 +355,12 @@ VideoFrameExternalResources VideoResourceUpdater::CreateForHardwarePlanes(
scoped_refptr<media::VideoFrame::MailboxHolder> mailbox_holder =
video_frame->texture_mailbox();
- TextureMailbox::ReleaseCallback callback_to_return_resource =
- base::Bind(&ReturnTexture, mailbox_holder);
-
external_resources.mailboxes.push_back(
TextureMailbox(mailbox_holder->mailbox(),
- callback_to_return_resource,
video_frame->texture_target(),
mailbox_holder->sync_point()));
+ external_resources.release_callbacks.push_back(
+ base::Bind(&ReturnTexture, mailbox_holder));
return external_resources;
}
« no previous file with comments | « cc/resources/video_resource_updater.h ('k') | cc/test/layer_tree_pixel_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698