Closed Bug 1132854 Opened 5 years ago Closed 5 years ago

Make nsIntSize a typedef of gfx::IntSize

Categories

(Core :: Graphics, defect)

x86_64
Linux
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla40
Tracking Status
firefox39 --- fixed
firefox40 --- fixed

People

(Reporter: nical, Assigned: nical)

Details

Attachments

(3 files, 1 obsolete file)

(Filed under gfx by default but it touches a lot of places)

There are still a lot of places where we use the old thebes size/point/rect/etc classes and it's a pain to have to have to convert between them and the cool new ones in Moz2D.
So far we have taken the approach of "moz2Difying" the different places where we use these classes, but it's a tedious process.

I propose that we just completely remove nsIntSize's code and make it a typedef of gfx::IntSize. Starting with these two because they're probably the most commonly used, but I'd like to do this with all of the Int classes since they are completely equivalent (the floating point classes are trickier because we go from double to float so we'll have to take the time to do it more incrementally).
Makes for a big ugly patch, but it was actually very mechanical and easy to write.

Most of the modifications come from that we can't forward declare nsIntSize the way we used to now that it's a typedef.
Assignee: nobody → nical.bugzilla
Attachment #8564035 - Flags: review?(roc)
Attachment #8564035 - Flags: review?(bas)
Comment on attachment 8564035 [details] [diff] [review]
Make nsIntSize a typedef of gfx::IntSize

Review of attachment 8564035 [details] [diff] [review]:
-----------------------------------------------------------------

::: xpcom/glue/CondVar.h
@@ +68,5 @@
>    /**
>     * Wait
>     * @see prcvar.h
>     **/
> +  nsresult Wait(PRIntervalTime aInterval = PR_INTERVAL_NO_TfIMEOUT)

I bet this won't compile :P
(In reply to Bas Schouten (:bas.schouten) from comment #3)
> Comment on attachment 8564035 [details] [diff] [review]
> Make nsIntSize a typedef of gfx::IntSize
> 
> Review of attachment 8564035 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: xpcom/glue/CondVar.h
> @@ +68,5 @@
> >    /**
> >     * Wait
> >     * @see prcvar.h
> >     **/
> > +  nsresult Wait(PRIntervalTime aInterval = PR_INTERVAL_NO_TfIMEOUT)
> 
> I bet this won't compile :P

Yeah, I apparently made slipped on the keyboard just before uploading the patch, but I had it compile on linux. The patch is probably bitrotted by now so I'll have to redo it, push to try and land quickly before it bitrots again if you agree with the general idea.
Attachment #8564035 - Attachment is obsolete: true
Attachment #8564035 - Flags: review?(bas)
Attachment #8584590 - Flags: review?(bas)
Attachment #8584590 - Flags: review?(bas) → review+
Attachment #8564036 - Flags: review?(bas) → review+
https://hg.mozilla.org/mozilla-central/rev/bc9e3d4db725
https://hg.mozilla.org/mozilla-central/rev/1d5bdeca48eb
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Whiteboard: [leave-open]
Comment on attachment 8584651 [details] [diff] [review]
Remove the ToIntSize conversion helper since it's now a no-op

Review of attachment 8584651 [details] [diff] [review]:
-----------------------------------------------------------------

This is satisfying.
Attachment #8584651 - Flags: review?(bas) → review+
https://hg.mozilla.org/mozilla-central/rev/1172f2f1daab
Status: REOPENED → RESOLVED
Closed: 5 years ago5 years ago
Resolution: --- → FIXED
Target Milestone: mozilla39 → mozilla40
You need to log in before you can comment on or make changes to this bug.