Commit graph

132 commits

Author SHA1 Message Date
Eric Anholt
12a96caaf1 webgl: Validate that depthRange near <= far.
Fixes a subtest of webgl-specific.html.
2016-08-10 00:05:02 -07:00
bors-servo
3b0dadda52 Auto merge of #12224 - nox:die-util-die, r=Ms2ger
Remove some stuff from util

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12224)
<!-- Reviewable:end -->
2016-07-04 12:57:00 -07:00
Eduard Burtescu
0db1faf876 Switch to using the new rooted!/RootedGuard API for rooting. 2016-07-04 20:59:01 +03:00
Anthony Ramine
e77efb93c1 Move util::vec::byte_swap to canvas_traits 2016-07-04 16:48:15 +02:00
Anthony Ramine
89a0b55c61 Use wrappers for GL IDs
See https://github.com/servo/webrender_traits/pull/62.
2016-06-28 20:11:55 +02:00
Emilio Cobos Álvarez
46c14aced2
webgl: Refactor texture validations to take advantage of rust type system
This commit introduces the `WebGLValidator` trait, and uses it for multiple
validations in the texture-related WebGL code, to move that logic out of the
already bloated `webglrenderingcontext.rs` file.

It also creates a type-safe wrapper for some WebGL types, removing all the
`unreachable!`s there, and introduces a macro for generating them conveniently.

