Closed Bug 1316750 Opened 8 years ago Closed 8 years ago

mozPrintCallback stopped producing vector output again for non-remote printing

Categories

(Core :: Printing: Output, defect)

52 Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla53
Tracking Status
firefox53 --- fixed

People

(Reporter: haik, Assigned: jwatt)

References

Details

Attachments

(4 files)

Attached file Test case
The problem fixed by bug 1308259 "mozPrintCallback stoped producing vector output" is reproducible again.

mozregression led me to bug 1280324 "Provide a way to get a reference DrawTarget from PrintTargets, and fix various nsDeviceContext::CreateRenderingContext consumers to get a reference context".

  $ mozregression -g 2016-10-17 --pref "print.print_via_parent:false" "security.sandbox.content.level:0"

There's a known issue with mozPrintCallback on Nightly with Mac remote printing (1310165), but this issue affects non-remote printing which is used in Aurora/Beta/Release right now and that is what was fixed by 1308259. The above prefs need to be set to test non-remote printing on Nightly.

I've only tested on Mac so far.

To use the test case, print to PDF, and then check whether or not the added "Test" text under "data: loading print" and "api loading print" is selectable or a single bitmap. It should be selectable. By selectable, I mean that individual characters can be highlighted, not just the whole word as an image.
Blocks: 1280324
This reproduces for me on Windows 10 Nightly on a fresh profile with no prefs set.
Flags: needinfo?(jwatt)
When we're under the stack:

  PrintTarget::GetReferenceDrawTarget
  nsDeviceContext::CreateRenderingContextCommon
  nsDeviceContext::CreateReferenceRenderingContext
  nsSimplePageSequenceFrame::PrePrintNextPage
  nsPrintEngine::PrePrintPage

we call cairo_surface_create_similar. That doesn't do the correct thing for CAIRO_SURFACE_TYPE_QUARTZ and CAIRO_SURFACE_TYPE_WIN32 surfaces. We need to special case these surface types to make sure that the new "similar" surface that we create is also a vector backed surface.
Assignee: nobody → jwatt
Flags: needinfo?(jwatt)
Attached patch patchSplinter Review
Attachment #8810251 - Flags: review?(edwin)
Pushed by jwatt@jwatt.org:
https://hg.mozilla.org/integration/mozilla-inbound/rev/9508c116ecd7
Add special case handling for CAIRO_SURFACE_TYPE_WIN32 and CAIRO_SURFACE_TYPE_QUARTZ in PrintTarget::GetReferenceDrawTarget. r=edwin
Pushed by jwatt@jwatt.org:
https://hg.mozilla.org/integration/mozilla-inbound/rev/732a96ceaf9f
Back out the CAIRO_SURFACE_TYPE_WIN32 code to fix bustage. r=me CLOSED TREE
Pushed by jwatt@jwatt.org:
https://hg.mozilla.org/integration/mozilla-inbound/rev/fb46a1dc34f9
Fix CAIRO_SURFACE_TYPE_WIN32 warnings as errors case. r=me CLOSED TREE
Pushed by jwatt@jwatt.org:
https://hg.mozilla.org/integration/mozilla-inbound/rev/e222819961af
part 2 - Add CairoContentToCairoFormat helper to HelpersCairo.h. r=edwin
https://hg.mozilla.org/integration/mozilla-inbound/rev/c0d0caa11f5a
part 3 - Add special case code to handle CAIRO_SURFACE_TYPE_WIN32 in PrintTarget::GetReferenceDrawTarget. r=edwin
The same intermittent failure showed up on your backout commit too:

https://treeherder.mozilla.org/#/jobs?repo=mozilla-inbound&revision=91b1add28ef64ca507a1c1c14db2031ae37c992b

It seems to have mysteriously disappeared some time after that though. I've triggered some more rebuilds, but based on current evidence I'd be inclined to think the failure isn't related to the changes I landed and reland these patches.
Flags: needinfo?(jwatt) → needinfo?(wkocher)
Summary: mozPrintCallback stopped producing vector output again for Mac non-remote printing → mozPrintCallback stopped producing vector output again for non-remote printing
Yeah, it really looks like my patches had nothing to do with that failure. I'll reland part 3 separately from parts 1 and 2 though.
Flags: needinfo?(wkocher)
Pushed by jwatt@jwatt.org:
https://hg.mozilla.org/integration/mozilla-inbound/rev/c313bf4cfde9
part 1 - Add special case handling for CAIRO_SURFACE_TYPE_QUARTZ to PrintTarget::GetReferenceDrawTarget. r=edwin
https://hg.mozilla.org/integration/mozilla-inbound/rev/8fedd88f6488
part 2 - Add CairoContentToCairoFormat helper to HelpersCairo.h. r=edwin
(In reply to Jonathan Watt [:jwatt] from comment #12)
> Yeah, it really looks like my patches had nothing to do with that failure.
> I'll reland part 3 separately from parts 1 and 2 though.

Here's another example of a job where the failure shows up long after the backouts:

https://treeherder.mozilla.org/#/jobs?repo=mozilla-inbound&revision=be0a409b178acc10fc89b0d528c78a03755d89e4

And another where there is an OOM crash (OOM being a likely cause of the failure to create the DrawTarget with Size(800,1000)):

https://treeherder.mozilla.org/#/jobs?repo=mozilla-inbound&revision=55ceefe2f5aa83f8bf08ba43be938ad92c2bee22
Pushed by jwatt@jwatt.org:
https://hg.mozilla.org/integration/mozilla-inbound/rev/ba22cd08d123
part 3 - Add special case code to handle CAIRO_SURFACE_TYPE_WIN32 in PrintTarget::GetReferenceDrawTarget. r=edwin
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: