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

Unified Diff: cc/resources/video_resource_updater.h

Issue 2242453002: Avoid planar YUV resources when one component EGL images are not supported (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Abstract out resource immutability. Created 4 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/resource_provider.cc ('k') | cc/resources/video_resource_updater.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/video_resource_updater.h
diff --git a/cc/resources/video_resource_updater.h b/cc/resources/video_resource_updater.h
index a5c063dd7681dad8dc4b8839575a5a810351f1d4..6b63895bfd014818dfeac95f28493c83660bce89 100644
--- a/cc/resources/video_resource_updater.h
+++ b/cc/resources/video_resource_updater.h
@@ -136,6 +136,23 @@ class CC_EXPORT VideoResourceUpdater
// This needs to be a container where iterators can be erased without
// invalidating other iterators.
typedef std::list<PlaneResource> ResourceList;
+
+ // Obtain a resource of the right format by either recycling an
+ // unreferenced but appropriately formatted resource, or by
+ // allocating a new resource.
+ // Additionally, if the |unique_id| and |plane_index| match, then
+ // it is assumed that the resource has the right data already and will only be
+ // used for reading, and so is returned even if it is still referenced.
+ // Passing -1 for |plane_index| avoids returning referenced
+ // resources.
+ ResourceList::iterator RecycleOrAllocateResource(
+ const gfx::Size& resource_size,
+ ResourceFormat resource_format,
+ const gfx::ColorSpace& color_space,
+ bool software_resource,
+ bool immutable_hint,
+ int unique_id,
+ int plane_index);
ResourceList::iterator AllocateResource(const gfx::Size& plane_size,
ResourceFormat format,
const gfx::ColorSpace& color_space,
« no previous file with comments | « cc/resources/resource_provider.cc ('k') | cc/resources/video_resource_updater.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698