Auto merge of #24333 - mmatyas:webgl_fns_samplers, r=jdm

Add WebGLSampler support

Reference: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.13

<!-- Please describe your changes on the following line: -->

cc @jdm @zakorgy

---
<!-- 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
- [ ] These changes fix #___ (GitHub issue number if applicable)

<!-- Either: -->
- [x] There are tests for these changes OR
- [ ] These changes do not require tests because ___

<!-- 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/24333)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2019-10-08 11:56:11 -04:00 committed by GitHub
commit a7d48dca80
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 394 additions and 88 deletions

View file

@ -104,16 +104,6 @@ macro_rules! handle_object_deletion {
};
}
macro_rules! optional_root_object_to_js_or_null {
($cx: expr, $binding:expr) => {{
rooted!(in($cx) let mut rval = NullValue());
if let Some(object) = $binding {
object.to_jsval($cx, rval.handle_mut());
}
rval.get()
}};
}
fn has_invalid_blend_constants(arg1: u32, arg2: u32) -> bool {
match (arg1, arg2) {
(constants::CONSTANT_COLOR, constants::CONSTANT_ALPHA) => true,
@ -4267,7 +4257,7 @@ impl Textures {
}
}
fn active_unit_enum(&self) -> u32 {
pub fn active_unit_enum(&self) -> u32 {
self.active_unit.get() + constants::TEXTURE0
}