Commit graph

200 commits

Author SHA1 Message Date
Josh Matthews
1e3d72dc82 Fix deprecation warnings. 2020-11-12 15:47:08 -05:00
Josh Matthews
1ae117f67b dom: Add stub implementation for HTMLCanvasElement.captureStream. 2020-07-14 12:48:45 -04:00
Kunal Mohan
71401e0855 Implement GPUSwapChain and GPUCanvasContext and interface with Webrender 2020-06-13 17:46:12 +05:30
Alex Touchet
5166cc35f4
Update some URLs 2020-05-04 10:26:35 -07:00
bors-servo
c9480c8e07
Auto merge of #23661 - julientregoat:i-21289, r=jdm
Refactor ImageCache::find_image_or_metadata -> ImageCache::{get_image, track_image}

<!-- Please describe your changes on the following line: -->
Updated the `ImageCache` trait to replace `find_image_or_metadata` with two new functions `track_image` and `get_image`, as well as a new enum (`ImageCacheResult`).

As a result, I was able to refactor the functions that previously called `find_image_or_metadata` pretty cleanly. For a list of these functions, please see the commit information.

---
<!-- 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 #21289  (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because tests already exist for these components. I ran `cargo test` in `net`, `net_traits`, `layout`, and `script` successfully.

<!-- 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/23661)
<!-- Reviewable:end -->
2020-04-17 15:56:30 -04:00
Julien Tregoat
2742fd2bea Refactor ImageCache::find_image_or_metadata API. 2020-04-17 11:58:18 -04:00
Josh Matthews
e2845a6939 Automatically enable WebGL 2 for specific domains. 2020-04-15 17:26:42 -04:00
Manish Goregaokar
fccfff11c5 Update euclid 2020-04-07 08:51:08 -07:00
Anthony Ramine
a913c6650d Reduce scope of unsafe block in LayoutHTMLCanvasElementHelpers::data 2020-03-31 19:06:25 +02:00
Anthony Ramine
5ff931d171 Introduce <LayoutDom<Element>>::attrs()
This safe method is the basic block to access element attributes from layout.
We reuse it in the other attr-related layout methods to remove a pretty big
source of rampant unsafe code between script and layout.
2020-03-31 18:46:49 +02:00
Anthony Ramine
0bda174823 Merge RawLayoutElementHelpers into LayoutElementHelpers 2020-03-31 18:30:42 +02:00
Anthony Ramine
56ef9b5170 Make LayoutHTMLCanvasElementHelpers methods take self 2020-03-29 17:18:31 +02:00
Anthony Ramine
dba6a635e5 Give a lifetime parameter to LayoutDom 2020-03-28 15:37:57 +01:00
YUAN LYU
3ea6d87bcc
Add trait DomObjectWrap to provide WRAP function 2020-03-20 22:16:56 -04:00
Anthony Ramine
9996e48500 Remove syn 0.15 from our crate graph (fixes #24421)
This required bumps of:

* gleam
* image
* rust-webvr
* webrender
* webxr
2020-03-05 13:01:13 +01:00
Kunal Mohan
02c1612cb0
Add accountable-refcell as optional build time feature 2020-01-08 09:44:41 +05:30
Simon Sapin
bea73951db Use #![register_tool] instead of #![register_attr]
CC https://github.com/rust-lang/rust/issues/66079
2019-11-15 17:24:42 +01:00
Bailey Blankenship
ec2961920b Addresses issues raised in #24465; removes redundancy in set_bitmap_dimensions
Removed passing test .ini files and moved euclid extensions to euclidext.rs to factor out redundant code
2019-11-10 18:37:14 -05:00
Josh Matthews
1df8d57dc6 Support CORS attributes for image elements. 2019-10-04 15:08:40 -04:00
Josh Matthews
81a67aed9e Double key image cache by requesting origin, and store CORS status with cached images. 2019-10-04 09:22:21 -04:00
marmeladema
1d92796b03 Remove some usage of unsafe code in HTMLCanvasElement 2019-08-09 00:02:08 +01:00
marmeladema
2c5d0a6ebc Convert CGTraitInterface to use safe JSContext instead of raw JSContext 2019-07-24 08:24:50 +01:00
marmeladema
808fa65aef Convert internal methods to handle safe JSContext instead of raw JSContext 2019-07-24 08:18:22 +01:00
Emilio Cobos Álvarez
3d57c22e9c Update euclid.
There are a few canvas2d-related dependencies that haven't updated, but they
only use euclid internally so that's not blocking landing the rest of the
changes.

Given the size of this patch, I think it's useful to get this landed as-is.
2019-07-23 23:09:55 +02:00
Peter Hall
8bfd4dc1e2 #8539 Config preferences backend restructure 2019-03-20 15:01:26 +00:00
Josh Matthews
3121f42d52 Remove offscreen_gl_context dependency from canvas_traits and script. 2019-03-07 09:27:36 -05:00
Simon Sapin
be69f9c3e6 Rustfmt has changed its default style :/ 2018-12-28 13:17:47 +01:00
Anthony Ramine
9a8d03a0f3 Make HTMLCanvasElement::fetch_all_data return a shared memory blob 2018-11-21 12:53:50 +01:00
Jan Andre Ikenmeyer
a1a14459c1
Update MPL license to https (part 3) 2018-11-19 14:47:12 +01:00
Simon Sapin
9f977c5287 Remove useless use crate_name; imports.
A `crate_name::foo` path always works in 2018
2018-11-08 09:29:52 +01:00
Simon Sapin
2012be4a8b cargo fix --edition-idioms 2018-11-08 09:28:00 +01:00
Pyfisch
9e92eb205a Reorder imports 2018-11-06 22:35:07 +01:00
Pyfisch
cb07debcb6 Format remaining files 2018-11-06 22:30:31 +01:00
Simon Sapin
45f7199eee cargo fix --edition 2018-11-06 15:26:02 +01:00
Anthony Ramine
6c469b90b1 Share some code between 2D canvas and WebGL 2018-10-09 14:57:02 +02:00
Anthony Ramine
05ef233097 Add a couple of bug links 2018-10-08 13:13:24 +02:00
Anthony Ramine
551c405b0f Avoid ctx.getImageData in canvas.toDataURL 2018-10-08 12:19:10 +02:00
Anthony Ramine
241dba064d Align ctx.createImageData and ctx.getImageData with the spec 2018-10-06 11:41:48 +02:00
Anthony Ramine
75e6f5dfaa Avoid copying pixels in ctx.putImageData sometimes 2018-10-06 02:59:25 +02:00
Anthony Ramine
5efbeea61c Reindent the WebGL 2 case of canvas.toDataURL 2018-10-03 10:44:36 +02:00
Anthony Ramine
cfd446218b Slightly clean up the final URL creation in canvas.toDataURL 2018-10-03 10:43:41 +02:00
Anthony Ramine
a3392610c3 Make HTMLCanvasElement::get_size return a Size2D<u32>
The changes keep trickling down.
2018-10-02 14:21:06 +02:00
chansuke
c37a345dc9 Format script component 2018-09-19 17:40:47 -04:00
Anthony Ramine
f1e8eb640c Don't create 2D canvas contexts arbitrarily
Sometimes, the canvas still has no rendering context, in this case it represents
a transparent black rectangle.
2018-09-16 20:44:41 +02:00
Anthony Ramine
ed673f8070 Mark some canvas methods as unsafe
They use raw JS context pointers.
2018-09-16 20:44:41 +02:00
Anthony Ramine
462a488d55 Update HTMLCanvasElement WebIDL definition 2018-09-15 00:24:21 +02:00
Brody Eastwood
8a1590efc6 Add unique canvas IDs to all canvas operations. 2018-04-02 22:02:22 -04:00
Marcin Mielniczuk
356c57e628 Adapt Servo for mozjs 0.6 and the changes introduced in servo/rust-mozjs#393 2018-03-28 21:28:30 +02:00
Anthony Ramine
ce81420bef Use ByteBuf for the canvas messages
The type Vec<u8> is super unefficient to work with in Serde if all you want
to represent is a simple blob.
2018-03-26 20:48:02 +02:00
Anthony Ramine
a77d35b60c Implement HTMLCanvasElement.toDataURL for WebGL canvas (fixes #19147) 2018-03-23 17:32:42 +01:00