Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Early out from scene building if view is too large. #2524

Merged
merged 1 commit into from
Mar 15, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions webrender/src/render_backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,18 @@ impl Document {

// TODO: We will probably get rid of this soon and always forward to the scene building thread.
fn build_scene(&mut self, resource_cache: &mut ResourceCache) {
let max_texture_size = resource_cache.max_texture_size();

if self.view.window_size.width == 0 ||
self.view.window_size.height == 0 ||
self.view.window_size.width > max_texture_size ||
self.view.window_size.height > max_texture_size {
error!("ERROR: Invalid window dimensions {}x{}. Please call api.set_window_size()",
self.view.window_size.width,
self.view.window_size.height,
);

if self.view.window_size.width == 0 || self.view.window_size.height == 0 {
error!("ERROR: Invalid window dimensions! Please call api.set_window_size()");
return;
}

let old_builder = self.frame_builder.take().unwrap_or_else(FrameBuilder::empty);
Expand Down