aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/webglrenderingcontext.rs
Commit message (Collapse)AuthorAgeFilesLines
* Make #[dom_struct] a proc_macro attributeAnthony Ramine2017-02-241-0/+1
|
* Replace uses of spidermonkey-specific JS_GetArrayBufferViewType with ↵Sam Liu2017-02-201-4/+4
| | | | ArrayBufferView impl's method get_array_type()
* Make typed_array_or_sequence_to_vec support typed arrays.Josh Matthews2017-02-101-21/+31
|
* Use TypedArrayderor18691072017-02-101-38/+36
|
* webgl: Fix handling of UNPACK_ALIGNMENT.Eric Anholt2017-01-281-22/+57
| | | | | | | | | | | | | | | | | | We were setting it to whatever value from {1,2,4,8} the user requested and otherwise ignoring it. There were two problems there: 1) Validation ignored it, so GL could read outside of the user's array in TexImage() or TexSubImage() if the aligment was greater than cpp. 2) TexImage()/TexSubImage() from image/canvas sources wasn't packing its data according to the unpack alignment. To fix this, start tracking the user-requested alignment in the DOM side of the context. Set the GL's alignment to 1 for image/canvas sources or the user's value for array sources, and pass the user's alignment in to validation so that it can figure out the correct size of image that the GL will ready.
* webgl: Add support for premultiplying alpha.Eric Anholt2017-01-281-9/+76
| | | | Now the affected testcase only fails due to unpack alignment.
* webgl: Convert non-raw TexImage sources to the requested format.Eric Anholt2017-01-281-4/+67
| | | | | | | | | | | | | The code was returning RGBA8 data from the non-raw sources (HTML canvas elements, JS ImageData, etc.), but we then validated and passed that rgba8 data as if it was whatever format/datatype was specified in TexImage2D/TexSubImage2D, so the pixels would come out as garbage. It would seem like we could just rewrite the passed in format/datatype for the TexImage call to be RGBA/UNSIGNED_BYTE, but that would leave incorrect levels of precision if the internalformat didn't match the format/datatype (and older desktop implementations often ignore the internalformat in choosing their internal format, anyway).
* webgl: Implement FLIP_Y_AXIS unpacking flag for TexImage, TexSubImage.Eric Anholt2017-01-281-4/+36
| | | | | | | This fixes a couple of tests doing RGBA/ubyte image uploads with flipping. Other tests with flipping get their expectations changed, because some other feature is missing (premultiplication or ImageData/canvas format conversion)
* Add a check to BlendFunc for invalid constantioctaptceb2017-01-111-0/+33
| | | | combinations
* webgl: Add missing overload of bufferData().Eric Anholt2017-01-041-0/+32
| | | | | | | I was writing this to fix the error in gl-enum-tests.html test (it now gets farther along before it fails due to us missing getTexParameter()), but it turned out that a lot of the conformance tests were failing due to it.
* webgl: Allow enable/disable of STENCIL_TESTEric Anholt2017-01-041-1/+1
|
* webgl: Validate enums for blendEquation.Eric Anholt2016-12-311-0/+8
| | | | | Improves a conformance test that tried passing in desktop GL enums for blending.
* Remove and allow some dead code.Ms2ger2016-12-221-35/+0
|
* Remove HeapGCValueAnthony Ramine2016-12-121-15/+15
| | | | | | It could be used to have mutable JSVal fields without GC barriers. With the removal of that trait, MutHeap and MutNullableHeap can respectively be replaced by MutJS and MutNullableJS.
* Rename `Reflectable` to `DomObject`.Corey Farwell2016-12-081-1/+1
| | | | Fixes https://github.com/servo/servo/issues/8473.
* Auto merge of #14075 - MortimerGoro:webgl-resize, r=MortimerGorobors-servo2016-12-011-0/+24
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement WebGLContext resize <!-- Please describe your changes on the following line: --> Related PR: https://github.com/servo/webrender/pull/519 Implement WebGLContext resize (canvas.width & canvas.height). I have tested: - Fixes WebGL apps that initialize canvas size after calling canvas.getContext("webgl") - Support WebGL apps that change the canvas size & viewport on window.onresize --- <!-- 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 _____ <!-- 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/14075) <!-- Reviewable:end -->
| * Implement WebGLContext resize, r=emilioImanol Fernandez2016-12-011-0/+24
| |
* | Expose WebGL-related interfaces only in WindowAnthony Ramine2016-11-301-13/+14
|/
* update depsGregory2016-11-221-9/+10
| | | | | | | | | | switch to using webrender_traits::ImageData update use of webrender_traits::StackingContext in layout use webrender_traits::channel::msg_channel in webgl ipc fix use of resource_override_path in components/servo/lib
* script creates methods taking '*mut JSContext' unsafeAbelardo E. Mendoza2016-11-141-75/+67
| | | | rebase + marked the necessary new code as unsafe
* webgl: Fix out-of-bounds readpixels handling.Eric Anholt2016-11-051-6/+105
| | | | | | | This fixes the crash in read-pixels-pack-alignment (which was trying to read out of bounds). Fixes #13901
* webgl: Throw an error on readPixels(width < 0 || height < 0)Eric Anholt2016-11-051-0/+4
| | | | | Otherwise gleam will try to allocate a negative size area for the result, and we'll panic with oom.
* webgl: Update FBO status when textures or RBs are reallocated.Eric Anholt2016-11-051-2/+11
| | | | | | FBO status is supposed to depend on the size of the attachments all matching, so we need to re-check when it changes. We don't ensure matching yet, but this will prevent regressions when we do.
* webgl: Detach RBs and textures from the bound FBO on deletion.Eric Anholt2016-10-251-0/+26
| | | | | | | This is part of general GL behavior: when an object is deleted, look through the currently bound objects and detach the deleted object from them. Detaching an object from an FBO causes it to need to be re-checked for its status.
* webgl: Add support for FBO attachments.Eric Anholt2016-10-251-0/+26
| | | | | This allows many FBO tests to start running as their framebuffers start coming back as framebuffer complete.
* webgl: Add support for renderbufferStorage().Eric Anholt2016-10-251-0/+33
| | | | | | | This is not a complete implementation yet: It doesn't clear the contents of the renderbuffer on creation. However, Gecko's plan to only clear renderbuffers when the first FBO using them is the simplest.
* webgl: Add support for checkFramebufferStatus().Eric Anholt2016-10-251-0/+17
| | | | | | For now it's returning the default UNSUPPORTED on user FBOs. object-deletion-behaviour.html starts running a bunch more subtets.
* webgl: Unbind deleted objects from the GL side, not just our side.Eric Anholt2016-10-251-8/+24
| | | | | | Once FBOs are allowed, we were running into testcases that deleted the active FBO, and expected the following ReadPixels to come from the default framebuffer.
* webgl: Throw an error when binding a deleted framebuffer.Eric Anholt2016-10-241-2/+12
| | | | | The spec was recently changed to clarify that this should throw an error.
* webgl: Allow TexImage data argument to be larger than necessary.Eric Anholt2016-10-231-3/+14
| | | | | | texture-size-limit.html is using a large array for all of its calls at various sizes, and we were throwing errors on the calls that should have passed.
* Remove intrinsic Root::r()Anthony Ramine2016-10-111-2/+1
|
* webgl: Implement uniformMatrix*fv.Eric Anholt2016-10-091-0/+69
| | | | | | | | | | | | These new functions are derived from the existing uniform*fv functions. They get used in a lot of demo code, so it should greatly improve our compatibility. This regresses uniformMatrixBadArgs.html, which gets at an existing problem in our uniform matrix support (failure to validate that the uniform is a matrix before calling down) but previously just failed because it only called the 'fv' variants and never the existing 'f' variants.
* webgl: Honor ArrayBuffer or ArrayBufferView in bufferData and bufferSubData.Emilio Cobos Álvarez2016-10-091-4/+16
|
* webgl: Handle both sequences and typed arrays, managing the type error ↵Emilio Cobos Álvarez2016-10-091-169/+232
| | | | | | | | | | | | ourselves. This is a step with multiple intentions: * Be correct. * Unlock tests that are blocking @anholt. * Ease the transition to typed arrays once the changes by @Ms2ger start rolling in, since I expect the amount of test expectations to update to be non-trivial.
* script: Mark as unsafe multiple array_buffer_view_to_xxx functions that take ↵Emilio Cobos Álvarez2016-10-091-10/+22
| | | | a raw JSObject pointer.
* webgl: A few fixes regarding the nullability of WebGL parameters.Emilio Cobos Álvarez2016-10-091-62/+86
|
* Rename Reflectable::global_scope to globalAnthony Ramine2016-10-061-7/+7
|
* Make WebGLRenderingContext::new take a &GlobalScopeAnthony Ramine2016-10-061-7/+6
|
* Introduce Reflectable::global_scopeAnthony Ramine2016-10-061-7/+7
|
* Introduce GlobalScope::constellation_chanAnthony Ramine2016-10-061-1/+1
|
* Make reflect_dom_object take a &GlobalScopeAnthony Ramine2016-10-061-9/+9
|
* Fix WebGL tests & Implement WebGLRenderingContext::{validateProgram, ↵Imanol Fernandez2016-10-031-22/+138
| | | | getProgramInfoLog, disableVertexAttribArray}, r=emilio
* implement WebGLRenderingContext::isEnabledOfek2016-09-221-16/+35
|
* webgl: Do validation that the framebuffer is complete for FBO operations.Eric Anholt2016-09-211-0/+56
| | | | | Given that we can't make a complete FBO yet, just return false from the status check.
* webgl: Don't forget update WebGL's texture binding on unbind.Eric Anholt2016-09-211-0/+1
| | | | | This doesn't appear to fix any testcases, but I noticed it when fixing renderbuffers.
* webgl: Don't forget to update the WebGL context's RB binding.Eric Anholt2016-09-211-1/+3
| | | | | We need to track the RB in the DOM context for getParameter(gl.RENDERBUFFER_BINDING), among others.
* webgl: Update the match for WebGLError's new InvalidFramebufferOperation.Eric Anholt2016-09-211-0/+1
|
* Reorder `use` statementsUK9922016-09-091-5/+5
|
* Compile WebIDL return type "object" to NonZero<*mut JSObject>Anthony Ramine2016-08-301-2/+4
|
* Don't bother with the global in ImageData::get_image_dataAnthony Ramine2016-08-301-2/+1
|