From fd33253d58a9cbdeb9c2a6d60fbc49f7df81f08f Mon Sep 17 00:00:00 2001 From: Glenn Watson Date: Mon, 11 Nov 2019 08:15:34 +0000 Subject: [PATCH] Bug 1593845 - Ensure picture cache dirty rect is clamped to tile rect. r=sotaro Differential Revision: https://phabricator.services.mozilla.com/D52493 --HG-- extra : moz-landing-system : lando --- gfx/wr/webrender/src/picture.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gfx/wr/webrender/src/picture.rs b/gfx/wr/webrender/src/picture.rs index be9e11dc472b..d062c5e8b131 100644 --- a/gfx/wr/webrender/src/picture.rs +++ b/gfx/wr/webrender/src/picture.rs @@ -924,6 +924,11 @@ impl Tile { self.dirty_rect = self.rect; } + // Ensure that the dirty rect doesn't extend outside the local tile rect. + self.dirty_rect = self.dirty_rect + .intersection(&self.rect) + .unwrap_or(PictureRect::zero()); + // See if this tile is a simple color, in which case we can just draw // it as a rect, and avoid allocating a texture surface and drawing it. // TODO(gw): Initial native compositor interface doesn't support simple