Commit graph

6673 commits

Author SHA1 Message Date
Josh Matthews
1b08dd5232 webgl: Move framebuffer initialization logic to WebGL thread. 2018-09-10 16:31:29 -04:00
Josh Matthews
df8e36aa78 webgl: Differentiate between missing colour attachments and incomplete attachments. 2018-09-10 16:31:28 -04:00
Josh Matthews
690c98dda7 webgl: return missing attachment status from framebuffers with no attachments. 2018-09-10 15:56:17 -04:00
Josh Matthews
da3b0ef88f webgl: Clear renderbuffers on first read/write operation. 2018-09-10 15:56:16 -04:00
Josh Matthews
944d1d1f29 webgl: Check internal format of textures when determining attachment completeness. 2018-09-10 15:56:16 -04:00
Josh Matthews
d179435eab webgl: Ensure that framebuffers have a color attachment before reading or writing. 2018-09-10 15:56:15 -04:00
Josh Matthews
80ed829241 webgl: Mark framebuffers as incomplete if attachments do not meet format requirements. 2018-09-10 15:54:41 -04:00
Josh Matthews
03f6ce292e webgl: Remove unnecessary Option from texture API. 2018-09-10 15:54:41 -04:00
bors-servo
78ad1df0b0
Auto merge of #21645 - AgustinCB:add-websocket-task-queue, r=jdm
Add Websocket task source

According to the doc: https://html.spec.whatwg.org/multipage/web-sockets.html#network

The task source for all tasks queued in the websocket section are the
websocket task source, so this commit also updates those references to
use the appropriate one.

Also, while working on this, I made a typo here: 5dd6e21c2e/components/script/dom/window.rs (L191)

Setting the name incorrectly. The error, however, was this:

```bash
error[E0412]: cannot find type `WebsocketEventTaskSource` in this scope
     --> components/script/dom/window.rs:171:1
       |
171 | #[dom_struct]
       | ^^^^^^^^^^^^^ did you mean `WebsocketTaskSource`?
```

Which isn't useful at all. Not sure if it's a rustc problem or something related with htis code base, but I thought it was worth mentioning.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #21590
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because they don't include new behavior and existing tests should cover this code.

<!-- 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/21645)
<!-- Reviewable:end -->
2018-09-10 09:11:44 -04:00
Anthony Ramine
dac7740b8c Reuse input buffer for RGB/UNSIGNED_BYTE in rgba8_image_to_tex_image_data 2018-09-10 14:13:23 +02:00
Anthony Ramine
e1486f7d71 Reuse input vector for LUMINANCE_ALPHA/HALF_FLOAT 2018-09-10 12:43:38 +02:00
Anthony Ramine
7e7441749b Fix the remaining LUMINANCE* cases in rgba8_image_to_tex_image_data 2018-09-10 12:41:57 +02:00
Anthony Ramine
6d3609dbe8 Fix the UNSIGNED_SHORT_4_4_4_4 case of premultiply_pixels 2018-09-09 12:22:01 +02:00
Anthony Ramine
d8b7394fa3 Fix the UNSIGNED_SHORT_5_5_5_1 case of premultiply_pixels 2018-09-09 12:21:56 +02:00
Anthony Ramine
f726f18291 Remove some useless argument mutability
I wonder why this doesn't trigger a warning.
2018-09-09 12:21:55 +02:00
Anthony Ramine
e61c7b757f Fix the LUMINANCE of rgba8_image_to_tex_image_data
The internal format and format values match, thus the canvas or image input
must be interpreted as already in LUMINANCE format.
2018-09-09 12:21:54 +02:00
Anthony Ramine
9a362391d5 Fix the LUMINANCE_ALPHA case of rgba8_image_to_tex_image_data
The internal format and format values match, thus the canvas or image input
must be interpreted as already in LUMINANCE_ALPHA format.
2018-09-09 12:21:54 +02:00
Agustin Chiappe Berrini
b3e85472ed Fix space leak when pipeline is closed
Add a new control message to drop remove worklets.

Implement `Drop` for `Worklet` and get the worklet thread pool. Use that
pool to send `ExitWorklet` to all the threads with the id of the
`Worklet` that it's dropping.
2018-09-08 18:04:31 -04:00
Agustin Chiappe Berrini
5dd6e21c2e Add Websocket task source
According to the doc: https://html.spec.whatwg.org/multipage/web-sockets.html#network

