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

RESOLVED FIXED in Firefox 50

Status

()

Core
Graphics
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: bobowen, Assigned: nical)

Tracking

unspecified
mozilla50
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox50+ fixed)

Details

Attachments

(1 attachment)

(Reporter)

Description

2 years ago
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)
(Assignee)

Comment 1

2 years ago
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)

Comment 2

2 years ago
Created attachment 8768846 [details] [diff] [review]
Avoid having a DrawTarget without its corresponding BufferProvider
Assignee: nobody → nical.bugzilla
Attachment #8768846 - Flags: review?(bas)
(Reporter)

Comment 3

2 years ago
Just tried a simple PDF and it printed with this patch, thanks.
(Assignee)

Comment 4

2 years ago
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+

Comment 5

2 years ago
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

Comment 7

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/b7f2d54f3904
Status: NEW → RESOLVED
Last Resolved: 2 years ago
status-firefox50: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla50

Updated

2 years ago
Status: RESOLVED → REOPENED
status-firefox50: fixed → ---
Resolution: FIXED → ---
Target Milestone: mozilla50 → ---

Updated

2 years ago
Duplicate of this bug: 1285730
Tracking 50+ since this makes pages print blank (according to Bug 1285730).
status-firefox50: --- → affected
tracking-firefox50: --- → +

Comment 10

2 years ago
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
(Assignee)

Updated

2 years ago
Flags: needinfo?(nical.bugzilla)

Comment 11

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/da1046d9acb7
Status: REOPENED → RESOLVED
Last Resolved: 2 years ago2 years ago
status-firefox50: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla50

Updated

2 years ago
Depends on: 1287707
You need to log in before you can comment on or make changes to this bug.