Closed Bug 919219 Opened 11 years ago Closed 11 years ago

Make gfxASurface.h cheap to include

Categories

(Core :: Graphics, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla27

People

(Reporter: bjacob, Assigned: bjacob)

References

(Blocks 1 open bug)

Details

Attachments

(2 files, 2 obsolete files)

A lot of files #include "gfxASurface.h" and it's not very easy to avoid: gfxASurface.h is a widely-used base class.

So the most beneficial thing that we may be able to do about that is to make gfxASurface.h as cheap to include as possible.
Assignee: nobody → bjacob
OS: Linux → All
Hardware: x86_64 → All
That seems to be where it belongs, and it takes a big shard off my foot.
Attachment #808216 - Flags: review?(jmuizelaar)
Attached patch Trim gfxASurface more (obsolete) — Splinter Review
In particular:
 - Don't include gfxRect.h anymore, defer some functions out-of-line
 - Use a MFB AutoPtr (something I'm adding in one of the blockers of the present bug) instead of a nsAutoPtr so we don't drag in all the XPCOM stuff, cycle collection, strings, etc
 - Include nscoretypes.h (another things I'm adding in another blocker of this bug) only, not nscore.h.
Attachment #808217 - Flags: review?(jmuizelaar)
Also: include only nsStringFwd.h in INTERNAL code, and gfxIntSize and nsIntSize are the same type, this patch has some churn around that, I'll try to make a cleaner patch in that respect.
Depends on: 919222
Attached patch Trim gfxASurface more (obsolete) — Splinter Review
So, I cancel my AutoPtr patch because MFBT already has ScopedDeletePtr, and so this new patch is using it instead; and I'm also cancelling my nscoretypes.h patch because I actually checked the preprocessed code for nscore.h and it's only 3K lines (I had been told that it was 40K, but that was apparently wrong) so nscore.h doesn't appear to be working avoiding to include.

And the gfxIntSize -> nsIntSize changes are actually needed as gfxIntSize is a typedef for nsIntSize so can't be forward-declared.
Attachment #808217 - Attachment is obsolete: true
Attachment #808217 - Flags: review?(jmuizelaar)
Attachment #808221 - Flags: review?(jmuizelaar)
Depends on: 919225
Hadn't correctly refreshed this patch.
Attachment #808221 - Attachment is obsolete: true
Attachment #808221 - Flags: review?(jmuizelaar)
Attachment #808327 - Flags: review?(jmuizelaar)
Comment on attachment 808216 [details] [diff] [review]
Split nsMainThreadSurfaceRef out of gfxASurface.h, into ImageContainer.h

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

::: gfx/layers/ImageContainer.h
@@ +79,5 @@
> +  }
> +};
> +
> +#endif
> +

It would be good to move this into ImageContainer.cpp if possible.
Attachment #808216 - Flags: review?(jmuizelaar) → review+
Attachment #808327 - Flags: review?(jmuizelaar) → review+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: