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

Add framebuffer check for mark_as_dirty, #21691 #21785

Merged
merged 1 commit into from Oct 9, 2018

Conversation

@sumit0190
Copy link
Contributor

sumit0190 commented Sep 21, 2018

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.


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #21691 (github issue number if applicable).
  • There are tests for these changes OR
  • These changes do not require tests because there isn't a direct way to test it (yet).

This change is Reviewable

@highfive
Copy link

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
Copy link

highfive commented Sep 21, 2018

Heads up! This PR modifies the following files:

  • @asajeffrey: components/script/dom/webglrenderingcontext.rs
  • @KiChjang: components/script/dom/webglrenderingcontext.rs
@highfive
Copy link

highfive commented Sep 21, 2018

warning Warning warning

  • These commits modify script code, but no tests are modified. Please consider adding a test!
.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.

Copy link
@jdm

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.

Copy link
@jdm

jdm Sep 22, 2018

Member

This is still checking for the opposite condition.

This comment has been minimized.

Copy link
@sumit0190

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.

Copy link
@KiChjang

KiChjang Sep 22, 2018

Member

It may be better here to use is_none() or is_some(), instead of inverting the conditional using !.

@nox
Copy link
Member

nox commented Sep 23, 2018

Per a later paragraph in https://www.khronos.org/registry/webgl/specs/latest/1.0/#2.2, we should only be presenting the webgl canvas when the default framebuffer is bound.

This is the part that is correct in @jdm's issue, the condition should be using is_none like it did initially, but without !.

@jdm
Copy link
Member

jdm commented Sep 23, 2018

I apologize; my original issue text was not clear. By default, the default framebuffer is bound. When the bound_framebuffer is set to a non-null value, that means that the default framebuffer is no longer bound, because some other framebuffer is bound instead.

@nox
Copy link
Member

nox commented Sep 24, 2018

This just requires the commits to be squashed now. :)

@sumit0190 sumit0190 force-pushed the sumit0190:new_markasdirty branch from 85156eb to 8148b1b Sep 24, 2018
@jdm
Copy link
Member

jdm commented Oct 9, 2018

@bors-servo
Copy link
Contributor

bors-servo commented Oct 9, 2018

📌 Commit 8148b1b has been approved by jdm

@highfive highfive assigned jdm and unassigned nox Oct 9, 2018
@bors-servo
Copy link
Contributor

bors-servo commented Oct 9, 2018

Testing commit 8148b1b with merge 552af00...

bors-servo added a commit that referenced this pull request Oct 9, 2018
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 -->
@bors-servo
Copy link
Contributor

bors-servo commented Oct 9, 2018

@bors-servo bors-servo merged commit 8148b1b into servo:master Oct 9, 2018
2 of 3 checks passed
2 of 3 checks passed
continuous-integration/appveyor/pr AppVeyor build failed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
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.

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