diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2020-01-17 13:55:51 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-17 13:55:51 -0500 |
commit | 893fce13744629b91b2d78b76befc563637cbdee (patch) | |
tree | 4ecc37a8a5140429172e666128dd7d1393fb69e3 /components/script | |
parent | f200e2106499d412890fdc750485d7e9c1d4dcf8 (diff) | |
parent | 01ca317235eb2b6b1d55b67df9ea60a59f61bcf0 (diff) | |
download | servo-893fce13744629b91b2d78b76befc563637cbdee.tar.gz servo-893fce13744629b91b2d78b76befc563637cbdee.zip |
Auto merge of #25545 - szeged:mmatyas__webgl_fns_versions, r=jdm
Add WebGL2 specific version strings
Updated the `VERSION` and `SHADING_LANGUAGE_VERSION` WebGL parameters to report the correct version strings when WebGL2 is in use.
See: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.2
<!-- Please describe your changes on the following line: -->
cc @jdm @zakorgy @imiklos
---
<!-- 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] There are tests for these changes
<!-- 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. -->
Diffstat (limited to 'components/script')
-rw-r--r-- | components/script/dom/webgl2renderingcontext.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/components/script/dom/webgl2renderingcontext.rs b/components/script/dom/webgl2renderingcontext.rs index 3b666f515e2..af11e947eda 100644 --- a/components/script/dom/webgl2renderingcontext.rs +++ b/components/script/dom/webgl2renderingcontext.rs @@ -443,6 +443,16 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3 fn GetParameter(&self, cx: JSContext, parameter: u32) -> JSVal { match parameter { + constants::VERSION => unsafe { + rooted!(in(*cx) let mut rval = UndefinedValue()); + "WebGL 2.0".to_jsval(*cx, rval.handle_mut()); + return rval.get(); + }, + constants::SHADING_LANGUAGE_VERSION => unsafe { + rooted!(in(*cx) let mut rval = UndefinedValue()); + "WebGL GLSL ES 3.00".to_jsval(*cx, rval.handle_mut()); + return rval.get(); + }, constants::MAX_CLIENT_WAIT_TIMEOUT_WEBGL => { return Int32Value( self.base.limits().max_client_wait_timeout_webgl.as_nanos() as i32 |