Commit graph

576 commits

Author SHA1 Message Date
pylbrecht
588c09b580 Implement CanvasRenderingContext2D.getTransform() 2020-02-12 08:49:18 +01:00
Kunal Mohan
a4ba33376a
Remove dependency of constellation on canvas
move `ConstellationCanvasMsg` to canvas_traits and start canvas paint thread
to components/servo. This, however, does not remove dependency for conditional
compilation options.
2020-02-06 08:03:49 +05:30
Josh Matthews
bc946edc66
Don't spam the log if the constellation can't be reached from the canvas thread. 2020-01-31 14:39:44 +01:00
pylbrecht
ae110f2e6c Add missing CompositionStyle::Clear 2020-01-27 19:21:45 +01:00
pylbrecht
5a773bf55a Send fill/stroke style along with drawing message 2020-01-25 21:29:36 +01:00
bors-servo
8518553805
Auto merge of #25551 - pylbrecht:raqote, r=jdm
Fix canvas wpt test `path-objects/2d.path.rect.zero.4.html`

<!-- Please describe your changes on the following line: -->
After connecting the lines of a rectangle, a new subpath has to be created containing the rectangle's origin as the only point in the subpath.
(see step 4 of https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-rect)

---
<!-- 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 part of #25331

<!-- Either: -->
- [x] There are tests for these changes

<!-- 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. -->
2020-01-19 18:51:20 -05:00
pylbrecht
3c7205c99f Create new subpath with origin after drawing rect
Step 4 has been missing.
https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-rect
2020-01-19 09:23:18 +01:00
bors-servo
f200e21064
Auto merge of #25543 - szeged:mmatyas__webgl_fns_uniforms_p3, r=jdm
Add support for WebGL2 uniform matrix operations

Adds support for the `uniformMatrix[234]x[234]fv` WebGL2 functions.
See: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.8

<!-- Please describe your changes on the following line: -->

Note: Similarly to #25538, some of the functions here also overlap with their WebGL 1 variant.

cc @jdm @zakorgy @imiklos

---
<!-- 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] There are tests for these changes

<!-- 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. -->
2020-01-17 12:55:14 -05:00
Mátyás Mustoha
7d5048f885 Add support for WebGL2 uniform matrix operations
Adds support for the `uniformMatrix[234]x[234]fv` WebGL2 functions.

See: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.8
2020-01-17 11:42:45 +01:00
bors-servo
dcc72ab14d
Auto merge of #25540 - pylbrecht:raqote, r=jdm
Fix canvas wpt test ensuring there's a subpath when drawing bezier curves

<!-- Please describe your changes on the following line: -->
These changes will ensure there's a subpath when drawing bezier curves.

---
<!-- 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 part of #25331

<!-- Either: -->
- [x] There are tests for these changes

<!-- 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. -->
2020-01-17 02:18:06 -05:00
pylbrecht
ca1e780c59 Add first control point if there's no subpath 2020-01-16 21:28:21 +01:00
Mátyás Mustoha
bc914381a8 Add support for WebGL2 unsigned uniform operations
This adds support for the WebGL2 `uniform[1234]ui` and `uniform[1234]uiv`
operations.

See: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.8
2020-01-15 13:48:35 +01:00
Mátyás Mustoha
da94f8d0e7 Add initial support for WebGL2 uniform buffer functions
Adds initial support for the following WebGL2 calls:

- bindBufferBase
- bindBufferRange
- getUniformIndices
- getUniformBlockIndex
- getActiveUniforms
- getActiveUniformBlockParameter
- getActiveUniformBlockName
- uniformBlockBinding

See: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.16
2020-01-09 11:17:50 +01:00
bors-servo
b876168721
Auto merge of #25445 - pylbrecht:ensure.path.quad, r=jdm
Ensure subpath for control point of CanvasRenderingContext2D.quadraticCurveTo()

<!-- Please describe your changes on the following line: -->
These changes are based on #25444.

---
<!-- 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 part of #25331

<!-- Either: -->
- [x] There are tests for these changes

<!-- 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. -->
2020-01-07 23:27:47 -05:00
bors-servo
bd636b0e6c
Auto merge of #25444 - pylbrecht:raqote, r=jdm
Fix canvas arc path WPT test failures

<!-- Please describe your changes on the following line: -->

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

<!-- Either: -->
- [x] There are tests for these changes

