Closed Bug 1285207 Opened 3 years ago Closed 3 years ago
Non-recording draw target being used for printing on Windows
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.
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.
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 email@example.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
Backed out as part of https://hg.mozilla.org/integration/mozilla-inbound/rev/84b0f9eb63d0 for bustage: https://treeherder.mozilla.org/logviewer.html#?job_id=31451108&repo=mozilla-inbound
Tracking 50+ since this makes pages print blank (according to Bug 1285730).
Pushed by firstname.lastname@example.org: 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
You need to log in before you can comment on or make changes to this bug.