diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2019-09-03 20:50:47 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-03 20:50:47 -0400 |
commit | dc3b0b7c9fd39acad05428d92e946b5aed5231ed (patch) | |
tree | ecf4e049f1bca7d50ff6c96978ef953a053f8951 | |
parent | 618d00be1879b52211bcded28dd6f2d0a3c64a6f (diff) | |
parent | 1e3b08aae847915b48416f366fc755049e9ac03d (diff) | |
download | servo-dc3b0b7c9fd39acad05428d92e946b5aed5231ed.tar.gz servo-dc3b0b7c9fd39acad05428d92e946b5aed5231ed.zip |
Auto merge of #24128 - asajeffrey:webgl-extensions-fallback, r=Manishearth
Fallback to old extensions API if NUM_EXTENSIONS errors
<!-- Please describe your changes on the following line: -->
Fixes a panic querying extensions in WebGL 1.
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #21993
- [x] These changes do not require tests because it fixes a panic
<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->
<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
<!-- 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/24128)
<!-- Reviewable:end -->
-rw-r--r-- | components/canvas/webgl_thread.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/components/canvas/webgl_thread.rs b/components/canvas/webgl_thread.rs index 7844c762cfb..ceaaf908b9f 100644 --- a/components/canvas/webgl_thread.rs +++ b/components/canvas/webgl_thread.rs @@ -1727,6 +1727,11 @@ impl WebGLImpl { unsafe { gl.get_integer_v(gl::NUM_EXTENSIONS, &mut ext_count); } + // Fall back to the depricated extensions API if that fails + if gl.get_error() != gl::NO_ERROR { + chan.send(gl.get_string(gl::EXTENSIONS)).unwrap(); + return; + } let ext_count = ext_count[0] as usize; let mut extensions = Vec::with_capacity(ext_count); for idx in 0..ext_count { |