Skip to content

canvas2d: Implement .reset() - #31258

Merged
mrobinson merged 3 commits into
servo:mainfrom
syvb:canvas-reset
Feb 5, 2024
Merged

canvas2d: Implement .reset()#31258
mrobinson merged 3 commits into
servo:mainfrom
syvb:canvas-reset

Conversation

@syvb

@syvb syvb commented Feb 5, 2024

Copy link
Copy Markdown
Contributor

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)

@mrobinson mrobinson left a comment

Copy link
Copy Markdown
Member

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.

Comment thread components/script/dom/canvasrenderingcontext2d.rs Outdated
Comment thread components/script/dom/offscreencanvasrenderingcontext2d.rs Outdated
Comment thread components/script/dom/paintrenderingcontext2d.rs Outdated
@mrobinson mrobinson changed the title Implement .reset() on Canvas2D canvas2d: Implement .reset() Feb 5, 2024
@mrobinson
mrobinson enabled auto-merge February 5, 2024 08:22
@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
@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.

2 participants