Commit graph

109 commits

Author SHA1 Message Date
Simon Sapin
69d398f29a Update to rust-cssparser 0.4.0 2015-11-05 08:57:01 +01:00
Manish Goregaokar
ce5586f74a Update euclid to 0.3 2015-10-28 21:34:23 +05:30
Nathan Froyd
9e348e2e8e add premultiply table for PutImageData 2015-10-21 18:30:35 -04:00
Corey Farwell
20beaf5af3 Fix issues found by rust-clippy 2015-10-12 20:21:49 -04:00
Patrick Walton
24fdc8a3c7 Handle zero-sized source surfaces properly, and upgrade ipc-channel to
incorporate the fix for zero-sized shmem on Mac.

Depends on servo/rust-azure#201 and pcwalton/ipc-channel#10.

Closes #7422.
2015-09-30 23:09:36 -07:00
Ravi Shankar
889eec364b sorted the extern crate, mod & use declarations 2015-09-24 02:12:45 +05:30
Brandon Fairchild
de3547e401 Fix reported test-tidy errors for unmerged import blocks
This merges import blocks that were reported by tidy as unmerged.
2015-09-19 12:50:14 -04:00
bors-servo
6a12f00d6d Auto merge of #7605 - nox:skew, r=mbrubeck
Implement "transform: skew()"

Thanks to @Jinwoo-Song for the original commit, which I just rebased and cleaned up. Fixes #6237.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7605)
<!-- Reviewable:end -->
2015-09-16 06:31:48 -06:00
Mathieu Rheaume
7320433cca Remove 'get_*' on getters as per RFC 0344 on various components 2015-09-12 20:14:01 -04:00
Anthony Ramine
f11fcebd9c Bump euclid to 0.2 2015-09-12 01:06:26 +02:00
ecoal95
167885707d webgl: Add shader validation and translation
This commit adds angle-based validation and translation to WebGL
shaders.

The changes to the tex_image_2d test is neccessary (it was not valid
GLES 2.0 shader language).
2015-08-30 14:23:14 +02:00
ecoal95
6341c77700 webgl: Implement multiple calls and improve error detection
This commit implements WebGL's:
 * cullFace
 * frontFace
 * enable
 * disable
 * depthMask
 * colorMask
 * clearDepth
 * clearStencil
 * depthFunc
 * depthRange
 * hint
 * lineWidth
 * pixelStorei
 * polygonOffset
 * texParameteri
 * texParameterf
 * texImage2D (partially)

It inlines a lot of OpenGL calls to keep the file
`components/canvas/webgl_paint_task.rs` as small as possible while
keeping readability.

It also improves error detection on previous calls, and sets node damage
on the canvas in the drawing calls.

It adds a `TexImage2D` reftest, even though it's not enabled because:
 * WebGL paints the image when it loads (asynchronously), so the reftest doesn't wait for it and it finishes early
 * If we change the source for the base64 src of the image it works as expected in non-headless mode, but the test harness locks
2015-08-25 17:16:46 +02:00
Johann Tuffe
ec07178b6f sort all uses 2015-08-20 20:47:12 +08:00
João Oliveira
9c11781880 replace .len() == 0 with is_empty()
closes #7198
2015-08-14 04:00:33 +01:00
bors-servo
6a8bc85284 Auto merge of #7092 - dzbarsky:putimagedata, r=jdm
Clean up and fix PutImageData



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7092)
<!-- Reviewable:end -->
2015-08-09 07:00:56 -06:00
David Zbarsky
2f47bdff4b Fix getImageData with sizes < 1 pixel 2015-08-08 15:43:22 -04:00
David Zbarsky
05c78fbd48 Inline write_pixels 2015-08-08 15:35:16 -04:00
David Zbarsky
51938d579f Switch PutImageData to using CopySurface 2015-08-08 15:35:08 -04:00
David Zbarsky
9a88348978 Clean up dirty rect computation 2015-08-08 05:00:37 -04:00
David Zbarsky
7bcb911cea Inline dirty rect computation 2015-08-08 04:55:23 -04:00
David Zbarsky
48c24f8492 Pass a Rect instead of an Option<Rect> to PutImageData 2015-08-08 04:50:55 -04:00
David Zbarsky
1d02239804 Respect the composition op when drawing images 2015-08-05 20:38:48 -04:00
David Zbarsky
9fbe33b6f2 Implement strokeRect with zero-width or zero-height rects 2015-08-04 17:44:18 -04:00
Patrick Walton
bb99b2f3c8 script: Make most of 2D canvas and WebGL run over IPC.
To actually make the multiprocess communication work, we'll need to
reroute the task creation to the pipeline or the compositor. But this
works as a first step.
2015-07-25 00:50:12 -07:00
Patrick Walton
626974994a canvas: Move to shared memory for images and canvas backing stores.
The idea here is to land this before making images and canvas IPC-safe,
because this will shake out bugs relating to the shared memory. There
are currently test timeouts that are preventing multiprocess images and
canvas from landing, and I believe those are due to the inefficiency of
sending large amounts of data in the unoptimized builds we test with. By
moving to shared memory, this should drastically reduce the number of
copies and `serde` serialization.

