Closed Bug 1285207 Opened 3 years ago Closed 3 years ago

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

Categories

(Core :: Graphics, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla50
Tracking Status
firefox50 + fixed

People

(Reporter: bobowen, Assigned: nical)

References

Details

Attachments

(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:
http://searchfox.org/mozilla-central/rev/a7c8e9f3cc323fd707659175a46826ad12899cd1/gfx/layers/PersistentBufferProvider.cpp#42

I think the problem is probably here, there may be other places:
http://searchfox.org/mozilla-central/rev/a7c8e9f3cc323fd707659175a46826ad12899cd1/dom/canvas/CanvasRenderingContext2D.cpp#5800

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 nsilva@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/b7f2d54f3904
Don't let canvas have a DrawTarget without a BufferProvider and keep them in sync. r=lsalzman
https://hg.mozilla.org/mozilla-central/rev/b7f2d54f3904
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla50
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Target Milestone: mozilla50 → ---
Duplicate of this bug: 1285730
Tracking 50+ since this makes pages print blank (according to Bug 1285730).
Pushed by nsilva@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/da1046d9acb7
Don't let canvas have a DrawTarget without a BufferProvider and keep them in sync. r=lsalzman
Flags: needinfo?(nical.bugzilla)
https://hg.mozilla.org/mozilla-central/rev/da1046d9acb7
Status: REOPENED → RESOLVED
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.