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

Embed the PicturePrimitive inside BrushPrimitive. #2961

Merged
merged 1 commit into from Aug 10, 2018

Conversation

@gw3583
Copy link
Collaborator

gw3583 commented Aug 9, 2018

This change is Reviewable

@gw3583
Copy link
Collaborator Author

gw3583 commented Aug 9, 2018

Never fear, this commit is actually quite small! It just looks big as it includes the commit from #2951.

Pending try:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=fcc6a6b6c3f24f09d5e135399c8aeb169b7725e1

r? @kvark or anyone (just the last commit - the first commit is being reviewed separately).

frame_output_pipeline_id,
apply_local_clip_rect,
);
pub fn get_pic(&self, index: PrimitiveIndex) -> &PicturePrimitive {

This comment has been minimized.

@kvark

kvark Aug 9, 2018

Member

This looks like a regression in our internal APIs. Where we had separate type for picture index, we were able to associate it with a picture, now we pass more PrimitiveIndex around. I don't see a way around it if you want to move the picture under primitive metadata, but just pointing out at the issue.

This comment has been minimized.

@gw3583

gw3583 Aug 9, 2018

Author Collaborator

I agree - this is an internal regression. However, I think it should be temporary only - I'd like to embed more of the prim store types directly into the runs struct in the Picture (see rationale above) which should then remove (most of?) the indexing that occurs here, if all goes according to plan.

let brush = &self.cpu_brushes[metadata.cpu_prim_index.0];
match brush.kind {
BrushKind::Picture(ref pic) => pic,
_ => unreachable!("bug: not a picture!"),

This comment has been minimized.

@kvark

kvark Aug 9, 2018

Member

nit: I think if there is any doubt that this is reachable, then panic! is more appropriate :)

This comment has been minimized.

@gw3583

gw3583 Aug 9, 2018

Author Collaborator

Done

@gw3583 gw3583 force-pushed the gw3583:embed-pic-3 branch from e93ae37 to d1faa60 Aug 9, 2018
@gw3583
Copy link
Collaborator Author

gw3583 commented Aug 9, 2018

Fixed nit and rebased on top of the review comments for #2951. I'll rebase again once that is merged.

@kvark
kvark approved these changes Aug 9, 2018
Remove the cpu_pictures array and store the PicturePrimitive
directly inside the BrushPrimitive.

The rationale here is to move the prim store arrays to be stored
and owned by each PicturePrimitive. This is an interim step
towards that - it's a bit messy in places due to borrow check
issues, but should be a lot tidier once complete.

The benefit of doing this is that as we start to cache Pictures
more aggressively, we can retain the PicturePrimitive struct
from a previous frame, and easily compare the embedded primitive
runs to see if we have a cache hit.

This will make it possible to cache Picture primitives between
*display lists* rather than just scroll frames where appropriate,
by doing a deep compare on the primitive runs in a picture.
@gw3583 gw3583 force-pushed the gw3583:embed-pic-3 branch from d1faa60 to 6edce0c Aug 10, 2018
@gw3583
Copy link
Collaborator Author

gw3583 commented Aug 10, 2018

I did a fresh try run after rebasing, that looks green apart from unrelated intermittents:

https://treeherder.mozilla.org/#/jobs?repo=try&revision=8d62530193f44ce1f131d85ce5791f66d6f9abec

@bors-servo r=kvark

@bors-servo
Copy link
Contributor

bors-servo commented Aug 10, 2018

📌 Commit 6edce0c has been approved by kvark

@bors-servo
Copy link
Contributor

bors-servo commented Aug 10, 2018

Testing commit 6edce0c with merge c681185...

bors-servo added a commit that referenced this pull request Aug 10, 2018
Embed the PicturePrimitive inside BrushPrimitive.

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

bors-servo commented Aug 10, 2018

☀️ Test successful - status-appveyor, status-taskcluster
Approved by: kvark
Pushing c681185 to master...

@bors-servo bors-servo merged commit 6edce0c into servo:master Aug 10, 2018
3 checks passed
3 checks passed
Taskcluster (pull_request) TaskGroup: success
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.

None yet

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