servo: Merge #587 - Fix crash on window resize (from eschweic:master); r=metajack
authoreschweic <eschweickart@mozilla.com>
Fri, 12 Jul 2013 12:27:25 -0700
changeset 333517 86d13f167774b9fe204ddbed12036ff061d1893c
parent 333516 55d17bf2d1549114e490aebb6c146be5ec449063
child 333518 3a7b759b0abcae5156566689e50e0536eac738fb
push id31307
push usergszorc@mozilla.com
push dateSat, 04 Feb 2017 00:59:06 +0000
treeherdermozilla-central@94079d43835f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmetajack
servo: Merge #587 - Fix crash on window resize (from eschweic:master); r=metajack This fixes a bug that would sometimes trigger a fail! when the window was resized. Source-Repo: https://github.com/servo/servo Source-Revision: 3bb47133d94fa86737dd6b52b1a5ca829a0b23b8
servo/src/components/main/compositing/mod.rs
--- a/servo/src/components/main/compositing/mod.rs
+++ b/servo/src/components/main/compositing/mod.rs
@@ -410,17 +410,20 @@ impl CompositorTask {
                         let size = window.size();
                         chan.send(Size2D(size.width as int, size.height as int));
                     }
 
                     GetGLContext(chan) => chan.send(current_gl_context()),
                     
                     NewLayer(new_size, tile_size) => {
                         *page_size = Size2D(new_size.width as f32, new_size.height as f32);
-                        *quadtree = Some(Quadtree::new(0, 0, new_size.width, new_size.height, tile_size));
+                        *quadtree = Some(Quadtree::new(0, 0,
+                                                       new_size.width.max(&(window_size.width as uint)),
+                                                       new_size.height.max(&(window_size.height as uint)),
+                                                       tile_size));
                         ask_for_tiles();
                         
                     }
                     ResizeLayer(new_size) => {
                         *page_size = Size2D(new_size.width as f32, new_size.height as f32);
                         // TODO: update quadtree, ask for tiles
                     }
                     DeleteLayer => {