From 198094e427540470e5bfbadfc7cca085c46fd20d Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Tue, 8 Dec 2015 14:46:35 -0800 Subject: [PATCH] Fix crash with empty rect Don't attempt to draw with a zero-by-zero window. --- sky/shell/gpu/mojo/rasterizer_mojo.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sky/shell/gpu/mojo/rasterizer_mojo.cc b/sky/shell/gpu/mojo/rasterizer_mojo.cc index 10a87d371..cd89f6260 100644 --- a/sky/shell/gpu/mojo/rasterizer_mojo.cc +++ b/sky/shell/gpu/mojo/rasterizer_mojo.cc @@ -54,6 +54,11 @@ void RasterizerMojo::Draw(uint64_t layer_tree_ptr, scoped_ptr layer_tree( reinterpret_cast(layer_tree_ptr)); + if (layer_tree->frame_size().isEmpty()) { + callback.Run(); + return; + } + MGLResizeSurface(layer_tree->frame_size().width(), layer_tree->frame_size().height()); SkCanvas* canvas = ganesh_canvas_.GetCanvas(0, layer_tree->frame_size()); -- GitLab