diff options
author | Daniel Alley <dalley@redhat.com> | 2020-03-29 17:19:39 -0400 |
---|---|---|
committer | Daniel Alley <dalley@redhat.com> | 2020-04-03 11:34:04 -0400 |
commit | 61fb84d6a09b04f7d2de2ebbda3db0d10925561f (patch) | |
tree | 741f6fa8cd3f2ac20aa7d3206a24c2cf60c19a2a /components/layout/display_list/builder.rs | |
parent | e66ab111a6fb5ea9fc7684a0ebeddbe6aa2134f1 (diff) | |
download | servo-61fb84d6a09b04f7d2de2ebbda3db0d10925561f.tar.gz servo-61fb84d6a09b04f7d2de2ebbda3db0d10925561f.zip |
Don't send empty canvases to WebRender
If any dimension of a canvas is 0, don't try to render it as it causes
problems inside webrender.
Diffstat (limited to 'components/layout/display_list/builder.rs')
-rw-r--r-- | components/layout/display_list/builder.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/components/layout/display_list/builder.rs b/components/layout/display_list/builder.rs index 56748d55d2b..17f946f7187 100644 --- a/components/layout/display_list/builder.rs +++ b/components/layout/display_list/builder.rs @@ -1875,6 +1875,12 @@ impl Fragment { } }, SpecificFragmentInfo::Canvas(ref canvas_fragment_info) => { + if canvas_fragment_info.dom_width == Au(0) || + canvas_fragment_info.dom_height == Au(0) + { + return; + } + let image_key = match canvas_fragment_info.source { CanvasFragmentSource::WebGL(image_key) => image_key, CanvasFragmentSource::Image(ref ipc_renderer) => match *ipc_renderer { |