Commit graph

166 commits

Author SHA1 Message Date
Glenn Watson
119716acb2 Fix canvas image tests when using webrender.
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.
2016-08-30 09:57:38 +10:00
Anthony Ramine
51768844ed Update euclid to 0.10.1 2016-08-21 03:03:45 +02:00
Anthony Ramine
e77efb93c1 Move util::vec::byte_swap to canvas_traits 2016-07-04 16:48:15 +02:00
Anthony Ramine
f8c3fe1076 Make canvas send their data themselves to other canvas 2016-06-16 18:24:04 +01:00
Anthony Ramine
b45f1918d1 Remove JS::from_rooted 2016-05-31 14:43:58 +02:00
Josh Matthews
3cb8af20c2 Remove empty lines following braces. 2016-05-27 13:32:05 -04:00
Anthony Ramine
cdc7bca944 Move DOMString back to script
This entirely removes the 'non-geckolib' feature of the util crate.
2016-05-24 10:54:57 +02:00
Ms2ger
cc2b2b50a7 Remove ConstellationChan.
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.
2016-05-19 17:13:44 +02:00
Per Lundberg
2f7ed1d73e Removed unused imports
This fixes #11185.
2016-05-15 22:24:26 +03:00
David Raifaizen
b5159dc7ff Setting current color to black if canvas is not rendered in document 2016-04-22 09:59:49 -04:00
Ms2ger
03d4bacc05 Use num-traits in script. 2016-04-20 15:23:43 +02:00
Di Xu
76f57efb58 replace Fallible<()> with ErrorResult 2016-04-13 19:56:52 +08:00
Ms2ger
63a00f4dbf Stop sending the renderer id to script. 2016-03-21 17:55:08 +01:00
Ms2ger
7e2e54326f Remove renderer_id fields. 2016-03-21 17:49:47 +01:00
Ms2ger
3c04bca0f4 Remove get_renderer_id functions. 2016-03-21 17:45:42 +01:00
Saurav Sachidanand
939560bd6e Update some canvas properties as enums instead of DOMString 2016-02-19 22:19:09 +05:30
Alexander Lopatin
2be49404be Fix #9508: Beautify our union enums constructors 2016-02-07 02:55:21 +03:00
jmr0
167ffa7a95 adding image metadata notification capabilities to image cache 2016-01-29 20:54:49 -05:00
Kishor Bhat
1ca2073979 Remove unused imports in script 2016-01-17 12:41:28 +05:30
Chad Kimes
ce6075825d Add global default method for Reflectable trait 2016-01-11 20:23:47 -05:00
Chad Kimes
d90141a8f6 Remove global field from CanvasRenderingContext2D 2016-01-10 21:53:18 -05:00
rohan.prinja
1f02c4ebbb task -> thread 2016-01-10 17:58:13 +09:00
bors-servo
9da739acef Auto merge of #9123 - karyon:clippy_cleanup, r=Manishearth
Fix a bunch of clippy lints

This fixes about 130 clippy lints. Let me know if i should split up the commit.

I wasn't sure about some of the changes, especially map_or instead of map(...).unwrap_or(...) and if let instead of single arm match were not always a strict improvement in my opinion, but i'll leave that decision to the reviewer :)

There are about 150 lints left which i thought were clippy bugs or i didn't know how to fix.

cc @Manishearth

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9123)
<!-- Reviewable:end -->
2016-01-03 09:16:34 +05:30
Iszak Bryan
1fa3d36167 Store state of fill or style for canvas pattern 2016-01-02 23:35:04 +00:00
Johannes Linke
6b215f38ee Fix a bunch of clippy lints 2016-01-02 23:27:15 +01:00
bors-servo
11d160fc73 Auto merge of #9109 - nerith:createpattern, r=jdm
Support empty strings as the repeat argument (CreatePattern)

According to the third step in the specification [1], createPattern
should let the repetition argument be "repeat" when it is the empty
string.

The code in CanvasRenderingContext2D::CreatePattern did not implement
this step and instead threw a SyntaxError exception when an empty
string was supplied as the repetition argument.

Fixes #9079.

[1] https://html.spec.whatwg.org/multipage/#dom-context-2d-createpattern

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9109)
<!-- Reviewable:end -->
2016-01-01 21:04:51 +05:30
Brandon Fairchild
1ccab328f9 Support empty strings as the repeat argument (CreatePattern)
According to the third step in the specification [1], createPattern
should let the repetition argument be "repeat" when it is the empty
string.

