Closed Bug 1617160 Opened 1 month ago Closed 1 month ago

Fold raster scale and device pixel scale into font transform, not font size

Categories

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

defect

Tracking

()

RESOLVED FIXED
mozilla75
Tracking Status
firefox75 --- fixed

People

(Reporter: aosmond, Assigned: aosmond)

References

(Blocks 2 open bugs)

Details

Attachments

(1 file)

Currently with fonts, when we use RasterSpace::Local(raster_scale), we fold raster_scale into the font size. For both RasterSpace::Local and RasterSpace::Screen, we fold device pixel scale into the font size as well. The font size is presented using Au, not f32, and as such suffers from quantization effects (resolution of 1/60). When we replicate the scaling impact in the shader, there is a quantization effect on the raster scale (resolution of 1/65536) which is likely not meaningful and none on the device pixel scale. We should try to match these behaviours as closely as possible. This will help avoid error accumulation when drawing glyphs, which can be quite sensitive to it.

This patch folds the raster scale and device pixel scale effects into
the font transform, instead of the font size itself. This helps minimize
the quantization effect given the font size is stored as an Au
(resolution of 1/60) instead of an f32, and the shader does not
replicate that effect.

Pushed by aosmond@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/3b8e7a5e093d
Fold the raster scale and device pixel scale into font transform. r=lsalzman

Push with failures: https://treeherder.mozilla.org/#/jobs?repo=autoland&selectedJob=289939365&resultStatus=testfailed%2Cbusted%2Cexception&revision=3b8e7a5e093d7ba4717d3914a07ac46e59cdf8b9&searchStr=linux%2Cx64%2Cquantumrender%2Cdebug%2Cwebrender%2Cstandalone%2Cwebrender-linux-debug%2Cwr%28wrench%29

Failure log: https://treeherder.mozilla.org/logviewer.html#?job_id=289939365&repo=autoland

Backout link: https://hg.mozilla.org/integration/autoland/rev/88029a1e5e5ae1aab7ede64d4cf95d78dfd53911

