Closed Bug 1643620 Opened 5 years ago Closed 5 years ago

zoom in on pdf in pdf.js BeginDraw call fails and falls back to d3d 11 layers

Categories

(Core :: Graphics: WebRender, defect)

Unspecified
Windows
defect

Tracking

()

RESOLVED FIXED
mozilla79
Tracking Status
firefox-esr68 --- unaffected
firefox76 --- unaffected
firefox77 --- unaffected
firefox78 --- fixed
firefox79 --- fixed

People

(Reporter: tnikkel, Assigned: bpeers)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: regression)

Attachments

(4 files)

Open
https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf

It should open in pdf.js inside firefox. Hit ctrl-+ until you reach the maximum zoom. The window will go all white and you will lose webrender. In the console you'll get BeginDraw failed and some other error messages.

Regression range

https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=77e7a549&tochange=caa55d22

Note the pdf is the first result for "example pdf", so I suspect it is not a weird pdf.

Flags: needinfo?(bpeers)
Attached file aboutsupportbefore.txt
Attached file aboutsupportafter.txt

Can't repro with integrated Intel HD Graphics 630 on Win10 1909. Firefox just becomes slow. (HP Pavilion Power 580-023w)

Blocks: wr-stability
Has Regression Range: --- → yes
Keywords: regression
OS: Unspecified → Windows

:bpeers, can you take a bug? It seemed to be caused by Bug 1628175.

Severity: -- → S1

The error looks similar to Bug 1628901.

See Also: → 1628901
Flags: needinfo?(jbonisteel)

After zooming, the PDF also scrolls jankily (intel HD5500 mobile iGPU) : https://share.firefox.dev/2A5TEer

Assignee: nobody → bpeers
Flags: needinfo?(bpeers)
Attached image bug1643620_pdf_zoom.png

Thanks Timothy for finding the regression range and investigating!

I think the issue is that there is no bound on the size of the compositor surface that we might request.
Before my change I believe we had an "accidental" safety guard because past 300% the PDF stops increasing in resolution and instead uses a spatial node transform to scale the remaining part (up to 1000% at most, so another factor ~3.3. This transform would then stop can_promote_to_surface from saying "yes".

I changed this as the limitation is not necessary, and prevents a GL Canvas from being composited if the DPI setting is > 100%. But eventually we go past 16384 pixels and that's when we get "Invalid Parameter".

I added a safety similar to MAX_SURFACE_SIZE. With that, Webrender scales to 1000% and looks identical to non-Webrender.

Flags: needinfo?(jbonisteel)

Limit the maximum size of surface requests sent to the compositor.

Attachment #9154696 - Attachment description: Bug 1643620 - zoom in on pdf in pdf.js BeginDraw call fails → Bug 1643620 - zoom in on pdf in pdf.js BeginDraw call fails r=gw
Pushed by bpeers@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/efb85cb15046 zoom in on pdf in pdf.js BeginDraw call fails r=gw
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla79
Blocks: wr-78
No longer blocks: gfx-triage

The patch landed in nightly and beta is affected.
:bpeers, is this bug important enough to require an uplift?
If not please set status_beta to wontfix.

For more information, please visit auto_nag documentation.

Flags: needinfo?(bpeers)

Comment on attachment 9154696 [details]
Bug 1643620 - zoom in on pdf in pdf.js BeginDraw call fails r=gw

Beta/Release Uplift Approval Request

  • User impact if declined: Rendering errors and corrupt visuals when zooming in on PDF files when using WebRender.
  • Is this code covered by automated tests?: No
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Patch introduce a maximum-size safety limit and falls back to an existing code branch in that case; no new code or functionality is added.
  • String changes made/needed:
Flags: needinfo?(bpeers)
Attachment #9154696 - Flags: approval-mozilla-beta?

Requested uplift due to Severity S1.

Edit: I guess "no new code" is not phrased well under "Risks"; what I meant is we select between a fast path and a slow path (compositor/no compositor) and both paths are pre-existing, the patch is just more careful about the conditions under which the fast path can apply. Thanks.

Comment on attachment 9154696 [details]
Bug 1643620 - zoom in on pdf in pdf.js BeginDraw call fails r=gw

approved for 78.0b7

Attachment #9154696 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: