Anthony Ramine
804d964b7d
Send an IpcSharedMemory in tex_image_2d and tex_sub_image_2d
...
This avoids a copy in the case of textures coming from HTMLImageElement.
2018-11-20 10:14:52 +01:00
Jan Andre Ikenmeyer
a1a14459c1
Update MPL license to https (part 3)
2018-11-19 14:47:12 +01:00
Anthony Ramine
a5779ad372
Prefix some pixels functions with rgba8_
2018-11-16 12:37:34 +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
Pyfisch
9e92eb205a
Reorder imports
2018-11-06 22:35:07 +01:00
Simon Sapin
45f7199eee
cargo fix --edition
2018-11-06 15:26:02 +01:00
Anthony Ramine
e62dbabb46
Handle some transparent black cases in ctx.getImageData
2018-10-07 02:52:06 +02:00
Anthony Ramine
75e6f5dfaa
Avoid copying pixels in ctx.putImageData sometimes
2018-10-06 02:59:25 +02:00
Anthony Ramine
19f40cdf0b
Introduce ImageData::get_rect
...
We use that to send only the pixels that will be actually drawn to the
canvas thread in CanvasRenderingContext2d::PutImageData.
We also make the canvas thread byte swap and premultiply colours in-place.
2018-10-06 01:12:05 +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
Simon Sapin
1333b6ee45
Fix the build for NLL
...
Test with `RUSTFLAGS="-Zborrowck=mir -Ztwo-phase-borrows" cargo build`
https://internals.rust-lang.org/t/help-us-get-non-lexical-lifetimes-nll-over-the-finish-line/7807/7
2018-08-24 17:49:58 +02:00
Josh Matthews
7c32ad7c3d
Revert "Fix the build for NLL"
...
This reverts commit d1733aa502
.
2018-08-07 20:24:55 -04:00
Simon Sapin
d1733aa502
Fix the build for NLL
...
Test with `RUSTFLAGS="-Zborrowck=mir -Ztwo-phase-borrows" cargo build`
https://internals.rust-lang.org/t/help-us-get-non-lexical-lifetimes-nll-over-the-finish-line/7807/7
2018-08-08 00:09:56 +02:00
Simon Sapin
b78ac6ba6a
Use safe NonZero constructor instead of an explicit null check
2018-01-22 17:41:26 +01:00
Simon Sapin
52eda6082f
Replace NonNullJSObjectPtr with std::ptr::NonNull<JSObject>
2018-01-22 17:41:25 +01:00
Simon Sapin
4d459bce32
Fix tyvar_behind_raw_pointer warnings
...
https://github.com/rust-lang/rust/issues/46906
2018-01-10 20:54:35 +01:00
Simon Sapin
e2fafd2dfc
Replace NonZero<*mut JSObject> with a wrapper to enable local trait impls.
2017-10-16 20:19:56 +02:00
Simon Sapin
aa15dc269f
Remove use of unstable box syntax.
...
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.
2017-10-16 17:16:20 +02:00
Anthony Ramine
f87c2a8d76
Rename Root<T> to DomRoot<T>
...
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.
2017-09-26 09:49:10 +02:00
Anthony Ramine
0e3c54c191
Rename dom::bindings::js to dom::bindings::root
2017-09-26 02:19:05 +02:00
Simon Sapin
a205c82264
Upgrade to rustc 1.21.0-nightly (599be0d18 2017-07-26)
2017-07-27 02:21:01 +02:00
Simon Sapin
7af5a7fd54
Untry script
2017-06-18 13:21:49 +02:00
Nicolas Silva
8617320500
Bump euclid to 0.14.
2017-06-14 16:00:59 +02:00
Lucjan Suski
c83ac31e71
Make ImageData::new return Fallible instead of panic
2017-03-20 21:16:55 +01:00
montrivo
46a25d621c
Implement ImageData constructors #15671
2017-03-14 23:16:17 +01:00
Anthony Ramine
31e9d81c0f
Make #[dom_struct] a proc_macro attribute
2017-02-24 01:50:51 +01:00
Ms2ger
67c572af37
Update js.
...
Fixes #15553 .
2017-02-15 16:27:29 +01:00
Alan Jeffrey
fc67878edf
Remove warnings about unnecessary mutability.
2017-01-28 21:48:07 -06:00
Ms2ger
2839bca065
Use the typed array APIs in ImageData.
2017-01-09 14:00:54 +01:00
Abelardo E. Mendoza
b372e7c98f
script creates methods taking '*mut JSContext' unsafe
...
rebase + marked the necessary new code as unsafe
2016-11-14 11:06:17 +01:00
Anthony Ramine
fcb59d3057
Make reflect_dom_object take a &GlobalScope
2016-10-06 20:59:09 +02:00
Anthony Ramine
6e1523f4ae
Compile WebIDL return type "object" to NonZero<*mut JSObject>
2016-08-30 19:07:13 +02:00
Anthony Ramine
2400b91d05
Don't bother with the global in ImageData::get_image_data
2016-08-30 19:06:41 +02:00
Anthony Ramine
854a3dff68
Assert that ImageData::data is not null
2016-08-30 19:06:40 +02:00
Anthony Ramine
eb94f1a918
Update SpiderMonkey
2016-05-03 18:36:11 +02:00
Brandon Fairchild
341e66f66d
Remove #[allow(raw_pointer_derive)]
attributes
...
The attributes are unused.
Fixes #8699 .
2015-11-27 14:32:57 -05:00
rohan.prinja
45224028db
more refactoring
2015-10-30 20:26:29 +09:00
Ravi Shankar
889eec364b
sorted the extern crate, mod & use declarations
2015-09-24 02:12:45 +05:30
Corey Farwell
5ccb0d43ef
Merge adjacent identical impl
sections
...
Prior to #7416 and #7401 , many of these `impl` sections were not
identical
2015-08-28 10:30:42 -04:00
Anthony Ramine
709d347872
Make the traits for the IDL interfaces take &self
2015-08-27 22:27:43 +02:00
Anthony Ramine
c831c2c0a5
Remove helper traits
...
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.
2015-08-27 16:59:02 +02:00
João Oliveira
fd87c8cb3e
make dom_struct derive HeapSizeOf,
...
closes #7357
2015-08-27 01:17:48 +01:00
Johann Tuffe
ec07178b6f
sort all uses
2015-08-20 20:47:12 +08:00
Bogdan Cuza
45145108da
Measure heap memory usage for more types. Fixes #6951
2015-08-13 21:44:41 +03:00
Michael Wu
675267b782
Upgrade to SM 39
2015-06-19 18:42:48 -04:00
ecoal95
8cbfb3482c
Use euclid from crates.io
2015-06-19 00:04:24 +02:00
Corey Farwell
5c408d2be9
rust-geom API changes
...
https://github.com/servo/rust-geom/pull/81
2015-06-13 12:28:21 -07:00
Manish Goregaokar
968b335f9b
Audit and reduce unstable usage in script
...
Reasons behind existing unstable features:
alloc:
- `Rc.make_unique()`
- `into_raw` / `from_raw` (naming). All over the bindings code.
collections:
- `Vec.push_all()`
- `from_str`
- can be replaced by `.to_owned()`
- `from_raw_buf`
- could be done directly
core:
- `nonzero`
- `UnsafeCell` (`as_unsafe_cell`)
- `Zeroable`
- `Peekable.is_empty`
std_misc:
- Handle stuff
2015-06-10 01:20:06 +05:30
Simon Sapin
ef8edd4e87
Upgrade to rustc 551a74dddd84cf01440ee84148ebd18bc68bd7c8.
2015-05-05 10:07:34 -04:00