<!-- 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. -->
2020-01-07 20:20:36 -05:00
Josh Matthews
156ad646a0 webgl: Set more ANGLE shader translation properties for WebGL 2. 2020-01-07 10:22:40 -05:00
pylbrecht
215a2c7e60 Ensure there's a subpath for the first control point 2020-01-07 07:26:06 +01:00
pylbrecht
ce48a51e99 Ensure subpath for control point in quadratic_curve_to() 2020-01-07 07:24:18 +01:00
pylbrecht
f691acd958 Ensure there's a subpath for the first control point 2020-01-06 17:42:35 +01:00
pylbrecht
e0547855df Remove duplication for creating gradient stops 2019-12-17 19:52:03 +01:00
pylbrecht
7c8c230d93 Add transform to Pattern::Surface to properly draw images 2019-12-17 19:52:03 +01:00
pylbrecht
9a2370a3a8 Consider empty gradients in is_zero_size_gradient() 2019-12-17 19:52:02 +01:00
pylbrecht
ada7986fef Handle BlendMode::Clear in GenericDrawTarget::fill() 2019-12-17 19:52:02 +01:00
pylbrecht
a50aef6f00 Add a layer to store Pattern related information
Some information of `canvas_data::Pattern` was lost by
converting it to `raqote::Source` due to the fact that Raqote
did not store this information (e.g. linear gradient's start/end
points). We introduce another layer to keep this information for later
use (like in `is_zero_size_gradient()`).
2019-12-17 19:52:02 +01:00
pylbrecht
1aecf40922 Implement "repeat-x" and "repeat-y" for images 2019-12-17 19:52:02 +01:00
pylbrecht
25d036f05c Set images' ExtendMode based on available information 2019-12-17 19:52:02 +01:00
pylbrecht
1cdcbb25fa Handle overlapping gradient stops for linear gradients
From `addColorStop(offset, color)`s spec:
If multiple stops are added at the same offset on a gradient, they must
be placed in the order added, with the first one closest to the start of
the gradient, and each subsequent one infinitesimally further along
towards the end point (in effect causing all but the first and last stop
added at each point to be ignored)

https://www.w3.org/html/test/results/2dcontext/annotated-spec/canvas.html#testrefs.2d.gradient.interpolate.overlapu
2019-12-17 19:52:01 +01:00
pylbrecht
04e9523e5f Use push_layer_with_blend() only when necessary
push_layer_with_blend() comes at a performance cost, so we only use it
on blend modes that require it.
2019-12-17 19:52:01 +01:00
pylbrecht
a02daef7b2 Make arc() wrap angles mod 2pi 2019-12-17 19:52:01 +01:00
pylbrecht
02e3325416 Make arc() use anticlockwise argument 2019-12-17 19:52:01 +01:00
pylbrecht
da9b4c33cd Make fill() handle all composition operations 2019-12-17 19:52:00 +01:00
pylbrecht
47ee2729ec Make fill() draw uncovered pixels as (0,0,0,0) for certain composition ops 2019-12-17 19:52:00 +01:00
pylbrecht
4d4e68ca6b Respect direction when drawing arcs 2019-12-17 19:52:00 +01:00
pylbrecht
a473f50245 Respect FilterMode when drawing images 2019-12-17 19:51:59 +01:00
pylbrecht
16f06f24c5 Add check for handling equal radial gradients 2019-12-17 19:51:59 +01:00
pylbrecht
d87e5d831b Add check to handle zerosize linear gradients 2019-12-17 19:51:59 +01:00
pylbrecht
55256df0ba Use tolerance > 0 in Path::contains_point() 2019-12-17 19:51:58 +01:00
pylbrecht
5c6a12a116 Create raqote::SolidSource with premultiplied color
SolidSource expects a premultiplied color.
2019-12-17 19:51:57 +01:00
pylbrecht
77a8bc4a1d Fix conversion of image data slice 2019-12-17 19:51:57 +01:00
pylbrecht
b8b33788b6 Handle empty paths in PathBuilder::get_current_point()
The case of calling get_current_point() on empty paths has not been
handled and caused panics.
2019-12-17 19:51:57 +01:00
pylbrecht
d6f46b5513 Apply transformation in Path::contains_point() 2019-12-17 19:51:56 +01:00
pylbrecht
c8025c9147 Don't reuse PathBuilder after calling finish() 2019-12-17 19:51:56 +01:00
Alan Jeffrey
44db86fefd Add extra debug assertions for WebGL errors 2019-12-06 14:56:46 -06:00
Emilio Cobos Álvarez
f8e924f86a
style: Don't specify minor version for cssparser. 2019-11-30 20:45:06 +01:00
Josh Matthews
564c16d754 Use non-IPC webrender API over explicit IPC channels. 2019-11-27 20:47:53 -05:00
Mátyás Mustoha
8fefa23019 Add support for WebGL2 ReadPixels functions
Adds support for the new ReadPixels functions introduced with WebGL2
and the relevant PixelStorei parameters.

Reference: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.10
2019-11-26 16:09:13 +01:00
bors-servo
7da8d75a7e
Auto merge of #24426 - servo:wrup, r=jdm,nox
Update webrender

<!-- 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/24426)
<!-- Reviewable:end -->
2019-11-20 05:08:32 -05:00
Alan Jeffrey
124de75089 Avoid recompiling script every time surfman changes 2019-11-18 09:40:58 -06:00
Anthony Ramine
808c34498b Update webrender and serde_bytes 2019-11-13 11:54:51 -05:00
bors-servo
31ee5fc2f5
Auto merge of #24676 - Manishearth:unpatch, r=jdm
Remove patched webxr

Unsure if this compiles yet, testing locally.

r? @jdm
2019-11-11 19:25:22 -05:00