gleam
gleam copied to clipboard
Remove Rc usage from the crate
Callers should use Rc<T> wherever they want, so that adapters such as ErrorCheckingGl can do their job without multiple layers of virtual calls.
Cc @asajeffrey @bholley
Looking at this patch, I'm not sure it's compatible with WebRender. That code needs to start using a trait object early on (to abstract over the difference between GL and GLES), and by the time we decide to apply the wrappers (e.g. ErrorReactingGl) we don't have the concrete type anymore.
ProfilingGl has a similar problem [1], which is sort of exacerbated by the fact that it can have four different inners (GL/GLES, with/without ErrorReactingGl wrapper).
[1] https://hg.mozilla.org/integration/mozilla-inbound/rev/1972b8836948
@bholley interesting point! Can't we solve this by simply:
impl<T: Gl> Gl for Rc<T> {...}
Yes.
@nox so we are basically ready to land this, just waiting for a moment to do the breaking change?