diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2017-07-11 06:40:33 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-11 06:40:33 -0700 |
commit | bc1ac6e64cd9735d87e4057f4bbe61023ffc22f5 (patch) | |
tree | 1990160bd1794d6ff3da830e9b5ce7f3af35bf27 /components/canvas/canvas_paint_thread.rs | |
parent | ee95bda3bff01d4ca0e1987a0355d01238d60cf6 (diff) | |
parent | 0b7a43da6b367ec3b03dbbd1fd8d7b3089a99b94 (diff) | |
download | servo-bc1ac6e64cd9735d87e4057f4bbe61023ffc22f5.tar.gz servo-bc1ac6e64cd9735d87e4057f4bbe61023ffc22f5.zip |
Auto merge of #17609 - asajeffrey:canvas-clear-state, r=jdm
Clear canvas thread state on recreation.
<!-- Please describe your changes on the following line: -->
The canvas rendering context is cleared when it is recreated, but not the matching state in the canvas paint thread.
---
<!-- 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 #17533
- [X] These changes do not require tests because the css-paint-api tests test for this already.
<!-- 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/17609)
<!-- Reviewable:end -->
Diffstat (limited to 'components/canvas/canvas_paint_thread.rs')
-rw-r--r-- | components/canvas/canvas_paint_thread.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/components/canvas/canvas_paint_thread.rs b/components/canvas/canvas_paint_thread.rs index 68cb96cd685..344e7d18430 100644 --- a/components/canvas/canvas_paint_thread.rs +++ b/components/canvas/canvas_paint_thread.rs @@ -544,6 +544,8 @@ impl<'a> CanvasPaintThread<'a> { fn recreate(&mut self, size: Size2D<i32>) { self.drawtarget = CanvasPaintThread::create(size); + self.state = CanvasPaintState::new(self.state.draw_options.antialias == AntialiasMode::Default); + self.saved_states.clear(); // Webrender doesn't let images change size, so we clear the webrender image key. if let Some(image_key) = self.image_key.take() { self.webrender_api.delete_image(image_key); |