Commit graph

79 commits

Author SHA1 Message Date
Hyowon Kim
cc55e2e426 Check invalid values for the shadow attributes. 2015-06-18 16:54:12 +09:00
Corey Farwell
5c408d2be9 rust-geom API changes
https://github.com/servo/rust-geom/pull/81
2015-06-13 12:28:21 -07:00
Hyowon Kim
00240e5550 Implementation of pattern fill style for canvas. 2015-06-13 14:35:13 +09:00
Mátyás Mustoha
3ae64fe739 Remove gfx_traits from the dependencies of [script]. 2015-06-12 12:59:46 +02:00
Hyowon Kim
473afdb196 Add attributes for canvas shadows. 2015-06-12 09:40:00 +09:00
Hyowon Kim
5bbfb42e90 Replace fill_color and stroke_color with fill_style and stroke_style in CanvasContextState.
The fillStyle and strokeStyle attributes can be either
strings(color), CanvasGradients, or CanvasPatterns.
2015-06-06 16:15:11 +09:00
Hyowon Kim
5d05ffc417 Serialize colors for fill and stroke styles in canvas. 2015-06-03 09:11:24 +09:00
bors-servo
0de09b936e Auto merge of #6183 - ecoal95:webglcontextattributes, r=nox
r? @jdm

I couldn't add the `getContextAttributes` method since `CodegenRust`
doesn't know how to return a dictionary value, I'll take a look at it ASAP.

I think the helper functions can return directly the renderer, since they're used just for that, but I wanted to hear your opinions about this.

By the way I'm interested in adding more serious tests for WebGL, and I think the [khronos conformance suit](https://github.com/KhronosGroup/WebGL/tree/master/conformance-suites/1.0.3) should be the best option.

Should I try to integrate it in wpt, or making a `tests/webgl` directory (or similar) inside the servo tree? (Maybe this question should be for @Ms2ger)

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6183)
<!-- Reviewable:end -->
2015-06-01 08:37:48 -05:00
ecoal95
b3ac346749 Add WebGLContextAttributes support
This commit also:
* Allows to return non-rootable dictionaries from
Codegen.
* Merges the two context types in an enum type.
2015-06-01 15:29:38 +02:00
Hyowon Kim
a512e9e507 Correct the calculation of rects for drawimage. 2015-06-01 15:58:38 +09:00
Corey Farwell
8e3f4bba85 Reduce max line length from 150 to 120 characters
Part of https://github.com/servo/servo/issues/6041
2015-05-24 00:01:49 -04:00
bors-servo
77099b25d5 Auto merge of #5586 - pcwalton:no-broken-background-image-redux, r=glennw
r? @jdm

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/5586)
<!-- Reviewable:end -->
2015-05-20 16:43:31 -05:00
Patrick Walton
7e7675c1dc net: Don't load the placeholder image for background images, only for
image fragments.

This also changes the way the placeholder is handled in the image cache
task to decode it up front instead of each time an image fails to load,
both because it was more convenient to implement that way and because
it saves CPU cycles to do so.

This matches the behavior of Gecko and WebKit. It improves the look of
our cached copy of Wikipedia.
2015-05-20 12:00:33 -07:00
ecoal95
3350522306 Layerize canvas
Note that this keeps using readback right now, `NativeSurface` painting
will be implemented soon.

Also see https://github.com/servo/servo/issues/6142
2015-05-20 19:10:50 +02:00
bors-servo
5f2a8494be Auto merge of #5949 - mmatyas:canvas_dirty, r=jdm
With this patch, it is now possible to create nice animations using the canvas.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/5949)
<!-- Reviewable:end -->
2015-05-07 07:09:41 -05:00
Mátyás Mustoha
9302aaab96 Canvas: implement transformation matrix reset. 2015-05-06 20:37:14 +02:00
Mátyás Mustoha
53af4e4cb5 Mark the canvas as dirty on certain drawing calls. 2015-05-06 20:27:26 +02:00
bors-servo
3327fe3013 Auto merge of #5945 - mmatyas:canvas_mxrotate, r=jdm
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/5945)
<!-- Reviewable:end -->
2015-05-06 08:53:56 -05:00
Mátyás Mustoha
e3e2119c4c Canvas: implement transformation matrix rotation. 2015-05-06 12:38:48 +02:00
Simon Sapin
ef8edd4e87 Upgrade to rustc 551a74dddd84cf01440ee84148ebd18bc68bd7c8. 2015-05-05 10:07:34 -04:00
Anthony Ramine
1a30925cad Remove Temporary::new()
Temporary::from_rooted() now takes an Assignable value.
2015-04-28 09:22:46 +02:00
Anthony Ramine
7197052c0d Uniformise root() methods
They now live in traits Rootable, OptionalOptionalRootable, OptionalRootable
and ResultRootable.
2015-04-28 09:22:45 +02:00
Ms2ger
a862479ca8 Remove as_slice() calls from script. 2015-04-26 10:52:55 +02:00
Glenn Watson
d8aef7208e Refactored image cache task - details below.
* Simpler image cache API for clients to use.
 * Significantly fewer threads.
   * One thread for image cache task (multiplexes commands, decoder threads and async resource requests).
   * 4 threads for decoder worker tasks.
 * Removed ReflowEvent hacks in script and layout tasks.
   * Image elements pass a Trusted<T> to image cache, which is used to dirty nodes via script task. Previous use of Untrusted addresses was unsafe.
   * Image requests such as background-image on layout / paint threads trigger repaint only rather than full reflow.
 * Add reflow batching for when multiple images load quickly.
   * Reduces the number of paints loading wikipedia from ~95 to ~35.
 * Reasonably simple to add proper prefetch support in a follow up PR.
 * Async loaded images always construct Image fragments now, instead of generic.
   * Image fragments support the image not being present.
 * Simpler implementation of synchronous image loading for reftests.
 * Removed image holder.
 * image.onload support.
 * image NaturalWidth and NaturalHeight support.
 * Updated WPT expectations.
