Closed Bug 573027 Opened 14 years ago Closed 3 years ago

with directwrite, vertical positioning of text depends on opacity

Categories

(Core :: Graphics, defect)

x86
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: jfkthame, Assigned: bas.schouten)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

Possibly related to bug 550431, or another symptom of the same underlying issue.

With DirectWrite enabled, the vertical positioning of text changes slightly, depending on the particular HTML elements in use, when using the canvas painting path rather than an actual browser window. One way to trigger this is if opacity is used to make the text semi-transparent.

This is the cause of a number of reftest failures with dwrite, including layout/reftests/bidi/413928-*. These work correctly in the browser window, but fail under the reftest framework, because of the different painting paths used.

The attached sample based on reftest 413928 demonstrates the issue; it allows you to flip between a "testcase" using an ordered list, and a "reference" that uses simple <div>s. Without the 50% opacity option, the two display identically; but when 50% opacity is enabled, the testcase and reference no longer match.
Blocks: 549832
This is related to the fact that for non-opaque glyphs (or rendering to non-opaque surfaces) our code applies intermediate surfaces that cause us to render using a fallback path. I'm currently investigating and fixing some things in our fallback in the meanwhile.
If we set the fallback path to : 'DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL' (we lose sub-pixel vertical anti-aliasing). This problem indeed disappears. Currently we're forcing the fallback to enable vertical anti-aliasing, but we're not forcing the normal path to. This is because for the normal path we're allowed to use DWRITE_RENDERING_MODE_DEFAULT, which switches rendering modes based on font sizes. For the font size of the test cases vertical AA will be disabled.

The RENDERING_MODE_DEFAULT is not available for the CreateGlyphRunAnalysis we're using to get the alpha texture for our fallback path.
This will use the recommended rendering mode for the current font configuration in the fallback path. This will provide the results most similar to the normal rendering path. Some follow-up patches will come to properly handle subpixel-AA in the fallback path.
Assignee: nobody → bas.schouten
Status: NEW → ASSIGNED
Attachment #455495 - Flags: review?(jmuizelaar)
Attachment #455495 - Flags: review?(jmuizelaar) → review+
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: