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
Move primitive origin from template data to the instance. #3386
Conversation
Pushed a follow up commit that normalizes the local clip rect. For some reason I can't push a try run at the moment, but I'll paste one here once I can. |
Hmmm, that second try run is very broken - investigating. |
Fixed up the last commit, and kicked off a new try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=08c72f439b92112bec5d68ce06598d06869836a3 |
That try run looks much better 👍 |
This allows sharing of primitive templates where the only difference between two primitives is the local space position. This also means that interning works as expected for primitives sent by Gecko that contain baked in scroll offsets. This patch changes the primitive rect only - the next step is a follow up patch that makes the clip rect, and a few other params in PrimitiveTemplateKind to also be in a true local space. Also normalize the clip rect to the primitive origin.
Re-implemented on top of the separate interning PR, since the rebase had too many conflicts. Kicked off a new pending try: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One concern
Reviewed 6 of 6 files at r1.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @gw3583)
webrender/src/display_list_flattener.rs, line 1048 at r1 (raw file):
DocumentResources: InternerMut<P>, { let normalized_clip_rect = info.clip_rect
the "normalized" part is a bit confusing to me for having a different meaning in vector math
can we call it relative_clip_rect
?
We might need to go as far as creating a separate space for that
webrender/src/display_list_flattener.rs, line 1049 at r1 (raw file):
{ let normalized_clip_rect = info.clip_rect .translate(&LayoutVector2D::new(-info.rect.origin.x, -info.rect.origin.y))
nit: can we use to_vector()
?
webrender/src/picture.rs, line 626 at r1 (raw file):
let clip_rect = prim_data .normalized_clip_rect .translate(&LayoutVector2D::new(prim_instance.prim_origin.x, prim_instance.prim_origin.y));
nit: can we use prim_instance.prim_origin.to_vector()
?
webrender/src/picture.rs, line 1345 at r1 (raw file):
let clip_rect = prim_data .normalized_clip_rect .translate(&LayoutVector2D::new(prim_instance.prim_origin.x, prim_instance.prim_origin.y));
same here
@kvark Thanks, addressed those comments. And I agree, I think introducing a primitive local space in the future probably makes sense. 👍 |
Try looks good. @bors-servo r=kvark |
@bors-servo r=kvark |
@bors-servo ping |
😪 I'm awake I'm awake |
@bors-servo r=kvark |
📌 Commit aaeb3d8 has been approved by |
Move primitive origin from template data to the instance. This allows sharing of primitive templates where the only difference between two primitives is the local space position. This also means that interning works as expected for primitives sent by Gecko that contain baked in scroll offsets. This patch changes the primitive rect only - the next step is a follow up patch that makes the clip rect, and a few other params in PrimitiveTemplateKind to also be in a true local space. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/webrender/3386) <!-- Reviewable:end -->
This looks like another 2-3% win on dl_mutate from the try run. |
☀️ Test successful - status-appveyor, status-taskcluster |
…8e9867e7f8ea (WR PR #3386). r=kats servo/webrender#3386 Differential Revision: https://phabricator.services.mozilla.com/D13954 --HG-- extra : moz-landing-system : lando
…8e9867e7f8ea (WR PR #3386). r=kats servo/webrender#3386 Differential Revision: https://phabricator.services.mozilla.com/D13954
…8e9867e7f8ea (WR PR #3386). r=kats servo/webrender#3386 Differential Revision: https://phabricator.services.mozilla.com/D13954 UltraBlame original commit: 9d91003755a6fae6fb121b1ea115621f4911ae09
…8e9867e7f8ea (WR PR #3386). r=kats servo/webrender#3386 Differential Revision: https://phabricator.services.mozilla.com/D13954 UltraBlame original commit: 9d91003755a6fae6fb121b1ea115621f4911ae09
…8e9867e7f8ea (WR PR #3386). r=kats servo/webrender#3386 Differential Revision: https://phabricator.services.mozilla.com/D13954 UltraBlame original commit: 9d91003755a6fae6fb121b1ea115621f4911ae09
This allows sharing of primitive templates where the only difference
between two primitives is the local space position.
This also means that interning works as expected for primitives
sent by Gecko that contain baked in scroll offsets.
This patch changes the primitive rect only - the next step is a
follow up patch that makes the clip rect, and a few other params
in PrimitiveTemplateKind to also be in a true local space.
This change is