Improve picture surface scaling calculation
Categories
(Core :: Graphics: WebRender, enhancement)
Tracking
()
Tracking | Status | |
---|---|---|
firefox78 | --- | fixed |
People
(Reporter: cbrewster, Assigned: cbrewster)
References
Details
Attachments
(2 files)
In bug 1559861, I added some code to adjust the device pixel scale of raster roots to be dependent on the scale factor of the raster roots transform.
This ensures that the content of the intermediate surface is rendered large enough so that it does not get blurry when composited into the parent surface.
While the raster root pictures now pick the correct device pixel scale, non-raster root pictures do not always pick the right scale.
Example case from my comment on https://phabricator.services.mozilla.com/D75236:
I did some more thinking about my original comment with nested raster roots, I think I have a clearer idea of where we could do better with picking the right scale for each picture surface.
Consider a scene like the following:
[Root Picture] \ \ [Picture with Perspective Transform + 10x Scale] (Raster Root) (Scaling factor: 10) \ \ [Picture with opacity filter] (Not Raster Root) (Scaling factor: 1) \ \ (identity transform here) \ [Text Primitive] (10x10)
The text will end up being 100x100 when finally rendered in the root picture, but it will initially be rendered as 10x10 which results in blurry output.
This happens because the picture with the opacity filter wants to render in screen space (since it does not form a raster root) in that case it looks at the surface to parent transform which is an identity transform in this case.
It seems like we need a way to let the child pictures of a raster root picture know the chosen scale for the raster root.
Pictures that do not form a raster root render in screen space. However, with raster roots, I believe the picture should render in the space of its nearest ancestor raster root (screen space if there are no raster roots).
Instead of using frame_context.global_device_pixel_scale
as the device pixel scale for all non-raster root pictures, we should get the device pixel scale of the nearest raster root ancestor.
Assignee | ||
Comment 1•5 years ago
|
||
Updated•5 years ago
|
Comment 3•5 years ago
|
||
bugherder |
Description
•