The task source for all tasks queued in the websocket section are the
websocket task source, so this commit also updates those references to
use the appropriate one.
2018-09-08 17:01:27 -04:00
Anthony Ramine
74e6f40abe Reuse the input vector in more cases of rgba8_image_to_tex_image_data 2018-09-08 18:21:45 +02:00
Anthony Ramine
6a692228fc Fix the ALPHA/FLOAT case of rgba8_image_to_tex_image_data
I'm pretty sure this is supposed to write the ALPHA component.
2018-09-08 18:06:51 +02:00
Anthony Ramine
e192e4d97f Reuse input of rgba8_image_to_tex_image_data in some cases 2018-09-08 13:42:07 +02:00
Anthony Ramine
27951bb7c8 Make rgba8_image_to_tex_image_data not overallocate in some case 2018-09-08 13:42:07 +02:00
Anthony Ramine
145086e150 Make rgba8_image_to_tex_image_data a free-standing function 2018-09-08 13:42:06 +02:00
Anthony Ramine
a5f9d03229 Make remove_premultiplied_alpha mutate its input 2018-09-08 13:42:06 +02:00
Anthony Ramine
1864edbb36 Make premultiply_pixels mutate its input 2018-09-08 13:42:06 +02:00
Anthony Ramine
4bd8efa49e Use byte channels to send textures to the WebGL thread 2018-09-08 13:42:06 +02:00
Anthony Ramine
408e540c55 Use ipc::bytes_channel in ReadPixels 2018-09-08 13:42:06 +02:00
Anthony Ramine
4e9281dcbf Simplify WebGLRenderingContext::get_image_data 2018-09-08 13:42:06 +02:00
Anthony Ramine
9f924013bc Use a bytes channel in BufferData
This means we don't need to copy the input ArrayBuffer at all on the DOM side.
2018-09-07 11:28:59 +02:00
Anthony Ramine
1293692ef8 Simplify WebGLBuffer::buffer_data
There is no need to pass the target to that buffer method, given the buffer
has been retrieved by looking up the one bound to that target in the context.
2018-09-07 11:28:11 +02:00
Anthony Ramine
5a206d5137 Make validate_framebuffer return a WebGLResult<()> 2018-09-06 11:25:22 +02:00
Anthony Ramine
0579fbe4fa Use WebGLResult for returns of instanced draw methods 2018-09-06 10:41:58 +02:00
bors-servo
162826d6a9
Auto merge of #21583 - AgustinCB:add-task-source-name, r=jdm
Add task source name

Refactor `CommonScriptMsg::Task` to include `TaskSourceName`.

Sorry for the delay, between doing this after work and the time I spent trying to ramp up on the project, it took me a bit longer than I expected.

Test still don't pass in local, but they fail the same way on master, so I guess it's ok.

I may have forgotten something, I refactored mostly the stuff that the compiler complained about. Please let me know if I missed anything.

I tried to dump my thought process on the commit messages, so feel free to go commit by commit to understand context.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #21527

- [ ] There are tests for these changes OR
- [x] These changes do not require tests because it's mostly refactor, no new behavior added.

<!-- 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/21583)
<!-- Reviewable:end -->
2018-09-04 14:17:33 -04:00
bors-servo
02c689625b
Auto merge of #21601 - servo:descobj, r=jdm
Properly set desc.obj in CodegenRust.py (fixes #11868)

<!-- 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/21601)
<!-- Reviewable:end -->
2018-09-04 09:24:39 -04:00
Agustin Chiappe Berrini
e286fdcc53 Add the TaskSourceName to CommonScriptMsg::Task
Update QueuedTaskConversion and the TaskQueue to use it
2018-09-04 09:17:11 -04:00
Anthony Ramine
baa94702e4 Properly set desc.obj in CodegenRust.py (fixes #11868) 2018-09-04 13:57:10 +02:00
bors-servo
81f6ac8f92
Auto merge of #21591 - Manishearth:channelmergernode, r=ferjm
Implement ChannelMergerNode

partial https://github.com/servo/servo/issues/21558

Haven't yet tested, wanted to get this up as an example for https://github.com/servo/servo/issues/21558

<!-- 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/21591)
<!-- Reviewable:end -->
2018-09-04 02:38:08 -04:00
Manish Goregaokar
af5b1c4011 Add createChannelMerger() 2018-09-04 11:23:00 +05:30
Manish Goregaokar
28c21421ca Throw on out-of-bounds channelCount in AudioNodes 2018-09-03 20:31:52 +05:30
Manish Goregaokar
03d6fb18da Add ChannelMergerNode 2018-09-03 20:07:02 +05:30
Manish Goregaokar
91b8cbe1db Allow overriding GainNode's settings from the constructor 2018-09-03 18:51:03 +05:30
Emilio Cobos Álvarez
5d8545d2b4
Fix other parts of the Servo build. 2018-09-03 13:09:10 +02:00
nupurbaghel
b1adf8ee8a correct failing tests 2018-09-01 08:49:50 +00:00
nupurbaghel
d7cb68cb84 correct currentSrc function 2018-09-01 08:49:49 +00:00
Manish Goregaokar
303b62ae8d Throw errors for invalid values in panner node constructor 2018-08-31 05:27:59 -07:00
bors-servo
1ee3deea27
Auto merge of #21388 - gterzian:introduce_task_queues, r=jdm
Introduce task queues, and throttling performance timeline tasksource

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

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [ ] `./mach test-tidy` does not report any errors
- [ ] These changes fix #19997 (github issue number if applicable).

<!-- Either: -->
- [ ] 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/21388)
<!-- Reviewable:end -->
2018-08-30 14:56:26 -04:00
Gregory Terzian
029715aba6 introduce a generic worker event-loop 2018-08-31 02:10:45 +08:00
Gregory Terzian
ca6306c430 introduce task-queues, and throttling the performance-timeline task-source, in script and worker threads.
queue
2018-08-31 02:10:34 +08:00
bors-servo
6f81ed49f6
Auto merge of #21523 - servo:webgl, r=avadacatavra,jdm
Some more drive-by WebGL fixes and cleanups

<!-- 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/21523)
<!-- Reviewable:end -->
2018-08-30 12:23:31 -04:00