aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/webgltexture.rs
Commit message (Collapse)AuthorAgeFilesLines
* `cargo fix --edition`Simon Sapin2018-11-061-10/+10
|
* Format script componentchansuke2018-09-191-71/+57
|
* webgl: Remove knowledge of attached framebuffers from renderbuffers and ↵Josh Matthews2018-09-101-29/+4
| | | | textures.
* webgl: Ensure that depth and stencil attachments are rebound after messing ↵Josh Matthews2018-09-101-1/+42
| | | | with DEPTH_STENCIL attachments.
* webgl: Remove unnecessary Option from texture API.Josh Matthews2018-09-101-4/+4
|
* Use the DOM cache for gl.getTexParameter(gl.TEXTURE_*_FILTER)Anthony Ramine2018-08-021-52/+57
| | | | Part of #20596.
* Properly set initial values for WebGL texture filtersAnthony Ramine2018-08-021-22/+20
|
* Store a reference to the WebGLRenderingContext in WebGLObjectAnthony Ramine2018-07-241-41/+39
|
* Implement EXT_texture_filter_anisotropicAnthony Ramine2018-06-061-55/+66
|
* Fix the error emitted for invalid targets in WebGLTexture::bindAnthony Ramine2018-04-091-1/+1
| | | | | | It doesn't actually matter because this is only called from WebGLRenderingContext::BindTexture, which already checks the target, but better be safe than sorry.
* Change debug assertions to specific onesjanczer2018-02-071-1/+1
|
* Replace all uses of the `heapsize` crate with `malloc_size_of`.Nicholas Nethercote2017-10-181-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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`.
* Implement DOM to textureImanol Fernandez2017-10-161-0/+12
|
* 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
|
* order derivable traits listsClément DAVID2017-08-231-1/+1
| | | | | | Ignoring : - **generated**.rs - python/tidy/servo_tidy_tests/rust_tidy.rs
* Revert "Auto merge of #18114 - emilio:revert-webgl-refactor, r=nox"Anthony Ramine2017-08-161-16/+14
| | | | | 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-14/+16
| | | | | This reverts commit 90f55ea4580e2a15f7d70d0491444f18b972d450, reversing changes made to 2e60b27a2186a8cba4b952960155dfcf3f47d7db.
* Improve WebGL architecture.Imanol Fernandez2017-08-151-16/+14
|
* Upgrade to the latest version of WebRenderMartin Robinson2017-07-131-3/+3
|
* Implement WebGL extensions.Imanol Fernandez2017-05-181-1/+21
|
* Make #[dom_struct] a proc_macro attributeAnthony Ramine2017-02-241-0/+1
|
* Introduce jsmanaged_arrayAnthony Ramine2016-12-061-1/+1
|
* Mark JSTraceable and its method as unsafeAnthony Ramine2016-12-061-1/+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
* webgl: Validate that framebuffer attachment sizes match.Eric Anholt2016-11-051-1/+1
| | | | | This is required by the WebGL spec, and we need to figure out the FB size like this for validating ReadPixels.
* Make reflect_dom_object take a &GlobalScopeAnthony Ramine2016-10-061-3/+3
|
* Use wrappers for GL IDsAnthony Ramine2016-06-281-8/+16
| | | | See https://github.com/servo/webrender_traits/pull/62.
* webgl: Refactor texture validations to take advantage of rust type systemEmilio Cobos Álvarez2016-06-251-20/+34
| | | | | | | | | | | | | 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`.
* Implement texSubImage2D APIDaosheng Mu2016-06-101-1/+10
|
* Impl copyTexImage2D and copyTexSubImage2DDaniel Robertson2016-05-231-2/+14
| | | | | Implement copyTexImage2D and copyTexSubImage2D for WebGLRenderingContext.
* Implement IsShader fn and IsTexture fn for WebGLRenderingContextDaniel2016-05-091-0/+8
|
* webgl: texture: Make initialize only mark as initialized the current faceEmilio Cobos Álvarez2016-04-201-14/+29
| | | | | Also refactor a bit the code, and remove the unused `is_initialized` flag.
* webgl: Validate that the texture should be power of two if the level isEmilio Cobos Álvarez2016-04-191-0/+4
| | | | greater than 1
* webgl: finish, flush, detachShader, generateMipmap, Uniform1iConnor Brewster2016-04-021-0/+206
|
* #10211: Stop re-exporting webrender_traits WebGL types from canvas_traitsJan-Fabian Humann2016-03-301-7/+8
|
* webgl: Fix texturingEmilio Cobos Álvarez2015-12-031-1/+1
| | | | | | | These two tiny changes were making WebGL textures not work. It was not seen in our texturing test since we render to a texture by default, and that texture was bound to `gl::TEXTURE_2D`.
* 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 needless returnsManish Goregaokar2015-09-041-7/+7
|
* Remove helper traitsAnthony Ramine2015-08-271-14/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.