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

Don't delete webrender image keys immediately. #17606

Merged

Conversation

@asajeffrey
Copy link
Member

asajeffrey commented Jul 5, 2017

We currently delete webrender image id's immediately on resizing a canvas, which can cause panics. This PR delays deleting the image id until an epoch has passed.


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #17534
  • These changes do not require tests because the intermittent failure is already triggered by the css-paint-api tests.

This change is Reviewable

@asajeffrey
Copy link
Member Author

asajeffrey commented Jul 5, 2017

r? @glennw

@jdm
Copy link
Member

jdm commented Jul 10, 2017

@asajeffrey Could you do the same for the webgl thread as well? #13035 (comment) suggests that it is needed there too.

if let Some(image_key) = self.old_image_key.take() {
self.webrender_api.delete_image(image_key);
}
if let Some(image_key) = self.old_image_key.take() {

This comment has been minimized.

@MortimerGoro

MortimerGoro Jul 10, 2017

Contributor

shouldn't this be if let Some(image_key) = self.very_old_image_key.take()?

This comment has been minimized.

@asajeffrey

asajeffrey Jul 11, 2017

Author Member

Oops. Fixed.

@MortimerGoro
Copy link
Contributor

MortimerGoro commented Jul 10, 2017

@jdm I'm working on a major WebGL refactor. See servo/webrender#1353 and servo/webrender#607.

I'll submit a PR soon. It will be better to wait for that because WebGL thread and WR code are going to be changed (to use WR external image API)

@asajeffrey
Copy link
Member Author

asajeffrey commented Jul 11, 2017

OK, we can hold off if the WebGL refactor will land soon. This bug is causing some intermittents, so it would be nice to merge it.

@bors-servo
Copy link
Contributor

bors-servo commented Jul 13, 2017

The latest upstream changes (presumably #17694) made this pull request unmergeable. Please resolve the merge conflicts.

@asajeffrey asajeffrey force-pushed the asajeffrey:canvas-delay-deleting-image-keys branch from e039da7 to 953e8a0 Jul 17, 2017
@asajeffrey
Copy link
Member Author

asajeffrey commented Jul 17, 2017

@glennw @MortimerGoro I rebased against #17694, can this land now, or should we continue to hold off?

@MortimerGoro
Copy link
Contributor

MortimerGoro commented Jul 17, 2017

@asajeffrey yes, this can land now

@asajeffrey
Copy link
Member Author

asajeffrey commented Jul 17, 2017

@jdm, do the changes for WebGL look good to you?

@jdm
jdm approved these changes Jul 17, 2017
image_key: Option<webrender_api::ImageKey>,
// An old webrender image key that can be deleted when the next epoch ends.
old_image_key: Option<webrender_api::ImageKey>,
// An old webrender image key that can be deleted when the current epoch ends.

This comment has been minimized.

@jdm

jdm Jul 17, 2017

Member

Use /// on these.

This comment has been minimized.

@asajeffrey

asajeffrey Jul 17, 2017

Author Member

Done.

@asajeffrey asajeffrey force-pushed the asajeffrey:canvas-delay-deleting-image-keys branch from 8630251 to 3002c45 Jul 17, 2017
@asajeffrey
Copy link
Member Author

asajeffrey commented Jul 17, 2017

@bors-servo r=jdm

@bors-servo
Copy link
Contributor

bors-servo commented Jul 17, 2017

📌 Commit 3002c45 has been approved by jdm

@bors-servo
Copy link
Contributor

bors-servo commented Jul 17, 2017

Testing commit 3002c45 with merge 7f1278a...

bors-servo added a commit that referenced this pull request Jul 17, 2017
…=jdm

Don't delete webrender image keys immediately.

<!-- Please describe your changes on the following line: -->

We currently delete webrender image id's immediately on resizing a canvas, which can cause panics. This PR delays deleting the image id until an epoch has passed.

---
<!-- 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 #17534
- [X] These changes do not require tests because the intermittent failure is already triggered by the css-paint-api tests.

<!-- 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/17606)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Jul 17, 2017

@bors-servo bors-servo merged commit 3002c45 into servo:master Jul 17, 2017
3 checks passed
3 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
@bors-servo bors-servo mentioned this pull request Jul 17, 2017
4 of 4 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

7 participants
You can’t perform that action at this time.