aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/webglbuffer.rs
Commit message (Collapse)AuthorAgeFilesLines
* Don't panic if WebGL thread can't be reached during finalization.Josh Matthews2019-07-291-8/+12
|
* Rustfmt has changed its default style :/Simon Sapin2018-12-281-2/+2
|
* Update MPL license to https (part 3)Jan Andre Ikenmeyer2018-11-191-1/+1
|
* Reorder importsPyfisch2018-11-061-2/+2
|
* `cargo fix --edition`Simon Sapin2018-11-061-7/+7
|
* Remove assertion in Drop for WebGLBufferAnthony Ramine2018-10-161-1/+0
|
* Format script componentchansuke2018-09-191-5/+17
|
* Use a bytes channel in BufferDataAnthony Ramine2018-09-071-2/+5
| | | | This means we don't need to copy the input ArrayBuffer at all on the DOM side.
* Simplify WebGLBuffer::buffer_dataAnthony Ramine2018-09-071-11/+2
| | | | | 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.
* Fix Drop assertion for WebGLBufferAnthony Ramine2018-08-291-1/+2
| | | | | A buffer that is dropped may not have been marked for deletion but it must not be attached to any VAO.
* Always use a WebGLVertexArrayObject to handle vertex attribsAnthony Ramine2018-08-021-66/+45
| | | | This lets us clean up how buffers are reference-counted.
* Store a reference to the WebGLRenderingContext in WebGLObjectAnthony Ramine2018-07-241-30/+28
|
* Issue #20556: Implement proper checks in WebGLRenderingContext's bindBuffer().Simon Martin2018-05-101-0/+7
|
* Cache BUFFER_USAGE value on the DOM sideAnthony Ramine2018-04-041-0/+8
|
* Improve WebGLBuffer::buffer_dataAnthony Ramine2018-04-041-6/+14
| | | | It now checks the usage argument itself and use generics for the data vector.
* Use ByteBuf for the canvas messagesAnthony Ramine2018-03-261-1/+5
| | | | | The type Vec<u8> is super unefficient to work with in Serde if all you want to represent is a simple blob.
* Replace all uses of the `heapsize` crate with `malloc_size_of`.Nicholas Nethercote2017-10-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Servo currently uses `heapsize`, but Stylo/Gecko use `malloc_size_of`. `malloc_size_of` is better -- it handles various cases that `heapsize` does not -- so this patch changes Servo to use `malloc_size_of`. This patch makes the following changes to the `malloc_size_of` crate. - Adds `MallocSizeOf` trait implementations for numerous types, some built-in (e.g. `VecDeque`), some external and Servo-only (e.g. `string_cache`). - Makes `enclosing_size_of_op` optional, because vanilla jemalloc doesn't support that operation. - For `HashSet`/`HashMap`, falls back to a computed estimate when `enclosing_size_of_op` isn't available. - Adds an extern "C" `malloc_size_of` function that does the actual heap measurement; this is based on the same functions from the `heapsize` crate. This patch makes the following changes elsewhere. - Converts all the uses of `heapsize` to instead use `malloc_size_of`. - Disables the "heapsize"/"heap_size" feature for the external crates that provide it. - Removes the `HeapSizeOf` implementation from `hashglobe`. - Adds `ignore` annotations to a few `Rc`/`Arc`, because `malloc_size_of` doesn't derive those types, unlike `heapsize`.
* Remove use of unstable box syntax.Simon Sapin2017-10-161-1/+1
| | | | | | | | | | | | | | | | | | | | http://www.robohornet.org gives a score of 101.36 on master, and 102.68 with this PR. The latter is slightly better, but probably within noise level. So it looks like this PR does not affect DOM performance. This is expected since `Box::new` is defined as: ```rust impl<T> Box<T> { #[inline(always)] pub fn new(x: T) -> Box<T> { box x } } ``` With inlining, it should compile to the same as box syntax.
* Rename Root<T> to DomRoot<T>Anthony Ramine2017-09-261-3/+3
| | | | | | | In a later PR, DomRoot<T> will become a type alias of Root<Dom<T>>, where Root<T> will be able to handle all the things that need to be rooted that have a stable traceable address that doesn't move for the whole lifetime of the root. Stay tuned.
* Rename DOMRefCell<T> to DomRefCell<T>Anthony Ramine2017-09-261-3/+3
| | | | | | | | I don't want to do such a gratuitous rename, but with all the other types now having "Dom" as part of their name, and especially with "DomOnceCell", I feel like the other cell type that we already have should also follow the convention. That argument loses weight though when we realise there is still DOMString and other things.
* Rename dom::bindings::js to dom::bindings::rootAnthony Ramine2017-09-261-1/+1
|
* Revert "Auto merge of #18114 - emilio:revert-webgl-refactor, r=nox"Anthony Ramine2017-08-161-16/+13
| | | | | This reverts commit 4d10d39e8fe841c5fe2ac58da2daaa13c10c140e, reversing changes made to ee94e2b7c0bd327abe8f9545b2a1f792f67a2bdd.
* Revert "Auto merge of #17891 - MortimerGoro:webgl_move, r=glennw,emilio"Emilio Cobos Álvarez2017-08-161-13/+16
| | | | | This reverts commit 90f55ea4580e2a15f7d70d0491444f18b972d450, reversing changes made to 2e60b27a2186a8cba4b952960155dfcf3f47d7db.
* Improve WebGL architecture.Imanol Fernandez2017-08-151-16/+13
|
* Upgrade to the latest version of WebRenderMartin Robinson2017-07-131-3/+3
|
* Implement WebGL extensions.Imanol Fernandez2017-05-181-1/+38
|
* Make #[dom_struct] a proc_macro attributeAnthony Ramine2017-02-241-0/+1
|
* Expose WebGL-related interfaces only in WindowAnthony Ramine2016-11-301-5/+5
|
* update depsGregory2016-11-221-2/+3
| | | | | | | | | | 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
* Make reflect_dom_object take a &GlobalScopeAnthony Ramine2016-10-061-3/+3
|
* Use wrappers for GL IDsAnthony Ramine2016-06-281-8/+15
| | | | See https://github.com/servo/webrender_traits/pull/62.
* Implement IsBuffer, IsFramebuffer and IsRenderbuffer for WebGLRenderingContextDaniel2016-05-291-0/+8
|
* #10211: Stop re-exporting webrender_traits WebGL types from canvas_traitsJan-Fabian Humann2016-03-301-5/+6
|
* Issue #8738: bufferSubData and texImage2D argument sanity checks.Simon Martin2015-12-261-0/+20
|
* merge from masterrohan.prinja2015-11-031-1/+7
|\
| * webgl: Add destructors for texture, program, shader, buffer and framebufferEmilio Cobos Álvarez2015-11-011-1/+7
| | | | | | | | | | | | | | | | | | | | This allows to cleanup resources earlier if they stop being used. Right now all resources were cleaned up when the context was destroyed, this is a slightly better approach. We ignore the possible failure of the send() call, since we don't keep track of these resources from the `WebGLRenderingContext` structure, so a texture could be destroyed after the context and give us problems.
* | more refactoringrohan.prinja2015-10-301-1/+1
|/
* Fix reported test-tidy errors for unmerged import blocksBrandon Fairchild2015-09-191-2/+1
| | | | This merges import blocks that were reported by tidy as unmerged.
* Remove helper traitsAnthony Ramine2015-08-271-9/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that JSRef<T> is gone, there is no need to have helper traits. On components/script/*.rs: # Remove imports. /^ *use dom::[a-z]+::\{.*Helpers/ { s/\{(Raw[^L]|[^L][^a])[a-zA-Z]+Helpers, /\{/ s/, (Raw[^L]|[^L][^a])[a-zA-Z]+Helpers([,}])/\2/g s/\{([a-zA-Z]+)\}/\1/ /\{\}/d s/::self;$/;/ } /^ *use dom::[a-z]+::\{?(Raw[^L]|[^L][^a])[a-zA-Z]+Helpers\}?;$/d On components/script/dom/*.rs: # Ignore layout things. /^(pub )?(impl|trait).*Layout.* \{/,/^}$/ { P; D; } # Delete helpers traits. /^(pub )?trait ([^L][^ ]|L[^a])[^ ]+Helpers(<'a>)? \{$/,/^\}$/D # Patch private helpers. /^impl.*Private.*Helpers/,/^\}$/ { s/^impl<'a> Private([^L][^ ]|L[^a])[^ ]+Helpers(<'a>)? for &'a ([^ ]+) \{$/impl \3 {/ /^ *(unsafe )?fn .*\(self.*[<&]'a/ { s/&'a /\&/g s/<'a, /</g } /^ *(unsafe )?fn /s/\(self([,)])/\(\&self\1/ } # Patch public helpers. /^impl.*Helpers/,/^\}$/ { s/^impl(<'a>)? ([^L][^ ]|L[^a])[^ ]+Helpers(<'a>)? for (&'a )?([^ ]+) \{$/impl \5 {/ /^ *(unsafe )?fn .*\(self.*[<&]'a/ { s/&'a /\&/g s/<'a, /</g } /^ *(unsafe )?fn .*\(&?self[,)]/s/(unsafe )?fn/pub &/ /^ *pub (unsafe )?fn /s/\(self([,)])/\(\&self\1/ } The few error cases were then fixed by hand.
* make dom_struct derive HeapSizeOf,João Oliveira2015-08-271-1/+0
| | | | closes #7357
* webgl: Implement multiple calls and improve error detectionecoal952015-08-251-3/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit implements WebGL's: * cullFace * frontFace * enable * disable * depthMask * colorMask * clearDepth * clearStencil * depthFunc * depthRange * hint * lineWidth * pixelStorei * polygonOffset * texParameteri * texParameterf * texImage2D (partially) It inlines a lot of OpenGL calls to keep the file `components/canvas/webgl_paint_task.rs` as small as possible while keeping readability. It also improves error detection on previous calls, and sets node damage on the canvas in the drawing calls. It adds a `TexImage2D` reftest, even though it's not enabled because: * WebGL paints the image when it loads (asynchronously), so the reftest doesn't wait for it and it finishes early * If we change the source for the base64 src of the image it works as expected in non-headless mode, but the test harness locks
* Measure heap memory usage for more types. Fixes #6951Bogdan Cuza2015-08-131-0/+2
|
* script: Make most of 2D canvas and WebGL run over IPC.Patrick Walton2015-07-251-6/+7
| | | | | | To actually make the multiprocess communication work, we'll need to reroute the task creation to the pipeline or the compositor. But this works as a first step.
* address review commentsecoal952015-07-061-2/+3
|
* webgl: Make bind* calls more spec-compliantecoal952015-07-061-4/+4
|
* webgl: Refactor implementation to move logic inside the DOM interfacesecoal952015-07-061-6/+34
| | | | | | | | | | This improves the encapsulation and consistency in our WebGL implementation. Also allows to implement new methods such as `getShaderSource()`. It will also allow us to use `delete()` in the destructors of them (note that we will want to keep track of them from the context).
* Upgrade to SM 39Michael Wu2015-06-191-5/+5
|
* Fix WebGL objects inheritanceecoal952015-05-041-3/+4
|
* It implements enough WebGL spec to draw a triangleDiego Marcos2015-05-021-0/+38