Closed Bug 1564185 Opened 5 years ago Closed 5 years ago

Text gets blurry when zoomed in too far on webrender on android

Categories

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

Unspecified
Android
defect

Tracking

()

RESOLVED FIXED
mozilla70
Tracking Status
firefox70 --- fixed

People

(Reporter: jnicol, Assigned: jnicol)

References

Details

Attachments

(1 file)

STR: Open mozilla.org and zoom in as far as possible to the "Live your life. Own your life" text (the largest text on the page). Once you stop zooming it's very blurry.

This probably affects desktop too, but is more likely to be hit on android where it's easier to zoom in very far.

I think what's going on is that in TextRunPrimitive::update_font_instance() we calculate if the font_size * transform exceeds FONT_SIZE_LIMIT. If it doesn't exceed, then we rasterize in screen space (by setting the font_transform = transform), but if it does, then we we rasterize in local space. During zooming this is fine, because we have set a sensible raster scale. But at steady-state when fully zoomed in, the raster scale is probably 1.0, which means we rasterize the glyph at the small font size, and then it gets heavily scaled and is therefore blurry.

I think what we should do in this case is set the raster scale so that we rasterize the glyph at the font size limit rather than at the specified font size. It should then require a lot less scaling and won't look nearly as blurry.

That explanation wasn't very nice. Basically, once the desired font size gets too big we give up trying to rasterize glyphs any larger than the default font size. So they get scaled too much. But we should really try to rasterize them as large as possible, so that we then have to scale them as little as possible.

Type: enhancement → defect

When rendering text in webrender we rasterize glyphs either in local
space at a chosen raster scale, or in device space taking in to
account to text's transform.

We are not able to rasterize glyphs larger than a certain size,
however. So if the transformed font size exceeds this limit, then
currently we force the glyph to be rasterized in local space, at the
untransformed font size. This must then be scaled by the shader when
rendering text, and at high zoom levels this will result in blurry
text.

This change makes it so that rather than rasterizing at the
untransformed font size we rasterize at the font size limit. This will
mean the glyphs are rasterized at a larger size and will therefore
require less scaling, meaning they will appear less blurry.

Pushed by jnicol@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9841254ef840 Rasterize glyphs as large as possible to avoid blurriness at high zoom levels. r=lsalzman
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: