Redo ref counting / Memory tracking for SharedImages
This change corrects some bugs in SharedImage refcounting:
- SharedImages now count against a MemoryTypeTracker for a channel that
holds a ref. Previously they would keep the original creating channel's
MemoryTypeTracker, which could lead to issues if that channel was
destroyed but the SharedImage was exported / kept alive by a different
channel.
- SharedImageBackings now manage ref counts internally, rather than in
SharedImageManager. Allows a backing to know which trackers are keeping
it alive.
- Consumers of SharedImageRepresentations now create them though a
SharedImageRepresentationFactory, which bundles a MemoryTypeTracker and
forwards it to SharedImageManager.
- The creating ref is now managed using a SharedImageRepresentationFactoryRef,
rather than a special Register/Unregister pair. This normalizes tracking w/
other representation-based methods.
Change-Id: Ia4585e589f96d0d64b00123bdc65ff126bbd32c1
Reviewed-on: https://chromium-review.googlesource.com/c/1298735
Commit-Queue: Eric Karl <[email protected]>
Reviewed-by: Antoine Labour <[email protected]>
Cr-Commit-Position: refs/heads/master@{#604422}
diff --git a/gpu/BUILD.gn b/gpu/BUILD.gn
index 13d4a13f..7efb118 100644
--- a/gpu/BUILD.gn
+++ b/gpu/BUILD.gn
@@ -194,6 +194,7 @@
sources = [
"command_buffer/service/shared_image_backing_factory_gl_texture_unittest.cc",
"command_buffer/service/shared_image_factory_unittest.cc",
+ "command_buffer/service/shared_image_manager_unittest.cc",
"command_buffer/tests/compressed_texture_test.cc",
"command_buffer/tests/es3_misc_functions_unittest.cc",
"command_buffer/tests/gl_apply_screen_space_antialiasing_CHROMIUM_unittest.cc",