Commit graph

6608 commits

Author SHA1 Message Date
bors-servo
82e94e3b67
Auto merge of #21723 - servo:webgl, r=jdm
More drive-by WebGL and canvas fixes

<!-- 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/21723)
<!-- Reviewable:end -->
2018-09-18 11:06:51 -04:00
Emilio Cobos Álvarez
60e28c61e5
Fix Servo build. 2018-09-18 11:52:39 +02:00
Anthony Ramine
900c3cc6b5 Implement gl.getParameter(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL) 2018-09-18 11:48:34 +02:00
Anthony Ramine
fe6f53ffb4 Fix a small texSubImage2D bug 2018-09-18 10:49:31 +02:00
Anthony Ramine
8c100b23b1 Implement proper origin checks for WebGL textures (fixes #21522) 2018-09-18 10:33:42 +02:00
Anthony Ramine
36c8cd229e Remove Canvas2dMsg::DrawImageSelf
Now that all canvas share the same thread, it's useless to have a separate message
for that.
2018-09-17 16:24:01 +02:00
Anthony Ramine
f1e8eb640c Don't create 2D canvas contexts arbitrarily
Sometimes, the canvas still has no rendering context, in this case it represents
a transparent black rectangle.
2018-09-16 20:44:41 +02:00
Anthony Ramine
ed673f8070 Mark some canvas methods as unsafe
They use raw JS context pointers.
2018-09-16 20:44:41 +02:00
bors-servo
0ecd671f52
Auto merge of #21711 - servo:webgl, r=jdm
Some fixes to canvas stuff

<!-- 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/21711)
<!-- Reviewable:end -->
2018-09-14 21:09:05 -04:00
Anthony Ramine
462a488d55 Update HTMLCanvasElement WebIDL definition 2018-09-15 00:24:21 +02:00
Josh Matthews
59b8f971b5 webgl: Mark framebuffers as uninitialized when their attached renderbuffer's storage changes. 2018-09-14 16:17:47 -04:00
Anthony Ramine
3528ef30e5 Update CanvasRenderingContext2D WebIDL definition
CanvasImageSource was never supposed to include CanvasRenderingContext2D.
2018-09-14 14:48:42 +02:00
Anthony Ramine
2b574bbdf8 Update the WebIDL parser 2018-09-14 14:48:41 +02:00
Anthony Ramine
70a0174b0a Remove a panic due to missing video support 2018-09-14 14:48:41 +02:00
Anthony Ramine
2f2331f149 Use a byte channel to retrieve pixels of 2D canvas 2018-09-13 22:04:30 +02:00
Anthony Ramine
b5c469d52e Merge byte swap and unmultiplying loops in ctx.getImageData() 2018-09-13 22:04:30 +02:00
Anthony Ramine
ac822ee2fc Remove erroneous check from CopyTexImage2D
The internal format of the bound texture doesn't matter, what matters is
which components can be found in the framebuffer.
2018-09-13 22:04:29 +02:00
bors-servo
60b926ade4
Auto merge of #21683 - servo:webgl, r=jdm
Properly support PACK_ALIGNMENT in WebGL 1

<!-- 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/21683)
<!-- Reviewable:end -->
2018-09-13 01:47:52 -04:00
bors-servo
b0de9c5315
Auto merge of #21628 - paavininanda:Current-pixel-density, r=jdm
Current pixel density

<!-- 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: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix a subset of #11416.

<!-- Either: -->
- [x] There are tests for these changes OR

<!-- 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/21628)
<!-- Reviewable:end -->
2018-09-13 00:16:46 -04:00
bors-servo
cd02ca6c19
Auto merge of #21674 - Manishearth:channel-count, r=ferjm
Pass through channel settings in AudioNode constructor

Most audionodes let you pass in channel count/etc settings in their
constructors, and have different defaults. Using the `create_node`
argument added in https://github.com/servo/media/pull/124 , this passes
that information through.

r? @ferjm.

