Closed Bug 1285207 Opened 3 years ago Closed 3 years ago

Non-recording draw target being used for printing on Windows.


(Core :: Graphics, defect)

Not set



Tracking Status
firefox50 + fixed


(Reporter: bobowen, Assigned: nical)




(1 file)

Changes in bug 1167235 mean I'm getting a MOZ_ASSERT whenever I try and print a pdf.
I think printing (on Windows) will be broken anyway when it uses this code, because we need any DrawTargets to be the original DrawTargetRecording or one created from it.

Assertion here:

I think the problem is probably here, there may be other places:

Instead of creating a new DrawTarget, I think we need to pass in the existing one and use that or one from CreateSimilarDrawTarget.
Flags: needinfo?(nical.bugzilla)
Yes. I don't know what wen through my mind when I modified GetBufferProvider the way I did, but the function is completely nonsensical in its current state. I have a patch that fixes printing canvases, will upload asap.
Flags: needinfo?(nical.bugzilla)
QA Contact: nical.bugzilla
Assignee: nobody → nical.bugzilla
Attachment #8768846 - Flags: review?(bas)
Just tried a simple PDF and it printed with this patch, thanks.
Comment on attachment 8768846 [details] [diff] [review]
Avoid having a DrawTarget without its corresponding BufferProvider

Bas is on PTO today and I'd like to get canvas working again on nightly asap, so transferring the reviews to you, Lee.

This patch makes sure we always have a BufferProvider if we have a DrawTarget. This is to prevent cases where we create the canvas wrapping it around a DrawTarget (as we apparently do for printing) without using a BufferProvider. In this situation we currently end up seeing that there is no provider and create one that may not work with the existing DrawTarget and/or may try to overwrite it.
Attachment #8768846 - Flags: review?(bas) → review?(lsalzman)
Attachment #8768846 - Flags: review?(lsalzman) → review+
Pushed by
Don't let canvas have a DrawTarget without a BufferProvider and keep them in sync. r=lsalzman
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla50
Resolution: FIXED → ---
Target Milestone: mozilla50 → ---
Duplicate of this bug: 1285730
Tracking 50+ since this makes pages print blank (according to Bug 1285730).
Pushed by
Don't let canvas have a DrawTarget without a BufferProvider and keep them in sync. r=lsalzman
Flags: needinfo?(nical.bugzilla)
Closed: 3 years ago3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla50
Depends on: 1287707
You need to log in before you can comment on or make changes to this bug.