gleam icon indicating copy to clipboard operation
gleam copied to clipboard

Remove Rc usage from the crate

Open nox opened this issue 6 years ago • 5 comments

Callers should use Rc<T> wherever they want, so that adapters such as ErrorCheckingGl can do their job without multiple layers of virtual calls.


This change is Reviewable

nox avatar Mar 08 '19 10:03 nox

Cc @asajeffrey @bholley

nox avatar Mar 08 '19 10:03 nox

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 avatar Mar 09 '19 00:03 bholley

@bholley interesting point! Can't we solve this by simply:

impl<T: Gl> Gl for Rc<T> {...}

kvark avatar Mar 09 '19 03:03 kvark

Yes.

nox avatar Mar 09 '19 10:03 nox

@nox so we are basically ready to land this, just waiting for a moment to do the breaking change?

kvark avatar Jul 10 '19 20:07 kvark