aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2018-01-30 21:17:56 -0600
committerGitHub <noreply@github.com>2018-01-30 21:17:56 -0600
commitb900664c1aaa57b7d53a46c83b9fe9ef743d161c (patch)
treea2ba40dc9cdda089f32b7744cd4f4697b7ea7149
parent469dc84b6ea20b6d378771b008101b49f34e1ad6 (diff)
parent04977ae20d474cfd8d8db1a9ba50904dbbfab488 (diff)
downloadservo-b900664c1aaa57b7d53a46c83b9fe9ef743d161c.tar.gz
servo-b900664c1aaa57b7d53a46c83b9fe9ef743d161c.zip
Auto merge of #19910 - glennw:fix-18606, r=jdm
Add a workaround for headless output sometimes being blank. I *think* this is a bug in OSMesa, as the fix here makes no sense to me. But nonetheless, this change does seem to reliably fix the headless output issues as reported. Fixes #18606. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19910) <!-- Reviewable:end -->
-rw-r--r--components/compositing/compositor.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/components/compositing/compositor.rs b/components/compositing/compositor.rs
index 304b523c87b..e15f3ff2603 100644
--- a/components/compositing/compositor.rs
+++ b/components/compositing/compositor.rs
@@ -1408,6 +1408,14 @@ impl<Window: WindowMethods> IOCompositor<Window> {
width: usize,
height: usize)
-> RgbImage {
+ // For some reason, OSMesa fails to render on the 3rd
+ // attempt in headless mode, under some conditions.
+ // I think this can only be some kind of synchronization
+ // bug in OSMesa, but explicitly un-binding any vertex
+ // array here seems to work around that bug.
+ // See https://github.com/servo/servo/issues/18606.
+ self.gl.bind_vertex_array(0);
+
let mut pixels = self.gl.read_pixels(0, 0,
width as gl::GLsizei,
height as gl::GLsizei,