Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

canvas2d: Implement .reset() #31258

Merged
merged 3 commits into from Feb 5, 2024
Merged

canvas2d: Implement .reset() #31258

merged 3 commits into from Feb 5, 2024

Conversation

syvb
Copy link
Contributor

@syvb syvb commented Feb 5, 2024

Implements .reset() for CanvasRenderingContext2D, which resets the rendering context to its default state. There is already logic for resetting the rendering context for when the width/height is changed, so the implementation is similar.


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • There are tests for these changes (already in WPT)

Copy link
Member

@mrobinson mrobinson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What a great change! I just have a few comments about the rustdoc. Note that most of the pre-existing comments of this form should be converted as well.

components/script/dom/canvasrenderingcontext2d.rs Outdated Show resolved Hide resolved
components/script/dom/offscreencanvasrenderingcontext2d.rs Outdated Show resolved Hide resolved
components/script/dom/paintrenderingcontext2d.rs Outdated Show resolved Hide resolved
@mrobinson mrobinson changed the title Implement .reset() on Canvas2D canvas2d: Implement .reset() Feb 5, 2024
@mrobinson mrobinson added this pull request to the merge queue Feb 5, 2024
Merged via the queue into servo:main with commit b2ae392 Feb 5, 2024
11 checks passed
@syvb syvb deleted the canvas-reset branch February 6, 2024 03:01
Taym95 pushed a commit to Taym95/servo that referenced this pull request Feb 11, 2024
* Implement Canvas2D reset

* Update WPT tests

* Apply suggestions from code review

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants