Probably safe for the integer types, but can we add strong assertions when converting from Thebes and Moz2D floats? Bugs like this one are tough to debug:
https://bugzilla.mozilla.org/show_bug.cgi?id=1091709 Thanks! --Jet On Fri, Mar 27, 2015 at 9:44 AM, Nicolas Silva <nsi...@mozilla.com> wrote: > As many of you know, the introduction of Moz2D a while ago added new size, > point and rect classes which are equivalent* to the ones that already > existed in tree (nsIntSize, etc.). > > Juggling back and forth between the Moz2D classes and their thebes > equivalent is pretty annoying and until now we have been progressively > replacing uses of thebes classes by Moz2D ones (a slow process bearing the > exquisite name "Moz2Dification"). Moz2Dification of size classes hasn't > been very efficient, so I decided to just remove the integer thebes > size/rect/point classes and make then typedefs of the moz2D ones. > > I will soon (probably over the weekend) land a patch set that does this for > nsIntSize/gfx::IntSize. > > What this means if you are writing code outside of the gfx/ directory: Not > much. Apologies if my patch queue causes some merge conflicts. > It's up to module owners to decide if they still want refer to integer > sizes as nsIntSize (the typedef) or as gfx::IntSize (the real thing!). You > won't need to use the conversion helpers ToIntSize and ThebesIntSize > anymore, since nsIntSize and gfx::IntSize will be one and the same, and by > the way those conversion helpers are being removed which is most likely the > reason if you run into merge conflicts. > > If you write code under the gfx/ directory, please use gfx::IntSize. After > this lands there won't be any reason to refer to it as nsIntSize, so let's > make things consistent. > > nsIntRect and nsIntPoint will soon share the same fate. > > Cheers, > > Nical > > * This only true for integer classes (IntSize, ect.) because the > non-integer ones use double precision floats in thebes and regular floats > in Moz2D, so we can't just make the switch in one go as easily. > _______________________________________________ > dev-platform mailing list > dev-platform@lists.mozilla.org > https://lists.mozilla.org/listinfo/dev-platform > _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform