Closed Bug 1278269 Opened 3 years ago Closed 3 years ago

Make a PrintTarget class and PrintTargetThebes subclass and convert all nsIDeviceContextSpec subclasses to use them

Categories

(Core :: Graphics, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla50
Tracking Status
firefox50 --- fixed

People

(Reporter: jwatt, Assigned: jwatt)

References

Details

Attachments

(1 file, 1 obsolete file)

Attached patch patch (obsolete) — Splinter Review
This patch:

 * Creates a PrintTarget base class to wrap a cairo_surface_t,
   provide a DrawTarget to draw, and provide checkpointing
   methods so consumers can ensure the cairo_surface_t's state
   is updated when they need it to be.

 * Creates a PrintTargetThebes subclass that wraps a gfxASurface
   to ease the transition away from gfxASurface. This class will
   be removed once that transition is completed.

 * Makes all of the nsIDeviceContextSpec subclasses use
   PrintTargetThebes for now.

Note that PrintTarget's API is structured a bit weirdly to allow the code in nsDeviceContext.cpp to keep doing exactly what it is doing just now. Specifically see the big comment for MakeDrawTarget. I'll change that later to get a cached DrawTarget that is created by the CreateOrNull factory method, but I need to figure out what causes the Mochitest regressions when that is done in a straightforward way.
Attachment #8760292 - Flags: review?(bas)
Blocks: 1278276
Blocks: 1278278
Blocks: 1278246
Blocks: 1278441
Attached patch patchSplinter Review
Adds a Finish() method since we're going to need that for the patches that build on this.
Attachment #8760292 - Attachment is obsolete: true
Attachment #8760292 - Flags: review?(bas)
Attachment #8760692 - Flags: review?(bas)
Attachment #8760692 - Flags: review?(bas) → review+
Comment on attachment 8760692 [details] [diff] [review]
patch

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

This should probably get one or two additional reviewers for the widget code? But I think it's fine.
Pushed by jwatt@jwatt.org:
https://hg.mozilla.org/integration/mozilla-inbound/rev/b70203799e11
Make a PrintTarget class and PrintTargetThebes subclass and convert all nsIDeviceContextSpec subclasses to use them. r=Bas
https://hg.mozilla.org/mozilla-central/rev/b70203799e11
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla50
You need to log in before you can comment on or make changes to this bug.