Bug 1546818 - Change WR text transform to be relative to the surface raster node r=gw
authorDzmitry Malyshau <dmalyshau@mozilla.com>
Thu, 04 Jul 2019 14:54:36 +0000
changeset 540947 877ce94bb4fd73ce1c51f5e221125ca3f66b3482
parent 540946 8b928b1224c7fe04f89d04170ec54b5d5c6ed61f
child 540948 97aaa4f82a77b68eab75ce4f97f4c6afea117654
push id11533
push userarchaeopteryx@coole-files.de
push dateMon, 08 Jul 2019 18:18:03 +0000
treeherdermozilla-beta@f4452e031aed [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgw
bugs1546818
milestone69.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1546818 - Change WR text transform to be relative to the surface raster node r=gw a follow-up to D36603 that switches the base space from the surface node to the raster node. Differential Revision: https://phabricator.services.mozilla.com/D36828
gfx/wr/webrender/src/prim_store/mod.rs
--- a/gfx/wr/webrender/src/prim_store/mod.rs
+++ b/gfx/wr/webrender/src/prim_store/mod.rs
@@ -2830,27 +2830,24 @@ impl PrimitiveStore {
                 }
             }
             PrimitiveInstanceKind::TextRun { run_index, data_handle, .. } => {
                 let prim_data = &mut data_stores.text_run[*data_handle];
                 let run = &mut self.text_runs[*run_index];
 
                 prim_data.common.may_need_repetition = false;
 
-                // The glyph transform has to match `glyph_transform` in "ps_text_run" shader
+                // The glyph transform has to match `glyph_transform` in "ps_text_run" shader.
+                // It's relative to the rasterizing space of a glyph.
                 let transform = frame_context.clip_scroll_tree
-                    .get_world_transform(pic_context.surface_spatial_node_index)
-                    .inverse()
-                    .unwrap()
-                    .into_fast_transform()
-                    .pre_mul(
-                        &frame_context.clip_scroll_tree
-                            .get_world_transform(prim_instance.spatial_node_index)
-                            .into_fast_transform()
-                    );;
+                    .get_relative_transform(
+                        prim_instance.spatial_node_index,
+                        pic_context.raster_spatial_node_index,
+                    )
+                    .into_fast_transform();
                 let prim_offset = prim_instance.prim_origin.to_vector() - run.reference_frame_relative_offset;
 
                 let pic = &self.pictures[pic_context.pic_index.0];
                 let raster_space = pic.get_raster_space(frame_context.clip_scroll_tree);
                 let surface = &frame_state.surfaces[pic_context.surface_index.0];
 
                 run.request_resources(
                     prim_offset,