Bug 1632443 - Fix pinch-zoom rendering when partial present is enabled. r=sotaro
authorGlenn Watson <git@intuitionlibrary.com>
Wed, 20 May 2020 05:33:06 +0000
changeset 530955 837b1bff6998a5a34978777dac555a642fd203bd
parent 530954 0b8d520d2aa6ca00f0028426728ac9b5b5d6ed5a
child 530956 0cb049134f60c2e794f0e31d5c1971a0aa766375
push id37435
push userapavel@mozilla.com
push dateWed, 20 May 2020 15:28:23 +0000
treeherdermozilla-central@5415da14ec9a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssotaro
bugs1632443
milestone78.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 1632443 - Fix pinch-zoom rendering when partial present is enabled. r=sotaro WR currently disables picture caching during a pinch-zoom, if the native compositor is disabled (since there's no real performance gain to be had from caching tiles during a pinch-zoom). However, this code path was not returning a dirty rect to the caller code. For callers that take advantage of partial present, this meant the screen was assumed to have no changes, and so the swapbuffers is skipped incorrectly. Differential Revision: https://phabricator.services.mozilla.com/D76081
gfx/wr/webrender/src/renderer.rs
--- a/gfx/wr/webrender/src/renderer.rs
+++ b/gfx/wr/webrender/src/renderer.rs
@@ -5882,16 +5882,23 @@ impl Renderer {
                                 let clear_color = self.clear_color.map(|color| color.to_array());
                                 self.device.bind_draw_target(draw_target);
                                 self.device.enable_depth_write();
                                 self.device.clear_target(clear_color,
                                                          Some(1.0),
                                                          None);
                             }
 
+                            // If picture caching is disabled, we will be drawing the entire
+                            // framebuffer. In that case, we need to push a screen size dirty
+                            // rect, in case partial present is enabled (an empty array of
+                            // dirty rects when partial present is enabled is interpreted by
+                            // Gecko as meaning nothing has changed and a swap is not required).
+                            results.dirty_rects.push(frame.device_rect);
+
                             self.draw_color_target(
                                 draw_target,
                                 main_target,
                                 frame.content_origin,
                                 None,
                                 None,
                                 &frame.render_tasks,
                                 &projection,