This ensures that the callbacks in GlTextureView won't call an expired object, even if user code holds a GlTextureView after releasing the buffer.
Note that GlTextureBuffer is not always held by a shared_ptr, but it always is when GpuBuffer calls GetRead/WriteView on it. An alternative solution would have been to have GpuBuffer pass its shared_ptr<GlTextureBuffer> to the view method, which could have been implemented with some compile-time logic to detect whether the method expects such an argument. However, that doesn't seem necessary.
PiperOrigin-RevId: 489611843
- ImageFrame views are backed by CPU locks of the AHWB.
- GlTextureViews are managed through a GlTextureBuffer connected to the AHWB allocation.
This improves the latency of heterogeneous access sequences, but makes `ImageFrame > ImageFrame` sequences slower due to CPU locking.
PiperOrigin-RevId: 481982546