diff options
author | Alan Jeffrey <ajeffrey@mozilla.com> | 2017-06-12 13:21:33 -0500 |
---|---|---|
committer | Alan Jeffrey <ajeffrey@mozilla.com> | 2017-06-13 09:30:26 -0500 |
commit | 4e04daa9d08b4ad45fcdb001677ea8b4035049c7 (patch) | |
tree | 6e49e33dd947457b32d9058f2cc087de75841a32 /components/canvas/webgl_paint_thread.rs | |
parent | 07f6e114850896eae2fd206351808fb31cceaaf0 (diff) | |
download | servo-4e04daa9d08b4ad45fcdb001677ea8b4035049c7.tar.gz servo-4e04daa9d08b4ad45fcdb001677ea8b4035049c7.zip |
Clear webrender image id when resizing a canvas.
Diffstat (limited to 'components/canvas/webgl_paint_thread.rs')
-rw-r--r-- | components/canvas/webgl_paint_thread.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/components/canvas/webgl_paint_thread.rs b/components/canvas/webgl_paint_thread.rs index 9f87d3a4f51..feabaed7d2a 100644 --- a/components/canvas/webgl_paint_thread.rs +++ b/components/canvas/webgl_paint_thread.rs @@ -291,7 +291,7 @@ impl WebGLPaintThread { #[allow(unsafe_code)] fn recreate(&mut self, size: Size2D<i32>) -> Result<(), &'static str> { match self.data { - WebGLPaintTaskData::Readback(ref mut context, _, _) => { + WebGLPaintTaskData::Readback(ref mut context, ref webrender_api, ref mut image_key) => { if size.width > self.size.width || size.height > self.size.height { self.size = try!(context.resize(size)); @@ -299,6 +299,10 @@ impl WebGLPaintThread { self.size = size; context.gl().scissor(0, 0, size.width, size.height); } + // Webrender doesn't let images change size, so we clear the webrender image key. + if let Some(image_key) = image_key.take() { + webrender_api.delete_image(image_key); + } } WebGLPaintTaskData::WebRender(ref api, id) => { let device_size = webrender_traits::DeviceIntSize::from_untyped(&size); |