The code in CanvasRenderingContext2D::CreatePattern did not implement
this step and instead threw a SyntaxError exception when an empty
string was supplied as the repetition argument.

Fixes #9079.

[1] https://html.spec.whatwg.org/multipage/#dom-context-2d-createpattern
2015-12-31 11:48:15 -05:00
Alberto Corona
e6a3c16e9a Enable Pattern variant of CanvasFillOrStrokeStyle
Closes #7608
2015-12-29 10:38:00 -05:00
David Zbarsky
b8e9064fe6 Add origin-clean flag tracking for canvas 2015-12-17 11:40:38 -08:00
Tomas Cernaj
5507be2653 Move ScriptMsg from msg crate into script_traits 2015-12-09 20:50:11 +01:00
David Zbarsky
789a90a82f Implement IsPointInPath 2015-12-05 17:49:49 -08:00
David Zbarsky
302f41d34b Reset canvas state when changing bitmap dimensions 2015-11-30 21:23:51 -08:00
David Zbarsky
ee3f7ad451 Update Canvas webIDL to spec 2015-11-28 20:03:48 -08:00
Simon Sapin
18ecf54d10 Tidy. 2015-11-23 16:16:35 +01:00
David Zbarsky
8408891ec5 Parse currentColor as Canvas2D color 2015-11-21 11:59:19 -08:00
bors-servo
acbe413052 Auto merge of #8530 - KiChjang:split-constellation-msg, r=jdm
Split ConstellationMsg into ScriptMsg and CompositorMsg

Fixes #8356.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8530)
<!-- Reviewable:end -->
2015-11-19 04:39:20 +05:30
Ms2ger
0c61be7a57 Rustfmt some of script. 2015-11-18 11:14:05 +01:00
Keith Yeung
19294db6e5 Split ConstellationMsg into ScriptMsg and CompositorMsg 2015-11-16 23:10:53 -08:00
Alan Jeffrey
84bde75b42 Replaced DOMString constructor by conversion functions.
Replaced DOMString(...) by DOMString::from(...).
Replaced ....0 by String::from(...).
Removed any uses of .to_owner() in DOMString::from("...").
2015-11-12 17:52:59 -06:00
Ms2ger
6b75078503 Make DOMString a newtype around String, rather than a typedef.
This should make it somewhat easier to experiment with alternative
representations in the future. To reduce churn, this commit leaves the String
field public, though.

Also, this will allow us to use the default String type to represent the IDL
USVString type, which explicitly forbids unpaired surrogates, ans as such is
a better match to the Rust String type.
2015-11-04 12:09:11 +01:00
David Zbarsky
722aa86c89 Get rid of a bunch of explicit derefs 2015-11-03 19:51:46 -08:00
rohan.prinja
6e774ea6eb merge from master 2015-11-03 19:01:23 +09:00
Eli Friedman
df7fb8fa32 Remove JSTraceable implementation from RefCell.
The implementation wasn't really right, and we would rather just use
DOMRefCell anyway.
2015-11-02 14:40:57 -08:00
nxnfufunezn
d8ef3809a6 Removed JS::root Fixes #8251 2015-10-31 18:15:16 +05:30
rohan.prinja
45224028db more refactoring 2015-10-30 20:26:29 +09:00
rohan.prinja
bb2536cd01 move Castable into dom::bindings::inheritance 2015-10-30 20:24:42 +09:00
Eli Friedman
81ecf7824c Make unrooted_must_root a bit more aggressive.
Basically, instead of trying to check for specific kinds of statements,
just check the types of all local variables.

Also included are some commented-out proposals for some slightly more
aggressive lints which might be useful (but trigger a little too
frequently at the moment).
2015-10-23 14:43:44 -07:00
bors-servo
9a34decec2 Auto merge of #8086 - froydnj:premultiply-tables, r=jdm
add (un)premultiply tables for canvas {Get,Put}ImageData operations

Pretty straightforward use of lookup tables to replace a bunch of expensive float operations.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8086)
<!-- Reviewable:end -->
2015-10-21 17:48:49 -06:00
bors-servo
252e73ff9b Auto merge of #8115 - nerith:canvas, r=jdm
Don't require the CanvasFillOrStrokeStyle enum to be public

CanvasFillOrStrokeStyle is only used in a single file,
so it does not need to be a public enum.

Fixes #8105.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8115)
<!-- Reviewable:end -->
2015-10-21 08:32:36 -06:00
Anthony Ramine
68014af78e Clean up the cast calls 2015-10-21 11:40:34 +02:00