Matan Lurey e7e938cdb5 [Impeller] Document and slightly refactor ResourceManagerVK & friends. (flutter/engine#45474)
@chinmaygarde specifically, let me know if I violated any correctness you were looking for, or if you would prefer I _don't_ make 1 or more of the changes I made here.

@gaaclarke would love your input on C++ style specifically, or anything that stands out in general.

---

## Summary

I plan to use the resource strategy in https://github.com/flutter/flutter/issues/133198, but wanted to understand the code better first, so this is my contribution to make it a bit easier to understand (hopefully! push back if not!) and contribute tests.

1. Renamed `Reset(ResourceType)` to `Swap()` for consistency with the std smart pointers.
2. Moved non-trivial work out of the constructor into `::Create` ([style guide](https://google.github.io/styleguide/cppguide.html#Doing_Work_in_Constructors)).
3. Added some `FML_DCHECK`s to private APIs to enforce correctness.
4. Made classes final and methods private where they were effectively that ([style guide](https://google.github.io/styleguide/cppguide.html#Inheritance)).
5. Added tests to make sure I understood the contracts.
2023-09-07 18:32:11 +00:00
Languages
Dart 75%
C++ 16.5%
Objective-C++ 2.9%
Java 2.8%
Objective-C 0.7%
Other 1.9%