Open Bug 1767368 Opened 4 years ago Updated 4 years ago

canvas text rendering issue because of Direct2d backend in Windows

Categories

(Core :: Graphics: Canvas2D, defect, P3)

defect

Tracking

()

UNCONFIRMED

People

(Reporter: 854185073, Unassigned, NeedInfo)

Details

Attachments

(4 files, 1 obsolete file)

Attached file canvas-text-bug.html (obsolete) —

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:99.0) Gecko/20100101 Firefox/99.0

Steps to reproduce:

i put one chinese character across two adjacent canvases to draw.

Actual results:

i found that the right-side canvas has a wrong result. the pixels in the first one-pixel-width column are vanished, i think the left position of the text is calculated is wrong.
but chrome which is using skia performed well.

i spent a long time to investigate it, and i found that if the flag 'gfx.direct2d.disabled' is enabled, the problem is solved. or change rendering backend by removing 'direct2d1.1' in 'gfx.canvas.azure.backends' and restart firefox.

so i assume that it's a direct2d problem, i create a visual studio project and a Direct2D example, using the same transform and text layout rect to draw the text, the rendered result is totally same buggy.

Expected results:

the character is drawn normal just like it's in one canvas.

The Bugbug bot thinks this bug should belong to the 'Core::Graphics' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Graphics
Product: Firefox → Core
Component: Graphics → Canvas: 2D
Severity: -- → S3
Priority: -- → P3

Jonathan, ideas?

Flags: needinfo?(jfkthame)
Attachment #9274753 - Attachment is obsolete: true
Attached file canvas-text-bug.html —

install the font "宋体"(SimSun) first to reproduce this.

Attached image firefox-behavior.png —
Attached image expected.png —

just 5 lines of js codes to reproduce this.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: