Auto merge of #25603 - pylbrecht:raqote, r=jdm

Update CanvasRenderingContext2D fillStyle and strokeStyle only when required

So far fill and stroke style updates have been sent to the canvas paint
thread by `SetFillStyle()` and `SetStrokeStyle()`. This resulted in
fill/stroke style updates not being considered by the canvas paint
thread between the latest call of `SetFillStyle()`/`SetStrokeStyle()` and
the drawing operation (e.g. fill or stroke).

This issue is solved by making `SetFillStyle()` and `SetStrokeStyle()`
update the local canvas state and propagating the state to the canvas
paint thread along with the drawing operations that require it.

<!-- 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

<!-- 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. -->
This commit is contained in:
bors-servo 2020-01-25 22:06:47 -05:00 committed by GitHub
commit 0bd2661492
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 44 additions and 55 deletions

View file

@ -1,5 +0,0 @@
[2d.gradient.object.update.html]
type: testharness
[Canvas test: 2d.gradient.object.update]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.pattern.animated.gif.html]
[createPattern() of an animated GIF draws the first frame]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.gradient.object.update.html]
[OffscreenCanvas test: 2d.gradient.object.update]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.gradient.object.update.worker.html]
[2d]
expected: FAIL