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

Draft. Change PaintContext rects to TypedRects #7023 #7696

Merged
merged 1 commit into from Nov 6, 2015

Conversation

@mskrzypkows
Copy link

mskrzypkows commented Sep 21, 2015

I created draft. I'm not sure if we need any units conversion in PaintContext. There is also strange 'clear' method, we use PagePx origin and ScreenPx size is it OK?

Review on Reviewable

@jdm
Copy link
Member

jdm commented Sep 21, 2015

@bors-servo
Copy link
Contributor

bors-servo commented Sep 28, 2015

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

@mbrubeck
Copy link
Contributor

mbrubeck commented Sep 28, 2015

Thanks for the patch! Here are a few comments...

-S-awaiting-review +S-needs-code-changes


Reviewed 3 of 3 files at r1.
Review status: all files reviewed at latest revision, 3 unresolved discussions, some commit checks failed.


components/gfx/display_list/mod.rs, line 486 [r1] (raw file):
This could be let tile_size = paint_context.screen_rect.as_f32().to_untyped();


components/gfx/paint_context.rs, line 95 [r1] (raw file):
This should return a ScaleFactor<PagePx, ScreenPx>. This could also benefit from servo/euclid#105 (requires updating the version of euclid used by Servo).


components/gfx/paint_context.rs, line 244 [r1] (raw file):
Should page_rect be screen_rect here?

Also, I'm surprised that we are combining these different coordinates like this without scaling them. This may be a bug in the existing code.


Comments from the review on Reviewable.io

@mskrzypkows
Copy link
Author

mskrzypkows commented Sep 30, 2015

Review status: all files reviewed at latest revision, 2 unresolved discussions, some commit checks failed.


components/gfx/paint_context.rs, line 95 [r1] (raw file):
As I see newest version (0.2) is already used. Will there be update to other?
If I change screen_pixels_per_px to return ScaleFactor then I have to change implementation of to_nearest_pixel in geometry.rs, to use ScaleFactor, right?


components/gfx/paint_context.rs, line 244 [r1] (raw file):
I'll change to screen_rect


Comments from the review on Reviewable.io

@mbrubeck
Copy link
Contributor

mbrubeck commented Sep 30, 2015

Review status: all files reviewed at latest revision, 2 unresolved discussions, some commit checks failed.


components/gfx/paint_context.rs, line 95 [r1] (raw file):
I have now published euclid 0.2.1.

Yes, if you change this then the to_nearest_pixel should change to take ScaleFactor. Feel free to leave this for a separate PR if you'd like.


Comments from the review on Reviewable.io

@mbrubeck
Copy link
Contributor

mbrubeck commented Oct 7, 2015

Oops, I didn't notice that my earlier attempt to publish euclid 0.2.1 failed. Now it has been published successfully, and you can run ./mach cargo-update -p euclid to update it in all of our Cargo.lock files.

@mskrzypkows
Copy link
Author

mskrzypkows commented Oct 8, 2015

OK, thanks :-)

@mskrzypkows mskrzypkows force-pushed the mskrzypkows:PaintContext_Units branch from 55a3c0c to 82623dc Oct 28, 2015
@bors-servo
Copy link
Contributor

bors-servo commented Oct 28, 2015

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

@jdm
Copy link
Member

jdm commented Oct 28, 2015

Oops, this was rebased but also had build errors according to the travis log:

/home/travis/build/servo/servo/components/gfx/paint_context.rs:1647:46: 1647:59 error: mismatched types:

 expected `f32`,

    found `euclid::scale_factor::ScaleFactor<util::geometry::PagePx, util::geometry::ScreenPx, f32>`

(expected f32,

    found struct `euclid::scale_factor::ScaleFactor`) [E0308]

/home/travis/build/servo/servo/components/gfx/paint_context.rs:1647         Point2D::new(self.x.to_nearest_pixel(pixels_per_px) as AzFloat,

                                                                                                                 ^~~~~~~~~~~~~
@mskrzypkows
Copy link
Author

mskrzypkows commented Oct 29, 2015

Yes, I know that there are build errors, it's because my changes need update in app_unit module, to_nearest_pixel method should take ScaleFactor<PagePx, ScreenPx, f32> as argument. I don't know how to modify app_unit, because PagePx and ScreenPx are defined in util::geometry module which is not available from app_unit. How can I use PagePx and ScreenPx from app_unit?

@jdm
Copy link
Member

jdm commented Oct 29, 2015

It sounds like perhaps we should define PagePx and ScreenPx in app_unit instead.

@mbrubeck
Copy link
Contributor

mbrubeck commented Oct 29, 2015

If you'd like to land the work you've done so far, you could split the changes that depend on app_unit into a separate commit to be merged later.

@mskrzypkows
Copy link
Author

mskrzypkows commented Oct 30, 2015

OK, I'll push another version.

@mskrzypkows mskrzypkows force-pushed the mskrzypkows:PaintContext_Units branch from 82623dc to bd61308 Oct 30, 2015
@jdm jdm removed the S-needs-rebase label Oct 30, 2015
@bors-servo
Copy link
Contributor

bors-servo commented Nov 4, 2015

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

Needs update to_nearest_pixel method in app_unit module.
Argument of to_nearest_pixel should be:
ScaleFactor<PagePx, ScreenPx, f32>
@mskrzypkows mskrzypkows force-pushed the mskrzypkows:PaintContext_Units branch from bd61308 to 2a7927d Nov 4, 2015
@mskrzypkows
Copy link
Author

mskrzypkows commented Nov 6, 2015

Rebased, @mbrubeck what do you think? Could you do a review?

@jdm jdm removed the S-needs-rebase label Nov 6, 2015
@mbrubeck
Copy link
Contributor

mbrubeck commented Nov 6, 2015

Reviewed 3 of 3 files at r2, 2 of 2 files at r3.
Review status: all files reviewed at latest revision, 1 unresolved discussion.


Comments from the review on Reviewable.io

@mbrubeck
Copy link
Contributor

mbrubeck commented Nov 6, 2015

@bors-servo r+

Thanks!

@bors-servo
Copy link
Contributor

bors-servo commented Nov 6, 2015

📌 Commit 2a7927d has been approved by mbrubeck

@bors-servo
Copy link
Contributor

bors-servo commented Nov 6, 2015

Testing commit 2a7927d with merge 96a9653...

bors-servo added a commit that referenced this pull request Nov 6, 2015
Draft. Change PaintContext rects to TypedRects #7023

I created draft. I'm not sure if we need any units conversion in PaintContext. There is also strange 'clear' method, we use PagePx origin and ScreenPx size is it OK?

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7696)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Nov 6, 2015

💔 Test failed - mac-rel-wpt

@mbrubeck
Copy link
Contributor

mbrubeck commented Nov 6, 2015

@bors-servo
Copy link
Contributor

bors-servo commented Nov 6, 2015

Testing commit 2a7927d with merge 8d8ffa8...

bors-servo added a commit that referenced this pull request Nov 6, 2015
Draft. Change PaintContext rects to TypedRects #7023

I created draft. I'm not sure if we need any units conversion in PaintContext. There is also strange 'clear' method, we use PagePx origin and ScreenPx size is it OK?

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7696)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Nov 6, 2015

@bors-servo bors-servo merged commit 2a7927d into servo:master Nov 6, 2015
2 of 3 checks passed
2 of 3 checks passed
code-review/reviewable Review in progress: all files reviewed, 1 unresolved discussion
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.

None yet

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