aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/canvasrenderingcontext2d.rs
Commit message (Collapse)AuthorAgeFilesLines
* Replace all uses of the `heapsize` crate with `malloc_size_of`.Nicholas Nethercote2017-10-181-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/+3
| | | | | | | | | | | | | | | | | | | | 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-14/+14
| | | | | | | 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-7/+7
| | | | | | | | 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 LayoutJS<T> to LayoutDom<T>Anthony Ramine2017-09-261-2/+2
|
* Rename JS<T> to Dom<T>Anthony Ramine2017-09-261-9/+9
|
* Rename dom::bindings::js to dom::bindings::rootAnthony Ramine2017-09-261-1/+1
|
* Implement Ellipse Canvas 2D APIJoone Hur2017-09-011-0/+20
| | | | | | | | | * Update rust-azure to 0.21.0 * Mark the following test case as fail: tests/wpt/mozilla/tests/mozilla/css-paint-api/background-image-tiled.html * Make the ellipse test case pass. BUG: https://github.com/servo/servo/issues/17598
* Auto merge of #18179 - davidcl:master, r=jdmbors-servo2017-08-231-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Automatically verify that derive() lists are alphabetically ordered #… <!-- Please describe your changes on the following line: --> Automatically verify that derive() lists are alphabetically ordered #18172 --- <!-- 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 #18172 (github issue number if applicable). <!-- Either: --> - [X] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- 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/18179) <!-- Reviewable:end -->
| * order derivable traits listsClément DAVID2017-08-231-2/+2
| | | | | | | | | | | | Ignoring : - **generated**.rs - python/tidy/servo_tidy_tests/rust_tidy.rs
* | Implement CanvasRenderingContext2d.fillText's "unimplemented" messageBruno Bernardino2017-08-231-0/+7
|/
* Revert "Auto merge of #18114 - emilio:revert-webgl-refactor, r=nox"Anthony Ramine2017-08-161-10/+6
| | | | | 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-6/+10
| | | | | This reverts commit 90f55ea4580e2a15f7d70d0491444f18b972d450, reversing changes made to 2e60b27a2186a8cba4b952960155dfcf3f47d7db.
* Improve WebGL architecture.Imanol Fernandez2017-08-151-10/+6
|
* make use of ScriptToConstellationChanPaul Rouget2017-08-151-3/+3
|
* Implement drawing an image from a CSS style value into a canvas.Alan Jeffrey2017-07-211-53/+117
|
* Implemented paint worklet rendering context.Alan Jeffrey2017-06-301-17/+40
|
* Untry scriptSimon Sapin2017-06-181-3/+3
|
* Update WR (CPU text optimizations, image format renames).Glenn Watson2017-06-161-1/+1
|
* Bump euclid to 0.14.Nicolas Silva2017-06-141-13/+10
|
* Thread ParseError return values through CSS parsing.Josh Matthews2017-06-091-3/+5
|
* Use the origin of the actual image response when determining if a canvas is ↵SendilKumar N2017-05-191-13/+8
| | | | origin clean.
* Remove IndexSizeError in CanvasRenderingContext2D::drawImagen0max2017-04-291-2/+2
|
* Make image cache per-document rather than globalFernando Jiménez Moreno2017-03-271-1/+1
|
* Make ImageData::new return Fallible instead of panicLucjan Suski2017-03-201-6/+6
|
* removed instances of -> () in existing codelucantrop2017-03-131-1/+1
|
* Make #[dom_struct] a proc_macro attributeAnthony Ramine2017-02-241-0/+1
|
* Make script thread initiate requests for images needed by layout.Josh Matthews2017-02-221-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In support of this goal, the layout thread collects information about CSS images that are missing image data and hands it off to the script thread after layout completes. The script thread stores a list of nodes that will need to be reflowed after the associated network request is complete. The script thread ensures that the nodes are not GCed while a request is ongoing, which the layout thread is incapable of guaranteeing. The image cache's API has also been redesigned in support of this work. No network requests are made by the new image cache, since it does not possess the document-specific information necessary to initiate them. Instead, there is now a single, synchronous query operation that optionally reserves a slot when a cache entry for a URL cannot be found. This reserved slot is then the responsibility of the queryer to populate with the contents of the network response for the URL once it is complete. Any subsequent queries for the same URL will be informed that the response is pending until that occurs. The changes to layout also remove the synchronous image loading code path, which means that reftests now test the same code that non-test binaries execute. The decision to take a screenshot now considers whether there are any outstanding image requests for layout in order to avoid intermittent failures in reftests that use CSS images.
* style: Unbox a bunch of color properties.Emilio Cobos Álvarez2017-02-141-18/+8
| | | | This builds on https://github.com/servo/rust-cssparser/pull/118.
* Error handled canvas closingPrudhvi Rampey2016-12-281-1/+3
|
* Rename `Reflectable` to `DomObject`.Corey Farwell2016-12-081-1/+1
| | | | Fixes https://github.com/servo/servo/issues/8473.
* Urlmageddon: Use refcounted urls more often.Emilio Cobos Álvarez2016-11-171-2/+2
|
* Remove old rendering backend.Glenn Watson2016-10-181-10/+2
| | | | | | | | | | | | | | This removes paint threads, rust-layers dependency, and changes optional webrender types to be required. The use_webrender option has been removed, however I've left the "-w" command line option in place so that wpt runner can continue to pass that. Once it's removed from there we can also remove the -w option. Once this stage is complete, it should be fine to change the display list building code to generate webrender display lists directly and avoid the conversion step.
* Remove intrinsic Root::r()Anthony Ramine2016-10-111-11/+8
|
* Rename Reflectable::global_scope to globalAnthony Ramine2016-10-061-6/+6
|
* Make CanvasRenderingContext2d::new take a &GlobalScopeAnthony Ramine2016-10-061-5/+5
|
* Introduce Reflectable::global_scopeAnthony Ramine2016-10-061-6/+6
|
* Introduce GlobalScope::constellation_chanAnthony Ramine2016-10-061-1/+1
|
* Make reflect_dom_object take a &GlobalScopeAnthony Ramine2016-10-061-7/+7
|
* More code refactoring (exampleVar to example_var)Arthur Marble2016-09-181-6/+6
|
* Reorder `use` statementsUK9922016-09-091-3/+3
|
* Don't bother with the global in ImageData::get_image_dataAnthony Ramine2016-08-301-1/+1
|
* Fix canvas image tests when using webrender.Glenn Watson2016-08-301-2/+10
| | | | | | When webrender is enabled, image decoding doesn't pre-multiply by alpha, but the canvas code expects the image data to be pre-multiplied form.
* Update euclid to 0.10.1Anthony Ramine2016-08-211-17/+10
|
* Move util::vec::byte_swap to canvas_traitsAnthony Ramine2016-07-041-3/+3
|
* Make canvas send their data themselves to other canvasAnthony Ramine2016-06-161-22/+15
|
* Remove JS::from_rootedAnthony Ramine2016-05-311-2/+2
|
* Remove empty lines following braces.Josh Matthews2016-05-271-1/+0
|
* Move DOMString back to scriptAnthony Ramine2016-05-241-1/+1
| | | | This entirely removes the 'non-geckolib' feature of the util crate.
* Remove ConstellationChan.Ms2ger2016-05-191-1/+1
| | | | | | 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.