This partially addresses #10693, pending refactor more code to use this
infrastructure, and (possibly?) introducing an `AsGLError` trait for the errors
to make the error handling happen in `WebGLContext`.
2016-06-25 00:03:15 +02:00
Daosheng Mu
9f563e9e43 Implement texSubImage2D API 2016-06-10 01:15:55 +01:00
bors-servo
b11648903b Auto merge of #11426 - DDEFISHER:master, r=emilio
Implement IsBuffer, IsFramebuffer and IsRenderbuffer for WebGLRenderingContext

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

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11426)
<!-- Reviewable:end -->
2016-05-29 20:03:56 -05:00
Daniel
c017438428 Implement IsBuffer, IsFramebuffer and IsRenderbuffer for WebGLRenderingContext 2016-05-29 17:08:10 -04:00
bors-servo
2f9796fa69 Auto merge of #11329 - c-rhodes:11320, r=jdm
Report use statements that use {} with only one entry

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 --faster` does not report any errors
- [X ] These changes fix #11320  (github issue number if applicable).

Either:
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____

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="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11329)
<!-- Reviewable:end -->
2016-05-27 07:11:17 -05:00
Cullen Rhodes
40acd24e8f Report use statements that use {} with only one entry 2016-05-27 10:18:44 +01:00
Kosov Eugene
94ad5aef62 add log2(u32) and use it to prevent casting to and from float to int 2016-05-27 10:15:37 +03:00
Anthony Ramine
cdc7bca944 Move DOMString back to script
This entirely removes the 'non-geckolib' feature of the util crate.
2016-05-24 10:54:57 +02:00
bors-servo
846517342b Auto merge of #11147 - danlrobertson:webgl-tex, r=emilio
Impl copyTexImage2D and copyTexSubImage2D

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

Implement copyTexImage2D and copyTexSubImage2D for WebGLRenderingContext. Feedback would be appreciated. I did my best to follow the [spec](https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.8). Please let me know if I missed anything. I couldn't find tests for this. Let me know if I should create one. I'm more than happy to do so. As always any feedback, comments,or critiques are very welcome 😄

Part of #10209

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11147)
<!-- Reviewable:end -->
2016-05-23 20:07:52 -07:00
Daniel Robertson
867cd9be29 Impl copyTexImage2D and copyTexSubImage2D
Implement copyTexImage2D and copyTexSubImage2D for
WebGLRenderingContext.
2016-05-23 22:29:23 -04:00
David Zbarsky
abfbeca670 Implement SampleCoverage 2016-05-22 00:23:29 -07:00
Ms2ger
cc2b2b50a7 Remove ConstellationChan.
It's a pointless abstraction that propagates the obsolete chan terminology,
swaps the order in which the sender and receiver are returned, and hides a
source of panics.
2016-05-19 17:13:44 +02:00
bors-servo
fe116b4bd7 Auto merge of #10776 - dzbarsky:getVertexAttrib, r=emilio
Implement GetVertexAttrib

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10776)
<!-- Reviewable:end -->
2016-05-18 14:40:32 -07:00
David Zbarsky
2bf016ff14 Implement GetVertexAttrib 2016-05-12 23:56:10 -07:00
David Zbarsky
2f416baa11 Implement ReadPixels 2016-05-12 23:50:36 -07:00
Daniel
8a5b0b8972 Implement IsShader fn and IsTexture fn for WebGLRenderingContext 2016-05-09 20:54:57 -04:00
Patrick Walton
91907f563b compositing: Send mouse events to the right pipeline when using
WebRender.

Fixes mouse events in browser.html.

Requires servo/webrender_traits#47 and servo/webrender#272.
2016-05-04 11:40:15 -07:00
Keith Yeung
2946fbef77 Implement stencil fns for WebGLRenderingContext 2016-04-24 02:40:22 -04:00
bors-servo
f1defb446e Auto merge of #10443 - emilio:webgl-teximage2d-overload, r=jdm
webgl: Implement the pending texImage2D overload, and add more validation

This is a large-ish refactor of the Texture2D code, but it should be
easier to read and of course more correct.

I tried to annotate every error condition with a spec paragraph.

I made just a reftest to ensure this works as intended, since I expect #10373 to land pretty soon.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10443)
<!-- Reviewable:end -->
2016-04-22 11:25:29 -07:00
Emilio Cobos Álvarez
f6f1e37b29
webgl: Fix a few typos in comments 2016-04-20 20:30:05 +02:00
Emilio Cobos Álvarez
d152c7fe88
webgl: texture: Make initialize only mark as initialized the current face
Also refactor a bit the code, and remove the unused `is_initialized`
flag.
2016-04-20 20:27:37 +02:00
Emilio Cobos Álvarez
21e2f97cfa
webgl: Fix filling a non-zero level
You can fill a level > 0 as long as the width and height values are
power of two, so the previous test was bogus.
2016-04-20 20:24:56 +02:00
Emilio Cobos Álvarez
1ad7f73caf
webgl: Reset bound buffer when appropiate in BufferData
This makes the test bufferDataBadArgs pass appropiately.
2016-04-20 19:22:05 +02:00
Emilio Cobos Álvarez
bc08762414
webgl: Rename UniformType to UniformSetterType and hoist to the bottom 2016-04-19 20:25:30 +02:00
Emilio Cobos Álvarez
6a15c2f245
webgl: Remove active_uniform related validation.
It's broken for uniform arrays, since uniform.id() stops being the index
then.

We need to add a more complex integration with angle for this to ever
be correct.

Unfortunately the ANGLE part that we should touch is C++, and it has
destructors, so we need to hook destructors there, and I can't do it
right now.
2016-04-19 13:27:19 +02:00
Emilio Cobos Álvarez
c807cab300
webgl: Validate that the texture should be power of two if the level is
greater than 1
2016-04-19 13:25:44 +02:00
Emilio Cobos Álvarez
87e112dea7
webgl: Implement the pending texImage2D overload, and add more validation
This is a large-ish refactor of the Texture2D code, but it should be
easier to read and of course more correct.

I tried to annotate every error condition with a spec paragraph.
2016-04-19 13:25:40 +02:00
David Zbarsky
a67a744057 Prevent use of reserved names in BindAttribLocation 2016-04-17 11:52:40 -07:00
Adrian Utrilla
89c432b2d2
Added remaining uniforms 2016-04-14 07:42:14 +02:00
David Zbarsky
34644401c6 Implement GetActiveAttrib 2016-04-11 23:12:04 -07:00
bors-servo
f0014bd9cd Auto merge of #10224 - emilio:shader-type-validations, r=jdm
webgl: Add attribute validations and other nits

Fixes https://github.com/servo/servo/issues/9958

Depends on a bunch of prs, and needs a test.

r? @jdm

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10224)
<!-- Reviewable:end -->
2016-04-12 05:18:49 +05:30
bors-servo
4cc241c858 Auto merge of #10433 - saurvs:pr3, r=emilio
Implement WebGLRenderingContext.getActiveUniform()

Fixes https://github.com/servo/servo/issues/10397

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10433)
<!-- Reviewable:end -->
2016-04-07 03:59:01 +05:30
Saurav Sachidanand
56eef10718 Implement WebGLRenderingContext.getActiveUniform() 2016-04-06 20:02:45 +05:30
Adrian Utrilla
36522ba9c3 Added Uniform2fv 2016-04-06 13:12:44 +02:00
Adrian Utrilla
b48e0f2ba9 Added Uniform1iv 2016-04-06 12:20:57 +02:00
Ar13mis
86b1f4249a Add Uniform2f 2016-04-04 16:00:22 -06:00
bors-servo
88d29e537c Auto merge of #10369 - autrilla:Uniform4iv, r=emilio
Issue #10368: Implemented Uniform4iv and Uniform4i

Uniform4iv can make use of Uniform4i, so I implemented both.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10369)
<!-- Reviewable:end -->
2016-04-03 11:48:47 +05:30
Emilio Cobos Álvarez
6fcc03c965 webgl: Make the api return the context limits and use them for validations
This allows keeping the VertexAttrib* calls asynchronous.

Another option would be to do the validation in the apply() function,
but that'd require us passing an unnecessary channel around and add
extra synchronization.

The counterpart of this is that it has to be updated when the context
changes, but that's less problem.
2016-04-03 01:21:56 +02:00
Emilio Cobos Álvarez
8d7ee15ace webgl: Remove unneeded return value. 2016-04-03 01:21:56 +02:00
Emilio Cobos Álvarez
466c8881de webgl: Use early return in DrawArrays 2016-04-03 01:21:56 +02:00
Emilio Cobos Álvarez
240ac7cfe2 webgl: Validate shader type parameter to CreateShader. 2016-04-03 01:21:56 +02:00
Adrian Utrilla
bd1448ab56 Added Uniform4iv and Uniform4i 2016-04-02 20:48:29 +02:00
Connor Brewster
3fd7634f54 webgl: finish, flush, detachShader, generateMipmap, Uniform1i 2016-04-02 12:31:47 -06:00
Jan-Fabian Humann
d778562844 #10211: Stop re-exporting webrender_traits WebGL types from canvas_traits 2016-03-30 20:05:16 +02:00
Emilio Cobos Álvarez
5ed93a5c4a Change old references of ecoal95 2016-03-23 18:12:40 +01:00