Re: From nsIntSize to gfx::IntSize
Hi dev-platform, Heads up: I just landed on Inbound a patch that gives nsIntPoint and nsIntRect the same treatment I gave to nsIntSize: these two classes are now typedefs of mozilla::gfx::IntPoint and mozilla::gfx::IntRect, which means that they can't be forward-declared as they used to, but other than that, you can use them mostly the way you used them before. If you are writing code in gfx, please refrain from using the nsInt* typedefs and use gfx::Int* instead. If you are writing code in other modules, module owners shall decide what's best. The discussions on this list (after I landed the nsIntSize change) seemed to indicate that people outside of gfx are generally in favor of using gfx::Int* classes rather than their nsInt typedefs. Cheers, Nical On Sun, Mar 29, 2015 at 11:01 PM, Mats Palmgren wrote: > On 03/27/2015 09:28 PM, Robert O'Callahan wrote: > >> As a followup it's probably worth replacing all of nsIntSize with >> gfx::IntSize. >> > > I think we should stop using these unit-less types in layout and > convert the few remaining uses to the unit-bearing types in > layout/base/Units.h instead. > > I'm taking a stab on a couple of those so I'd prefer if you > leave nsIntSize as is for now in layout/ to avoid conflicts. > > > /Mats > > ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform
Re: From nsIntSize to gfx::IntSize
On Sun, Mar 29, 2015 at 5:01 PM, Mats Palmgren wrote: > On 03/27/2015 09:28 PM, Robert O'Callahan wrote: >> >> As a followup it's probably worth replacing all of nsIntSize with >> gfx::IntSize. > > I think we should stop using these unit-less types in layout and > convert the few remaining uses to the unit-bearing types in > layout/base/Units.h instead. > > I'm taking a stab on a couple of those Cool! In case you find them useful, we now also have strongly-typed region classes (bug 1043013). Cheers, Botond ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform
Re: From nsIntSize to gfx::IntSize
On 03/27/2015 09:28 PM, Robert O'Callahan wrote: As a followup it's probably worth replacing all of nsIntSize with gfx::IntSize. I think we should stop using these unit-less types in layout and convert the few remaining uses to the unit-bearing types in layout/base/Units.h instead. I'm taking a stab on a couple of those so I'd prefer if you leave nsIntSize as is for now in layout/ to avoid conflicts. /Mats ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform
Re: From nsIntSize to gfx::IntSize
Two typedefs for the same thing is just cognitive overhead. Some judicious typedefs in classes like nsIFrame would be helpful so we don't have "gfx::" prefixes cluttering up everywhere. Rob -- oIo otoeololo oyooouo otohoaoto oaonoyooonoeo owohooo oioso oaonogoroyo owoiotoho oao oboroootohoeoro oooro osoiosotoeoro owoiololo oboeo osouobojoeocoto otooo ojouodogomoeonoto.o oAogoaoiono,o oaonoyooonoeo owohooo osoaoyoso otooo oao oboroootohoeoro oooro osoiosotoeoro,o o‘oRoaocoao,o’o oioso oaonosowoeoroaoboloeo otooo otohoeo ocooouoroto.o oAonodo oaonoyooonoeo owohooo osoaoyoso,o o‘oYooouo ofolo!o’o owoiololo oboeo oiono odoaonogoeoro ooofo otohoeo ofoioroeo ooofo ohoeololo. ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform
Re: From nsIntSize to gfx::IntSize
On Fri, Mar 27, 2015 at 10:50 PM, Jet Villegas wrote: > 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! > > I haven't planned to do an all-at-once conversion of Moz2D floats, especially because we ran into bugs like the one you mentioned. For now I am doing the integer types because they are easy and constantly getting in my way, but I don't think that I'll look into the float ones in the short term. Cheers, Nical ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform
Re: From nsIntSize to gfx::IntSize
The first part just landed on inbound (Bug 1132854). On Fri, Mar 27, 2015 at 10:28 PM, Robert O'Callahan wrote: > Sounds good. But, is gfx::IntSize going to get a "ToAppUnits" method like > nsIntSize has? > > The method: nsIntSize::ToAppUnits(nscoord aAppUnitsPerPixel) const was replaced by a function: IntSizeToAppUnits(mozilla::gfx::IntSize aSize, nscoord aAppUnitsPerPixel) As a followup it's probably worth replacing all of nsIntSize with > gfx::IntSize. > > So no more nsIntSize and gfxIntSize typedefs anywhere (I guess layout is the most impacted non-gfx module)? Sounds go to me, I felt like it wasn't my decision to make, but I do prefer having ony gfx::IntSize in the entire gecko code base. Cheers, Nical ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform
Re: From nsIntSize to gfx::IntSize
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 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
Re: From nsIntSize to gfx::IntSize
Sounds good. But, is gfx::IntSize going to get a "ToAppUnits" method like nsIntSize has? As a followup it's probably worth replacing all of nsIntSize with gfx::IntSize. Rob -- oIo otoeololo oyooouo otohoaoto oaonoyooonoeo owohooo oioso oaonogoroyo owoiotoho oao oboroootohoeoro oooro osoiosotoeoro owoiololo oboeo osouobojoeocoto otooo ojouodogomoeonoto.o oAogoaoiono,o oaonoyooonoeo owohooo osoaoyoso otooo oao oboroootohoeoro oooro osoiosotoeoro,o o‘oRoaocoao,o’o oioso oaonosowoeoroaoboloeo otooo otohoeo ocooouoroto.o oAonodo oaonoyooonoeo owohooo osoaoyoso,o o‘oYooouo ofolo!o’o owoiololo oboeo oiono odoaonogoeoro ooofo otohoeo ofoioroeo ooofo ohoeololo. ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform
From nsIntSize to gfx::IntSize
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