<!-- 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/21674)
<!-- Reviewable:end -->
2018-09-12 19:11:03 -04:00
Anthony Ramine
d5f3b211ba Properly support PACK_ALIGNMENT in WebGL 1 2018-09-12 23:45:49 +02:00
Anthony Ramine
452d85005a Simplify WebGLRenderingContext::PixelStorei 2018-09-12 23:45:49 +02:00
bors-servo
26745b2741
Auto merge of #21461 - jdm:webgltmp2, r=nox
Various webgl fixes for framebuffer attachment test

These changes resolve all panics on macOS when running framebuffer-object-attachment.html in headless and headful testing.

---
- [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 OR
- [x] Fixes #13710. Fixes #20570.

<!-- 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/21461)
<!-- Reviewable:end -->
2018-09-12 16:36:08 -04:00
paavininanda
25027e476c Current-pixel-density tests passing 2018-09-13 00:23:09 +05:30
bors-servo
910cc23a6e
Auto merge of #21325 - gterzian:crossbeam_integration, r=SimonSapin,jdm
Replace mpsc with crossbeam-channel

Follow up on https://github.com/servo/servo/pull/19515

---

Selecting over multiple channels in `std::sync::mpsc` is not stable and likely never will be:

https://github.com/rust-lang/rust/issues/27800#issuecomment-260136777
> It seems the only thing keeping `mpsc_select` around is Servo.

crossbeam-channel is designed specifically to replace `std::sync::mpsc` and fix many of its shortcomings:
https://github.com/stjepang/rfcs-crossbeam/blob/channel/text/2017-11-09-channel.md

This is to be landed together with https://github.com/servo/ipc-channel/pull/183.

<!-- 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/21325)
<!-- Reviewable:end -->
2018-09-12 13:33:45 -04:00
bors-servo
9a83ab6297
Auto merge of #21280 - paavininanda:Update_the_image_data, r=jdm
Reacting to environment changes

<!-- 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: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix a subset of #11416

<!-- Either: -->
- [x] These changes do not require tests because they will be added when the complete responsive images is complete

<!-- 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/21280)
<!-- Reviewable:end -->
2018-09-12 10:47:13 -04:00
Fernando Jiménez Moreno
831201cc1b Make tidy happy 2018-09-12 15:21:55 +02:00
Simon Sapin
2a996fbc8f Replace mpsc with crossbeam/servo channel, update ipc-channel
Co-authored-by: Gregory Terzian <gterzian@users.noreply.github.com>
2018-09-12 13:33:32 +08:00
Gregory Terzian
b977b4994c add servo_channel crate 2018-09-12 11:25:45 +08:00
paavininanda
2de300d49c Reacting to environment changes 2018-09-12 02:11:13 +05:30
Manish Goregaokar
9254606b01 Pass down ChannelInfo to create_node 2018-09-11 19:24:01 +05:30
bors-servo
049eb6887e
Auto merge of #21539 - ferjm:multichannel.audio.decoder, r=Manishearth
Add support for multichannel decoded audio

- [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

<!-- 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/21539)
<!-- Reviewable:end -->
2018-09-11 08:41:25 -04:00
Fernando Jiménez Moreno
f423ede07f Add support for multichannel decoded audio 2018-09-11 10:38:56 +02:00
bors-servo
b0ee750fba
Auto merge of #21660 - servo:webgl, r=jdm
Some more drive-by fixes for rgba8_image_to_tex_image_data

<!-- 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/21660)
<!-- Reviewable:end -->
2018-09-10 19:21:45 -04:00
Josh Matthews
4edb7b194c webgl: Remove knowledge of attached framebuffers from renderbuffers and textures. 2018-09-10 16:31:33 -04:00
Josh Matthews
8ede221a83 webgl: Ensure that renderbuffers have been bound before attaching to a framebuffer. 2018-09-10 16:31:31 -04:00
Josh Matthews
bb8d9ba74c webgl: Ensure that depth and stencil attachments are rebound after messing with DEPTH_STENCIL attachments. 2018-09-10 16:31:30 -04:00
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