Closed Bug 1222661 Opened 4 years ago Closed 4 years ago

Get rid of the distinction between "Untyped" and "Unknown" unit systems

Categories

(Core :: Graphics: Layers, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla45
Tracking Status
firefox45 --- fixed

People

(Reporter: botond, Assigned: botond)

References

Details

Attachments

(3 files)

There used to be a distinction between "untyped" units (represented by types such as nsIntPoint, nsIntRect, etc.) and "unknown" units (represented by types such as gfx::IntPoint, gfx::IntRect, etc.).

With bug 1155621, bug 1220898, and bug 1220923, the former have all been made typedefs for the latter, so the distinction has been eliminated.

We should update places is in the code that still use distinct terminology (like LayerPixel::ToUntyped vs. LayerPixel::ToUnknown) to use a single term. I suggest "Unknown", as the actual types after unwrapping typedefs are XXX<UnknownUnits>.
Depends on: 1155621, 1220898, 1220923
Bug 1222661 - Replace ToUntyped(obj) calls with obj.ToUnknown*(). r=nical
Attachment #8684519 - Flags: review?(nical.bugzilla)
Bug 1222661 - Replace FromUntyped(obj) calls with FromUnknown*(obj). r=nical
Attachment #8684520 - Flags: review?(nical.bugzilla)
Comment on attachment 8684519 [details]
MozReview Request: Bug 1222661 - Replace ToUntyped(obj) calls with obj.ToUnknown*(). r=nical

https://reviewboard.mozilla.org/r/24601/#review22175

I have a slight preference for Untyped over Unknown, but it's not a big deal
Attachment #8684519 - Flags: review?(nical.bugzilla) → review+
Attachment #8684520 - Flags: review?(nical.bugzilla) → review+
Comment on attachment 8684520 [details]
MozReview Request: Bug 1222661 - Replace FromUntyped(obj) calls with FromUnknown*(obj). r=nical

https://reviewboard.mozilla.org/r/24603/#review22179
Comment on attachment 8684519 [details]
MozReview Request: Bug 1222661 - Replace ToUntyped(obj) calls with obj.ToUnknown*(). r=nical

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/24601/diff/1-2/
Comment on attachment 8684520 [details]
MozReview Request: Bug 1222661 - Replace FromUntyped(obj) calls with FromUnknown*(obj). r=nical

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/24603/diff/1-2/
Bug 1222661 - Replace ToUnknown(obj) and FromUnknown(obj) with obj.ToUnknown*() and FromUnknown*(obj). r=nical
Attachment #8685132 - Flags: review?(nical.bugzilla)
The last patch rounds out the picture by removing the ToUnknown() and FromUnknown() methods defined by the pixel types (where you needed one for each (pixel type, quantity type) pair) in favour of the ToUnknownXXX() and FromUnknownXXX() methods defined by the quantity types (where you just need one for each quantity type).

(In reply to Nicolas Silva [:nical] from comment #3)
> I have a slight preference for Untyped over Unknown, but it's not a big deal

I chose "Unknown" because the types of these quantities are things like RectTyped<UnknownUnits> and I wanted to be consistent with that. If you'd like to rename UnknownUnits to UntypedUnits (and the methods accordingly), I'm OK with that.
Comment on attachment 8685132 [details]
MozReview Request: Bug 1222661 - Replace ToUnknown(obj) and FromUnknown(obj) with obj.ToUnknown*() and FromUnknown*(obj). r=nical

https://reviewboard.mozilla.org/r/24735/#review22289
Attachment #8685132 - Flags: review?(nical.bugzilla) → review+
> (In reply to Nicolas Silva [:nical] from comment #3)
> > I have a slight preference for Untyped over Unknown, but it's not a big deal
> 
> I chose "Unknown" because the types of these quantities are things like
> RectTyped<UnknownUnits> and I wanted to be consistent with that. If you'd
> like to rename UnknownUnits to UntypedUnits (and the methods accordingly),
> I'm OK with that.

Nah, don't worry, not worth your time and energy :)
You need to log in before you can comment on or make changes to this bug.