2015-04-23 09:40:24 +10:00
Mátyás Mustoha
a8343a0750 Canvas: implement global composition and blending. 2015-04-22 20:54:27 +02:00
Mátyás Mustoha
6fd6eefb35 Canvas: add clipping path support. 2015-04-22 16:25:02 +02:00
Mátyás Mustoha
5287cb7fba Canvas: implement rectangle drawing. 2015-04-21 15:21:30 +02:00
Diego Marcos
c82485874d Kicks off a WebGL implementation 2015-04-20 14:29:39 -07:00
Mátyás Mustoha
5b8416a2b6 Canvas: implement context state save/restore. 2015-04-19 21:12:13 +02:00
Mátyás Mustoha
350b060189 Add specification links to canvas line cap and line join 2015-04-15 17:40:23 +02:00
Corey Farwell
cc4a64e1fe Add/update comments with links to spec
Extracted out of #5649

* add more hyperlinks to associated specification for structs/methods
* follow redirects and update links
* replace broken links
* removal of WHATWG multipage page name since the page name is not
  guaranteed to be stable
2015-04-14 18:03:13 -04:00
Mátyás Mustoha
ccfff159e7 Canvas: added lineCap and lineJoin support. 2015-04-14 18:26:41 +02:00
Aneesh Agrawal
5b593a3d32 Switch Arc<Box<Image>> to Arc<Image> for perf boost.
Image used to be a trait, but no longer is, so boxing it is no longer
necessary.
2015-04-10 18:59:02 -04:00
bors-servo
325899bfad Auto merge of #5613 - mmatyas:canvas_miterlimit, r=jdm
This exposes some other canvas tests which were marked as PASS before. Two strokeRect related tests are fixed by #5612, and lineCap/lineJoin will have an implementation soon.
2015-04-09 09:37:44 -05:00
Mátyás Mustoha
93fa9e607a Canvas: added miterLimit support. 2015-04-09 13:00:05 +02:00
Mátyás Mustoha
b9244ec1c2 Canvas: moved Rect validation to a common function. 2015-04-09 11:50:31 +02:00
Mátyás Mustoha
5c560397eb Canvas: added support for the globalAlpha attribute. 2015-04-08 11:49:22 +02:00
bors-servo
f57b487e4d Auto merge of #5562 - mmatyas:canvas_linewidth, r=jdm
Rebase of #5488
2015-04-08 00:56:37 -05:00
Diego Marcos
88954e3e18 Implements drawImage for html image as ImageSource 2015-04-07 11:02:50 -07:00
Mátyás Mustoha
6da2ce9b1b Canvas: added lineWidth support. 2015-04-07 16:10:29 +02:00
Eric Hegnes
e398725242 Consistently name enum members in dom::bindings::error::Error
Fixes #5521
2015-04-05 00:09:40 -04:00
Mátyás Mustoha
56303e21cc Canvas: added arcTo() support. 2015-04-01 21:20:05 +02:00
Mátyás Mustoha
0a3b4f2f65 Canvas: arc throws IndexSizeError on negative radius. 2015-03-30 11:05:33 +02:00
Corey Farwell
d838fcce30 Remove some unnecessary uses of as_slice
For the majority of these cases, `as_slice` can be removed due to
`Deref`. In particular, `Deref` for:

* `String` -> `str`
* `Atom` -> `str`

The latter of those two requires, a bump of the locked `string-cache`
library
2015-03-29 14:42:19 -04:00
bors-servo
f29ea4e4ef auto merge of #5302 : mmatyas/servo/canvas_stroke, r=jdm
This is the servo side patch of servo/rust-azure#149.
2015-03-25 07:54:50 -06:00
Mátyás Mustoha
698b88f71d Canvas: added stroke() support. 2015-03-25 12:52:05 +01:00
Tetsuharu OHZEKI
bc06526610 Add guards to almost CanvasRenderingContext2D methods according to the spec.
http://www.w3.org/html/wg/drafts/2dcontext/html5_canvas_CR/ says

"Except where otherwise specified, for the 2D context interface,
 any method call with a numeric argument whose value is infinite or a
 NaN value must be ignored."

We might define the annotation to generate this behavior in glue code.
However, at now, I use this workaround way.
2015-03-25 15:13:34 +09:00
Tetsuharu OHZEKI
05c6d046dd Enable unrestricted types for CanvasRenderingContext2D. 2015-03-25 15:13:33 +09:00
Diego Marcos
e3f5a76baa Implementing canvas drawImage API for HTML Canvas elements as image source 2015-03-24 12:23:15 -07:00
Manish Goregaokar
3479d3fa7f Replace unsafe_blocks by unsafe_code. 2015-03-21 10:27:32 +01:00