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 upAdd framebuffer check for mark_as_dirty, #21691 #21785
Conversation
highfive
commented
Sep 21, 2018
|
Thanks for the pull request, and welcome! The Servo team is excited to review your changes, and you should hear from @nox (or someone else) soon. |
highfive
commented
Sep 21, 2018
|
Heads up! This PR modifies the following files:
|
highfive
commented
Sep 21, 2018
| .dirty(NodeDamage::OtherNodeDamage); | ||
| // If we don't have a bound framebuffer, then don't mark the canvas | ||
| // as dirty. | ||
| match self.bound_framebuffer.get() { |
This comment has been minimized.
This comment has been minimized.
jdm
Sep 22, 2018
Member
We want to invest this; only mark as dirty when there is no bound framebuffer. We can use is_none() instead of matching for this.
| .upcast::<Node>() | ||
| .dirty(NodeDamage::OtherNodeDamage), | ||
| None => () | ||
| if !self.bound_framebuffer.get().is_none() { |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
sumit0190
Sep 22, 2018
Author
Contributor
Hmm...I got confused between your original comment (and the spec) and your later comment:
"For Servo, that means that the canvas object should not be marked dirty if there is no bound framebuffer."
AND
"only mark as dirty when there is no bound framebuffer"
So is_none() returns false if the framebuffer is bound, and the ! negates it to true and marks the canvas object as dirty.
This comment has been minimized.
This comment has been minimized.
KiChjang
Sep 22, 2018
Member
It may be better here to use is_none() or is_some(), instead of inverting the conditional using !.
This is the part that is correct in @jdm's issue, the condition should be using |
|
I apologize; my original issue text was not clear. By default, the default framebuffer is bound. When the |
|
This just requires the commits to be squashed now. :) |
|
@bors-servo r+ |
|
|
Add framebuffer check for mark_as_dirty, #21691 <!-- Please describe your changes on the following line: --> Check `bound_framebuffer` in each `mark_as_dirty` call, so that we don't dirty the canvas if we don't have a bound framebuffer. --- <!-- 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 #21691 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [X] These changes do not require tests because there isn't a direct way to test it (yet). <!-- 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/21785) <!-- Reviewable:end -->
|
|
sumit0190 commentedSep 21, 2018
•
edited by SimonSapin
Check
bound_framebufferin eachmark_as_dirtycall, so that we don't dirty the canvas if we don't have a bound framebuffer../mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is