Bug 1441308 - Fix picture-caching interaction with doc spitting r=gw
authorDoug Thayer <dothayer@mozilla.com>
Thu, 28 Feb 2019 19:15:15 +0000
changeset 519693 48bf7d6e2ea7be2eff20cafdbb4c79dfd3706e8e
parent 519692 c13d34779fe8bdbe75ef8ab58f5da88f1d017dbc
child 519694 1a48f163c0f24e07837ff258ca72f2bfe658a183
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgw
bugs1441308
milestone67.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 1441308 - Fix picture-caching interaction with doc spitting r=gw This is a stab at what the correct approach to this should be. It seems that we should be using the window size here and not the screen_rect, as the screen_rect is not used to offset what we normally draw, but instead generally for scissoring(?). The end result is if we use an offset screen_rect, we end up applying the offset of the chrome area twice, once because the document's screen rect is offset, and once because of the tile.world_rect offset. Depends on D20696 Differential Revision: https://phabricator.services.mozilla.com/D20698
gfx/wr/webrender/src/frame_builder.rs
--- a/gfx/wr/webrender/src/frame_builder.rs
+++ b/gfx/wr/webrender/src/frame_builder.rs
@@ -470,18 +470,21 @@ impl FrameBuilder {
 
         frame_state.pop_dirty_region();
 
         let child_tasks = frame_state
             .surfaces[ROOT_SURFACE_INDEX.0]
             .take_render_tasks();
 
         let root_render_task = RenderTask::new_picture(
-            RenderTaskLocation::Fixed(self.screen_rect.to_i32()),
-            self.screen_rect.size.to_f32(),
+            // The rect here is the whole window. If we were to use the screen_rect,
+            // any offset in that rect would doubly apply for cached pictures.
+            RenderTaskLocation::Fixed(DeviceIntRect::new(DeviceIntPoint::zero(),
+                                                         self.window_size).to_i32()),
+            self.window_size.to_f32(),
             self.root_pic_index,
             DeviceIntPoint::zero(),
             child_tasks,
             UvRectKind::Rect,
             root_spatial_node_index,
             global_device_pixel_scale,
         );