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 461828 48bf7d6e2ea7be2eff20cafdbb4c79dfd3706e8e
parent 461827 c13d34779fe8bdbe75ef8ab58f5da88f1d017dbc
child 461829 1a48f163c0f24e07837ff258ca72f2bfe658a183
push id79308
push userdothayer@mozilla.com
push dateFri, 01 Mar 2019 00:30:22 +0000
treeherderautoland@48bf7d6e2ea7 [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,
         );