Auto merge of #21828 - servo:jdm-patch-36, r=nox

Warn when using slow WebGL code path.

This will make it more obvious when one source of WebGL performance problems is present.

<!-- 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/21828)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2018-10-01 09:26:19 -04:00 committed by GitHub
commit 057acdca2d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -220,7 +220,9 @@ impl<VR: WebVRRenderHandler + 'static> WebGLThread<VR> {
// Fallback to readback mode if the shared context creation fails.
let result = self.gl_factory.new_shared_context(version, size, attributes)
.map(|r| (r, WebGLContextShareMode::SharedTexture))
.or_else(|_| {
.or_else(|err| {
warn!("Couldn't create shared GL context ({}), using slow \
readback context instead.", err);
let ctx = self.gl_factory.new_context(version, size, attributes);
ctx.map(|r| (r, WebGLContextShareMode::Readback))
});