Commit graph

8329 commits

Author SHA1 Message Date
bors-servo
bde8a1e239
Auto merge of #21313 - jdm:glstuff, r=nox
Framebuffer and renderbuffer fixes

This commits address two separate panics that occur when running the framebuffer-object-attachment.html test. The test still panics due to another framebuffer completion status problem, so the overall test results don't demonstrate any improvement.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #21252
- [x] There are tests for these changes

<!-- 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/21313)
<!-- Reviewable:end -->
2018-08-02 09:26:35 -04:00
Anthony Ramine
fba6d801a1 Always use a WebGLVertexArrayObject to handle vertex attribs
This lets us clean up how buffers are reference-counted.
2018-08-02 12:46:19 +02:00
Josh Matthews
03eb7e4dd2 webgl: Emulate some renderbuffer formats in non-GLES. 2018-08-02 02:05:53 -04:00
Josh Matthews
3334e477c1 webgl: Mark zero-sized framebuffers as incomplete attachments. 2018-08-01 15:40:46 -04:00
bors-servo
0051597525
Auto merge of #21158 - ferjm:webaudio, r=manishearth,nox,ferjm
WebAudio API

- [X] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #6710
- [X] There are tests for these changes

This PR adds basic support for the WebAudio API using [servo-media](https://github.com/servo/media) with GStreamer as the audio backend.

There are still some major stuff to fix like:

- [x] Detach ArrayBuffer during the [AudioBuffer "acquire the content" operation](https://webaudio.github.io/web-audio-api/#acquire-the-content). I am naively using `JS_StealArrayBufferContents()` directly, because it is what Gecko uses, but this should probably be part of the [rust-mozjs](https://github.com/servo/rust-mozjs) [TypedArray](https://github.com/servo/rust-mozjs/blob/master/src/typedarray.rs) API. And, in any case, I am not even sure if that's the proper way to do it. According to the results of the WPTs it may not even be right since [this assertion](https://github.com/servo/rust-mozjs/blob/master/src/typedarray.rs#L285) is failing in some cases. I need to dig more about this.
- [x] Disable the GStreamer dependency on Android. Unfortunately gstreamer-rs requires an NDK version upgrade, so we need to disable this for Android until then. I tried adding [different features to servo-media](https://github.com/servo/media/pull/79), but I am currently hitting [this issue](https://github.com/rust-lang/cargo/issues/1197)

I still need to run servo-tidy, change the servo-media dependency to use the git repo and add/fix some comments and TODOs.

The remaining feature work should be done in future PRs.

Note that most of the failing WPTs are failing because we don't implement the tested features yet (we only implement a few AudioNodes) and we have no OfflineAudioContext support, which most WPTs rely on.

<!-- 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/21158)
<!-- Reviewable:end -->
2018-07-31 09:00:06 -04:00
Anthony Ramine
15d1215949 Properly check for context ownership of objects passed to gl.is*() 2018-07-31 11:12:45 +02:00
Anthony Ramine
76f23f7d78 Simplify gl.getShaderParameter() (fixes #20562)
The expectation change is due to the shader now using its DOM-side compile status.
It is actually a bug for the shader to think it actually compiled successfully,
but at least it does so consistently now.
2018-07-31 11:12:45 +02:00
Anthony Ramine
a0fc4c9832 Fix program and shader lifetime cycle 2018-07-31 11:12:40 +02:00
Manish Goregaokar
2c19814bec 48000 -> 44100 2018-07-30 16:42:38 -07:00
Manish Goregaokar
a1fe48d721 Use JS_GetArrayBufferViewBuffer with JS_DetachArrayBuffer 2018-07-30 16:42:38 -07:00
Anthony Ramine
43463e80cb Remove an obsolete todo in gl.compileShader()
We get the uniform data etc at link-time.
2018-07-31 00:28:14 +02:00
Anthony Ramine
6af2ce79a2 Remove an obsolete todo in gl.attachShader()
Attaching the same shader twice should indeed emit an InvalidOperation error.
2018-07-31 00:28:14 +02:00
Fernando Jiménez Moreno
b738d9a912 Throw if AudioBufferSourceNode.Start params are negative 2018-07-30 19:54:55 +02:00
Fernando Jiménez Moreno
3b8cb83e04 Make OfflineAudioContextOptions spec compliant 2018-07-30 18:50:36 +02:00
Fernando Jiménez Moreno
ce828c0071 Get rooting out of AudioBuffer::new_inherited 2018-07-30 14:24:42 +02:00
Fernando Jiménez Moreno
6aaf5806b1 OfflineAudioContext 2018-07-30 14:23:48 +02:00
Fernando Jiménez Moreno
75dd050e57 Fix rebase mistake 2018-07-30 14:23:47 +02:00
Manish Goregaokar
00014b3f16 Add AudioParam connection support 2018-07-30 14:23:46 +02:00
Fernando Jiménez Moreno
acb03603b6 Fire AudioScheduledSourceNode.onended when playback stops 2018-07-30 14:23:46 +02:00
Fernando Jiménez Moreno
c9ff1b9f57 Enter compartment during AudioBuffer creation 2018-07-30 14:23:46 +02:00
Fernando Jiménez Moreno
596640595c Root JS channels during AudioBuffer construction 2018-07-30 14:23:46 +02:00
Fernando Jiménez Moreno
c617ca0d30 Remove commented code 2018-07-30 14:23:46 +02:00
Fernando Jiménez Moreno
477907e578 Do not copy initial data during AudioBuffer construction and use JS_DetachArrayBuffer 2018-07-30 14:23:45 +02:00
Fernando Jiménez Moreno
1649b6a528 Fix build errors after rebase 2018-07-30 14:23:45 +02:00
Fernando Jiménez Moreno
562e58ac49 AudioParam value getter 2018-07-30 14:21:48 +02:00
Fernando Jiménez Moreno
21cb160be3 test-tidy fixes 2018-07-30 14:21:48 +02:00
Fernando Jiménez Moreno
f0a691e474 Update servo-media after crate split up. Allows building for Android 2018-07-30 14:21:48 +02:00
Fernando Jiménez Moreno
b68c791b8d Remove unimplemented PeriodicWave stub 2018-07-30 14:21:48 +02:00
Fernando Jiménez Moreno
ebcbe2ff7d Mark DecodeResolver as must_root 2018-07-30 14:21:47 +02:00
Fernando Jiménez Moreno
8a6ea00f58 Reference issue to support the AudioScheduledSourceNode.ended event 2018-07-30 14:21:47 +02:00
Fernando Jiménez Moreno
3dde730f9b AudioParam automation rate setter 2018-07-30 14:21:47 +02:00
Fernando Jiménez Moreno
758ae94aa1 AudioNode channel related properties getter and setter fixes 2018-07-30 14:21:47 +02:00
Fernando Jiménez Moreno
abccf68a47 Clarify that servo-media deals with duplicated connections 2018-07-30 14:21:47 +02:00
Fernando Jiménez Moreno
b26a3bd31b rustfmt 2018-07-30 14:21:46 +02:00
Fernando Jiménez Moreno
3fc9ecace0 Make restore_js_channel_data unsafe 2018-07-30 14:21:46 +02:00
Fernando Jiménez Moreno
c5abc3eb8b Use git url for servo-media dependency 2018-07-30 14:21:46 +02:00
Manish Goregaokar
8172b4f960 Remove unnecessary comment
This check is implicitly handled by the graph impl
2018-07-30 14:21:46 +02:00
Manish Goregaokar
b7730da37d Add spec link to AudioBuffer::Constructor 2018-07-30 14:21:46 +02:00
Manish Goregaokar
02aaf55cd3 Pass global to AudioBuffer::new_inherited 2018-07-30 14:21:46 +02:00
Manish Goregaokar
d4fcd8fb0c Remove recursion limit 2018-07-30 14:21:45 +02:00
Manish Goregaokar
723f1b0582 Fix construction of destination node (#6)
* Fix comparison of audiocontexts

* Fix comparison

* Fix destination node construction
2018-07-30 14:21:45 +02:00
Manish Goregaokar
6ac4b4b8e0 Fix context comparison (#5)
* Fix comparison of audiocontexts

* Fix comparison
2018-07-30 14:21:45 +02:00
Manish Goregaokar
f0d04249f9 Use new params impl (#4)
* AudioNodeType -> AudioNodeInit

* Use new param type system, clean up
2018-07-30 14:21:44 +02:00
Manish Goregaokar
8f9a081ff0 Fix Trusted usage in audio decoder to queue tasks (#3) 2018-07-30 14:21:44 +02:00
Fernando Jiménez Moreno
911b8ebd79 Remove unsafe code to create empty AudioNodeOptions 2018-07-30 14:21:44 +02:00
Fernando Jiménez Moreno
b87fc17b4b decodeAudioData 2018-07-30 14:21:44 +02:00
Fernando Jiménez Moreno
e0e1141e74 Undo trace impl for Mutex<T> 2018-07-30 14:21:43 +02:00
Fernando Jiménez Moreno
4cadc336a9 AudioBuffer CopyFromChannel and CopyToChannel 2018-07-30 14:21:43 +02:00
Manish Goregaokar
f3bc183dba Add disconnect methods; cleanup DOM stuff (#2)
* Add disconnect methods

* Use Dom, not DomRoot

DomRoot will keep it permanently rooted, it should only be used in
values not on the JS heap
2018-07-30 14:21:43 +02:00
Fernando Jiménez Moreno
23f7a73622 Copy AudioBufferSourceNode buffer 2018-07-30 14:21:43 +02:00