[task 2020-02-21T19:19:14.438Z]    Compiling webrender_api v0.61.0 (/builds/worker/checkouts/gecko/gfx/wr/webrender_api)
[task 2020-02-21T19:19:14.439Z]      Running `rustc --edition=2018 --crate-name webrender_api webrender_api/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C panic=abort -C debuginfo=2 -C metadata=9fff59bf7f95a60e -C extra-filename=-9fff59bf7f95a60e --out-dir /builds/worker/checkouts/gecko/gfx/wr/target/debug/deps -C incremental=/builds/worker/checkouts/gecko/gfx/wr/target/debug/incremental -L dependency=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps --extern app_units=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps/libapp_units-dffbb1163ad59a44.rmeta --extern bitflags=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps/libbitflags-564b869b3517d038.rmeta --extern byteorder=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps/libbyteorder-5e2060d06e55e380.rmeta --extern derive_more=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps/libderive_more-35d61001b9a163b8.so --extern euclid=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps/libeuclid-1c2341fcfe45752d.rmeta --extern malloc_size_of_derive=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps/libmalloc_size_of_derive-801ebb2b48d91adb.so --extern peek_poke=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps/libpeek_poke-d2c5db7b5f771631.rmeta --extern serde=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps/libserde-d976e614dfa55b4e.rmeta --extern serde_bytes=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps/libserde_bytes-09fd3b2a72789732.rmeta --extern serde_derive=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps/libserde_derive-55a8e008d6f13a00.so --extern time=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps/libtime-8e3de7500034ed3d.rmeta --extern malloc_size_of=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps/libwr_malloc_size_of-d787e570fddf4bb4.rmeta --deny warnings`
[task 2020-02-21T19:19:24.259Z]      Running `rustc --edition=2018 --crate-name webrender webrender/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C panic=abort -C debuginfo=2 -C metadata=ea04f7c0ebc7d0a4 -C extra-filename=-ea04f7c0ebc7d0a4 --out-dir /builds/worker/checkouts/gecko/gfx/wr/target/debug/deps -C incremental=/builds/worker/checkouts/gecko/gfx/wr/target/debug/incremental -L dependency=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps --extern bincode=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps/libbincode-5cf631e72cf3d910.rmeta --extern bitflags=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps/libbitflags-564b869b3517d038.rmeta --extern byteorder=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps/libbyteorder-5e2060d06e55e380.rmeta --extern cfg_if=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps/libcfg_if-9951acf31a9af4dd.rmeta --extern cstr=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps/libcstr-73beb41c279f40fa.rmeta --extern euclid=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps/libeuclid-1c2341fcfe45752d.rmeta --extern freetype=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps/libfreetype-f870566064be6ebc.rmeta --extern fxhash=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps/libfxhash-3fce82e2c3a9de1e.rmeta --extern gleam=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps/libgleam-22479969849b127b.rmeta --extern lazy_static=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps/liblazy_static-6042fa25f448506a.rmeta --extern libc=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps/liblibc-8b0da61329cb85df.rmeta --extern log=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps/liblog-daa7d4ebf1bffaf8.rmeta --extern malloc_size_of_derive=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps/libmalloc_size_of_derive-801ebb2b48d91adb.so --extern num_traits=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps/libnum_traits-cf5fc59e8091ef65.rmeta --extern plane_split=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps/libplane_split-e8c55dca532217f1.rmeta --extern rayon=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps/librayon-2a3b4d23ce832e29.rmeta --extern sha2=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps/libsha2-2ea14bc2c88e8636.rmeta --extern smallvec=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps/libsmallvec-768c33f72d34d37c.rmeta --extern svg_fmt=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps/libsvg_fmt-f8d96677b75c7931.rmeta --extern thread_profiler=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps/libthread_profiler-7f51aaeb0769f33e.rmeta --extern time=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps/libtime-8e3de7500034ed3d.rmeta --extern api=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps/libwebrender_api-9fff59bf7f95a60e.rmeta --extern webrender_build=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps/libwebrender_build-29a694fbfead681e.rmeta --extern malloc_size_of=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps/libwr_malloc_size_of-d787e570fddf4bb4.rmeta --deny warnings`
[task 2020-02-21T19:19:33.690Z] error: method is never used: `is_identity`
[task 2020-02-21T19:19:33.690Z]    --> webrender/src/glyph_rasterizer/mod.rs:295:5
[task 2020-02-21T19:19:33.690Z]     |
[task 2020-02-21T19:19:33.690Z] 295 |     pub fn is_identity(&self) -> bool {
[task 2020-02-21T19:19:33.690Z]     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[task 2020-02-21T19:19:33.690Z]     |
[task 2020-02-21T19:19:33.690Z]     = note: `-D dead-code` implied by `-D warnings`
[task 2020-02-21T19:19:33.690Z] 
[task 2020-02-21T19:19:34.082Z] error: aborting due to previous error
[task 2020-02-21T19:19:34.082Z] 
[task 2020-02-21T19:19:34.114Z] error: could not compile `webrender`.
[task 2020-02-21T19:19:34.114Z] 
[task 2020-02-21T19:19:34.114Z] Caused by:
[task 2020-02-21T19:19:34.114Z]   process didn't exit successfully: `rustc --edition=2018 --crate-name webrender webrender/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C panic=abort -C debuginfo=2 -C metadata=ea04f7c0ebc7d0a4 -C extra-filename=-ea04f7c0ebc7d0a4 --out-dir /builds/worker/checkouts/gecko/gfx/wr/target/debug/deps -C incremental=/builds/worker/checkouts/gecko/gfx/wr/target/debug/incremental -L dependency=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps --extern bincode=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps/libbincode-5cf631e72cf3d910.rmeta --extern bitflags=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps/libbitflags-564b869b3517d038.rmeta --extern byteorder=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps/libbyteorder-5e2060d06e55e380.rmeta --extern cfg_if=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps/libcfg_if-9951acf31a9af4dd.rmeta --extern cstr=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps/libcstr-73beb41c279f40fa.rmeta --extern euclid=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps/libeuclid-1c2341fcfe45752d.rmeta --extern freetype=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps/libfreetype-f870566064be6ebc.rmeta --extern fxhash=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps/libfxhash-3fce82e2c3a9de1e.rmeta --extern gleam=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps/libgleam-22479969849b127b.rmeta --extern lazy_static=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps/liblazy_static-6042fa25f448506a.rmeta --extern libc=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps/liblibc-8b0da61329cb85df.rmeta --extern log=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps/liblog-daa7d4ebf1bffaf8.rmeta --extern malloc_size_of_derive=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps/libmalloc_size_of_derive-801ebb2b48d91adb.so --extern num_traits=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps/libnum_traits-cf5fc59e8091ef65.rmeta --extern plane_split=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps/libplane_split-e8c55dca532217f1.rmeta --extern rayon=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps/librayon-2a3b4d23ce832e29.rmeta --extern sha2=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps/libsha2-2ea14bc2c88e8636.rmeta --extern smallvec=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps/libsmallvec-768c33f72d34d37c.rmeta --extern svg_fmt=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps/libsvg_fmt-f8d96677b75c7931.rmeta --extern thread_profiler=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps/libthread_profiler-7f51aaeb0769f33e.rmeta --extern time=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps/libtime-8e3de7500034ed3d.rmeta --extern api=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps/libwebrender_api-9fff59bf7f95a60e.rmeta --extern webrender_build=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps/libwebrender_build-29a694fbfead681e.rmeta --extern malloc_size_of=/builds/worker/checkouts/gecko/gfx/wr/target/debug/deps/libwr_malloc_size_of-d787e570fddf4bb4.rmeta --deny warnings` (exit code: 1)
[fetches 2020-02-21T19:19:34.116Z] removing /builds/worker/fetches
[fetches 2020-02-21T19:19:34.212Z] finished
[taskcluster 2020-02-21 19:19:34.567Z] === Task Finished ===
[taskcluster 2020-02-21 19:19:34.568Z] Unsuccessful task run with exit code: 101 completed in 163.429 seconds
Flags: needinfo?(aosmond)
Flags: needinfo?(aosmond)
Pushed by aosmond@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/dd93a477ee78
Fold the raster scale and device pixel scale into font transform. r=lsalzman
Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla75
You need to log in before you can comment on or make changes to this bug.