Under the hood, this uses Mach OOL messages on Mac and temporary
memory-mapped files on Linux.
2015-07-24 16:14:24 -07:00
Bogdan Cuza
0baa6b477c Replace astersisks with appropriate versions in deps 2015-07-20 20:08:08 +03:00
Martin Robinson
efdf2cd601 Update to latest rust-layers, azure, and skia
GLRasterizationContext is now responsible for doing GPU rasterization.
It can coexist with its target NativeSurface, so we don't have to
continually recreate NativeSurfaces when doing GPU rasterization.
2015-07-14 17:48:50 -07:00
ecoal95
42bd43a696 webgl: Make bind* calls more spec-compliant 2015-07-06 19:54:06 +02:00
ecoal95
b1765c6882 webgl: Refactor implementation to move logic inside the DOM interfaces
This improves the encapsulation and consistency in our WebGL
implementation.

Also allows to implement new methods such as `getShaderSource()`.

It will also allow us to use `delete()` in the destructors of them (note
that we will want to keep track of them from the context).
2015-07-06 19:54:05 +02:00
Ms2ger
73a7e92bfd Update to rustc 2d0cbf3e3e25e092bd9e4c94d08e446b680869f0. 2015-06-25 20:02:36 +02:00
ecoal95
8cbfb3482c Use euclid from crates.io 2015-06-19 00:04:24 +02:00
Hyowon Kim
2e230bdb93 Implement fill and stroke functions for all pattern types and check the zero size gradient. 2015-06-17 09:46:38 +09:00
bors-servo
48e1d45bff Auto merge of #6355 - hyowon:drawing_shadows, r=nox
https://html.spec.whatwg.org/multipage/#when-shadows-are-drawn
r? @nox 
cc @mmatyas @yichoi

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6355)
<!-- Reviewable:end -->
2015-06-16 05:30:20 -06:00
Hyowon Kim
465cea8db5 Implement drawing shadows in canvas. 2015-06-16 08:57:00 +09:00
Simon Sapin
a80a12e41e Use cgl and gleam from crates.io 2015-06-15 23:00:33 +02:00
bors-servo
ceaca2e288 Auto merge of #6357 - ecoal95:more-webgl, r=pcwalton
See the commit descriptions for more details. 

Blocked on https://github.com/servo/gleam/pull/24

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6357)
<!-- Reviewable:end -->
2015-06-13 15:05:08 -06:00
ecoal95
ff568ecc90 webgl: Add multiple WebGL calls (activeTexture + blend*)
* activeTexture
* blendColor
* blendFunc
* blendFuncSeparate
* blendEquation
* blendEquationSeparate

Blocked on gleam.
2015-06-13 23:03:38 +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
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
bors-servo
e09c555a41 Auto merge of #6293 - ecoal95:webgl-objects, r=nox
This commit implements:
* WebGLFramebuffer
* WebGLRenderbuffer
* WebGLTexture

And adds the following methods to `WebGLRenderingContext`:
* create{Texture,Framebuffer,Renderbuffer}
* bind{Texture,Framebuffer,Renderbuffer}
* destroy{Buffer,Texture,Framebuffer,Renderbuffer}

Fixes:
* WebGLUniform location shouldn't inherit from WebGLObject.

Known Issues:
* WebGL objects have to be destroyed on drop, we may want to keep a reference to the context, or maybe a clone of the renderer to achieve this

Also refactors a huge part of the current implementation, to allow
failing on creation of different WebGL objects.

Blocked on https://github.com/servo/gleam/pull/22

A reftest for most of the added functionality is not doable right now,
we need a few more functions in order to upload a texture, for example.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6293)
<!-- Reviewable:end -->
2015-06-09 10:06:37 -05:00
Eduard Burtescu
00e8e5f77d Use the correct log crate and setup env_logger in main. 2015-06-06 23:20:40 +03:00
ecoal95
9f94d39c9e Implement new WebGL interfaces and methods
This commit implements:
* WebGLFramebuffer
* WebGLRenderbuffer
* WebGLTexture

And adds the following methods to `WebGLRenderingContext`:
* create{Texture,Framebuffer,Renderbuffer}
* bind{Texture,Framebuffer,Renderbuffer}
* destroy{Buffer,Texture,Framebuffer,Renderbuffer}

Fixes:
* WebGLUniform location shouldn't inherit from WebGLObject.

Known Issues:
* WebGL objects have to be destroyed on drop, we may want to keep a reference to the context, or maybe a clone of the renderer to achieve this

Also refactors a huge part of the current implementation, to allow
failing on creation of different WebGL objects.

Blocked on https://github.com/servo/gleam/pull/22

A reftest for most of the added functionality is not doable right now,
we need a few more functions in order to upload a texture, for example.
2015-06-06 12:14:01 +02:00
ecoal95
eff2bb4310 WebGLRenderingContext getters and getParameter
This implements the `canvas`, `drawingBufferHeight` and
`drawingBufferWidth` getters to `WebGLRenderingContext`, and an initial
version of `getParameter`.
2015-06-01 16:34:51 +02: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
Mátyás Mustoha
f4c0bd3b80 Turn off default antialiasing for most DrawOptions. 2015-05-28 18:42:16 +02:00
Mátyás Mustoha
322fd5ad9d Add disable-canvas-aa option to test runner. 2015-05-28 11:10:58 +02:00
Mátyás Mustoha
adef44183d Enable antialiasing for the canvas. 2015-05-28 11:10:57 +02:00