Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upImplement paint worklets rendering context #17326
Conversation
highfive
commented
Jun 14, 2017
|
Heads up! This PR modifies the following files:
|
highfive
commented
Jun 14, 2017
|
The commit "Implemented paint worklets invoking worklet scripts." is #17239. |
| return self.send_invalid_image(size, sender); | ||
| } | ||
| // Step 5.4 | ||
| entry.insert(Heap::new(paint_instance.get())); |
This comment has been minimized.
This comment has been minimized.
jdm
Jun 14, 2017
Member
I'm just going to flag this now - we must not introduce any new uses of Heap::new into Servo due to servo/rust-mozjs#343 . Use Heap::default to create a Heap value and ensure it will never move after that point before calling Heap::set. This hashtable looks very scary to me for this reason :(
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| let context = PaintRenderingContext2D::new(self); | ||
| let definition = PaintDefinition { | ||
| class_constructor: Heap::new(ObjectValue(paint_obj.get())), | ||
| paint_function: Heap::new(paint_function), |
This comment has been minimized.
This comment has been minimized.
|
|
660d8dd
to
137760e
|
|
137760e
to
ab8024d
74c3026
to
4fcf2d7
| @@ -347,7 +358,7 @@ impl CanvasRenderingContext2D { | |||
|
|
|||
| let smoothing_enabled = self.state.borrow().image_smoothing_enabled; | |||
|
|
|||
| if &*self.canvas == canvas { | |||
| if self.canvas.as_ref().map(|c| &**c == canvas).unwrap_or(false) { | |||
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| self.context.Save() | ||
| } | ||
|
|
||
| #[allow(unrooted_must_root)] |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
asajeffrey
Jun 30, 2017
Author
Member
Removed. Serves me right cutting-and-pasting from CanvasRenderingContext2D.
| { | ||
| // TODO: document paint definitions. | ||
| self.invoke_a_paint_callback(name, size, sender); | ||
| } | ||
|
|
||
| /// https://drafts.css-houdini.org/css-paint-api/#invoke-a-paint-callback | ||
| #[allow(unrooted_must_root)] |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@bors-servo: r=jdm |
|
|
…text, r=jdm Implement paint worklets rendering context <!-- Please describe your changes on the following line: --> Implement the rendering context for paint worklets. They really paint things now! --- <!-- 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 do not require tests because the existing reftest now passes <!-- 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. --> <!-- 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/17326) <!-- Reviewable:end -->
|
|
e32817c
to
328fb25
|
Updated test expectations. @bors-servo r=jdm |
|
|
…text, r=jdm Implement paint worklets rendering context <!-- Please describe your changes on the following line: --> Implement the rendering context for paint worklets. They really paint things now! --- <!-- 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 do not require tests because the existing reftest now passes <!-- 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. --> <!-- 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/17326) <!-- Reviewable:end -->
|
|
…=jdm Implement paint worklet properties <!-- Please describe your changes on the following line: --> This is the final PR to get basic paint worklet support. It adds support for paint worklet properties (https://drafts.css-houdini.org/css-paint-api/#paint-definition-input-properties). When a paint worklet is registered, it specifies a list of CSS properties, and is provided with their computed values when it is invoked. This is a dependent PR: * "Implemented paint worklets invoking worklet scripts" is #17239. * "Implemented paint worklets rendering contexts" is #17326. There should be tests added for this, hopefully the existing wpt houdini tests. --- <!-- 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 #16839 - [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. --> <!-- 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/17364) <!-- Reviewable:end -->
…=jdm Implement paint worklet properties <!-- Please describe your changes on the following line: --> This is the final PR to get basic paint worklet support. It adds support for paint worklet properties (https://drafts.css-houdini.org/css-paint-api/#paint-definition-input-properties). When a paint worklet is registered, it specifies a list of CSS properties, and is provided with their computed values when it is invoked. This is a dependent PR: * "Implemented paint worklets invoking worklet scripts" is #17239. * "Implemented paint worklets rendering contexts" is #17326. There should be tests added for this, hopefully the existing wpt houdini tests. --- <!-- 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 #16839 - [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. --> <!-- 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/17364) <!-- Reviewable:end -->
Fixed scaling artefacts in paint worklets caused by zoom and hidpi <!-- Please describe your changes on the following line: --> This PR renders paint worklet canvases at the device pixel resolution, rather than the CSS pixel resolution. It's a dependent PR, building on #17239, #17326 and #17364. --- <!-- 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 #17454 - [X] These changes do not require tests because we don't run reftests with zoom enabled <!-- 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. --> <!-- 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/17499) <!-- Reviewable:end -->
Fixed scaling artefacts in paint worklets caused by zoom and hidpi <!-- Please describe your changes on the following line: --> This PR renders paint worklet canvases at the device pixel resolution, rather than the CSS pixel resolution. It's a dependent PR, building on #17239, #17326 and #17364. --- <!-- 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 #17454 - [X] These changes do not require tests because we don't run reftests with zoom enabled <!-- 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. --> <!-- 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/17499) <!-- Reviewable:end -->
asajeffrey commentedJun 14, 2017
•
edited by larsbergstrom
Implement the rendering context for paint worklets. They really paint things now!
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is