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

Implement raqote backend for canvas 2D rendering #24048

Merged
merged 6 commits into from Sep 2, 2019
Merged

Conversation

@pylbrecht
Copy link
Contributor

pylbrecht commented Aug 25, 2019

This is a follow-up of #23936.


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #23431

This change is Reviewable

Copy link

jrmuizel left a comment

Reviewable status: 0 of 1 files reviewed, 2 unresolved discussions (waiting on @asajeffrey, @CYBAI, and @pylbrecht)


components/canvas/raqote_backend.rs, line 190 at r3 (raw file):

        self.as_raqote().ops.iter().any(|op| match op {
            PathOp::MoveTo(point) | PathOp::LineTo(point) => {
                point.x as f64 == x && point.y as f64 == y

This contains_point() implementation is wrong. contains_point() is supposed to return whether the point is inside the path and not whether any of the path ops use that particular point.

Copy link

jrmuizel left a comment

Reviewable status: 0 of 1 files reviewed, 2 unresolved discussions (waiting on @asajeffrey, @CYBAI, and @pylbrecht)


components/canvas/raqote_backend.rs, line 190 at r3 (raw file):

Previously, jrmuizel (Jeff Muizelaar) wrote…

This contains_point() implementation is wrong. contains_point() is supposed to return whether the point is inside the path and not whether any of the path ops use that particular point.

I'll add an implementation of contains_point() to raqote.

components/canvas/raqote_backend.rs Outdated Show resolved Hide resolved
@jrmuizel
Copy link

jrmuizel commented Aug 27, 2019

Raqote now has a (possibly buggy) implementation of contains_point() jrmuizel/raqote@b1437ce

@jdm jdm assigned jdm and unassigned asajeffrey Aug 27, 2019
@pylbrecht
Copy link
Contributor Author

pylbrecht commented Aug 27, 2019

This contains_point() implementation is wrong. contains_point() is supposed to return whether the point is inside the path and not whether any of the path ops use that particular point.

Thanks for pointing that out, @jrmuizel! I have zero experience in implementing 2D graphics whatsoever. I hope this doesn't get in the way too much, while working on this issue. I really don't want to create more work than neccessary.
May I hit you up, if I have any questions regarding 2D graphics?

@jrmuizel
Copy link

jrmuizel commented Aug 27, 2019

May I hit you up, if I have any questions regarding 2D graphics?

Sure. I'd be happy to answer any questions.

Copy link

jrmuizel left a comment

Looks reasonable to me.

unimplemented!()
pub fn contains_point(&self, x: f64, y: f64, _path_transform: &Transform2D<f32>) -> bool {
let path = self.as_raqote();
path.contains_point(0.1, path.winding, x as f32, y as f32)

This comment has been minimized.

@jrmuizel

jrmuizel Sep 1, 2019

The newest version of raqote drops the winding parameter from contains_point() (though you can just deal with that later)

@jdm
Copy link
Member

jdm commented Sep 2, 2019

@bors-servo r=jrmuizel

@bors-servo
Copy link
Contributor

bors-servo commented Sep 2, 2019

📌 Commit d245682 has been approved by jrmuizel

@highfive highfive assigned jrmuizel and unassigned jdm Sep 2, 2019
@bors-servo
Copy link
Contributor

bors-servo commented Sep 2, 2019

Testing commit d245682 with merge b871578...

bors-servo added a commit that referenced this pull request Sep 2, 2019
Implement raqote backend for canvas 2D rendering

<!-- Please describe your changes on the following line: -->
This is a follow-up of #23936.

---
<!-- 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
- [ ] These changes fix #23431

<!-- Either: -->

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

bors-servo commented Sep 2, 2019

💔 Test failed - status-taskcluster

@jdm
Copy link
Member

jdm commented Sep 2, 2019

@bors-servo retry

@bors-servo
Copy link
Contributor

bors-servo commented Sep 2, 2019

💣 Failed to start rebuilding: Unknown error

@bors-servo
Copy link
Contributor

bors-servo commented Sep 2, 2019

Testing commit d245682 with merge fdc206e...

bors-servo added a commit that referenced this pull request Sep 2, 2019
Implement raqote backend for canvas 2D rendering

<!-- Please describe your changes on the following line: -->
This is a follow-up of #23936.

---
<!-- 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
- [ ] These changes fix #23431

<!-- Either: -->

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

bors-servo commented Sep 2, 2019

💔 Test failed - status-taskcluster

@CYBAI
Copy link
Collaborator

CYBAI commented Sep 2, 2019

@bors-servo retry

@bors-servo
Copy link
Contributor

bors-servo commented Sep 2, 2019

💣 Failed to start rebuilding: Unknown error

@bors-servo
Copy link
Contributor

bors-servo commented Sep 2, 2019

Testing commit d245682 with merge 18f59fc...

bors-servo added a commit that referenced this pull request Sep 2, 2019
Implement raqote backend for canvas 2D rendering

<!-- Please describe your changes on the following line: -->
This is a follow-up of #23936.

---
<!-- 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
- [ ] These changes fix #23431

<!-- Either: -->

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

bors-servo commented Sep 2, 2019

☀️ Test successful - linux-rel-css, linux-rel-wpt, status-taskcluster
Approved by: jrmuizel
Pushing 18f59fc to master...

@bors-servo bors-servo merged commit d245682 into servo:master Sep 2, 2019
2 of 3 checks passed
2 of 3 checks passed
Taskcluster (pull_request) TaskGroup: failure
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
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.

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