Skip to content

Commit

Permalink
Auto merge of #21828 - servo:jdm-patch-36, r=nox
Browse files Browse the repository at this point in the history
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 -->
  • Loading branch information
bors-servo committed Oct 1, 2018
2 parents 29fdf04 + 26e1001 commit 057acdc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion components/canvas/webgl_thread.rs
Expand Up @@ -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))
});
Expand Down

0 comments on commit 057acdc

Please sign in to comment.