Skip to content

Capture infrastructure: Part II - #2305

Merged
bors-servo merged 16 commits into
servo:masterfrom
kvark:capture2
Jan 16, 2018
Merged

bors-servo merged 16 commits into
servo:masterfrom
kvark:capture2

Conversation

@kvark

@kvark kvark commented Jan 15, 2018 •

Copy link
Copy Markdown
Member

Fixes #2238

The PR implements support for capturing all the built-frame stage environment:

  • built frames for each document
  • cached fonts, glyphs, images, and render targets
  • gpu cache

How to use:

  • run any example with "--features capture"
  • hit "c" to capture, the data is written into "captures/example"
  • run wrench with "load" command

TODO:

  • cleanup
  • rebase
  • reviews
  • proper external textures support (frame_output example)

This change is Reviewable

@glennw

glennw commented Jan 16, 2018

Copy link
Copy Markdown
Member

Reviewed 31 of 35 files at r1.
Review status: 31 of 35 files reviewed at latest revision, 1 unresolved discussion, some commit checks failed.


webrender/src/glyph_cache.rs, line 13 at r1 (raw file):

#[cfg_attr(feature = "capture", derive(Deserialize, Serialize))]
pub struct GenericCachedGlyphInfo<D> {

Maybe it will become clearer later in the review - but why does this need to be made generic?


Comments from Reviewable

@glennw

glennw commented Jan 16, 2018

Copy link
Copy Markdown
Member

Partial review only so far - will be working through the other files today.

@kvark

kvark commented Jan 16, 2018

Copy link
Copy Markdown
Member Author

Review status: 31 of 35 files reviewed at latest revision, 1 unresolved discussion, some commit checks failed.


webrender/src/glyph_cache.rs, line 13 at r1 (raw file):

Previously, glennw (Glenn Watson) wrote…

Maybe it will become clearer later in the review - but why does this need to be made generic?

The general approach is to have all the Arc<Vec<u8>> things replaced by String storing the relative path to a binary file (e.g. images/10.raw). In order to avoid code duplication, I made this struct generic over the data.


Comments from Reviewable

@glennw

glennw commented Jan 16, 2018

Copy link
Copy Markdown
Member

Reviewed 4 of 35 files at r1, 1 of 1 files at r2.
Review status: all files reviewed at latest revision, 2 unresolved discussions.


webrender/src/device.rs, line 132 at r2 (raw file):

#[derive(Clone, Copy, Debug, PartialEq)]
pub enum ReadPixelsFormat {

I wonder if we should remove this and just use ImageFormat?


Comments from Reviewable

@glennw
glennw self-requested a review January 16, 2018 05:20

@glennw glennw left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@kvark

kvark commented Jan 16, 2018

Copy link
Copy Markdown
Member Author

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


webrender/src/device.rs, line 132 at r2 (raw file):

Previously, glennw (Glenn Watson) wrote…

I wonder if we should remove this and just use ImageFormat?

I wish we could. Problem is - the ImageFormat doesn't have RGBA versus BGRA...


Comments from Reviewable

@kvark

kvark commented Jan 16, 2018

Copy link
Copy Markdown
Member Author

@glennw please take a look at the last commit dealing with external images. There is nothing particularly concerning there, but it's new code. frame_output example capturing works now 🎉 , and this should be ready to land.

@glennw

glennw commented Jan 16, 2018

Copy link
Copy Markdown
Member

The last commit looks good to me. You could perhaps expand on the TODO? comments with some more details, but otherwise looks fine.

@kvark

kvark commented Jan 16, 2018

Copy link
Copy Markdown
Member Author

Thanks @glennw ! This is done now.
@bors-servo r=glennw

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit aeb2c60 has been approved by glennw

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit aeb2c60 with merge 1eb0032...

bors-servo pushed a commit that referenced this pull request Jan 16, 2018
Capture infrastructure: Part II

Fixes #2238

The PR implements support for capturing all the built-frame stage environment:
  - built frames for each document
  - cached fonts, glyphs, images, and render targets
  - gpu cache

How to use:
  - run any example with "--features capture"
  - hit "c" to capture, the data is written into "captures/example"
  - run wrench with "load" command

TODO:
- [x] cleanup
- [x] rebase
- [x] reviews
- [x] proper external textures support (`frame_output` example)

<!-- 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/2305)
<!-- Reviewable:end -->
@kvark

kvark commented Jan 16, 2018

Copy link
Copy Markdown
Member Author

@bors-servo r-
Didn't realize read_pixels_into is used by Gecko. Need to re-expose it.

@kvark

kvark commented Jan 16, 2018

Copy link
Copy Markdown
Member Author

Should be good now. read_pixels_into is back to original form.
@bors-servo r=glennw

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit 712e62f has been approved by glennw

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 712e62f with merge 39abbda...

bors-servo pushed a commit that referenced this pull request Jan 16, 2018
Capture infrastructure: Part II

Fixes #2238

The PR implements support for capturing all the built-frame stage environment:
  - built frames for each document
  - cached fonts, glyphs, images, and render targets
  - gpu cache

How to use:
  - run any example with "--features capture"
  - hit "c" to capture, the data is written into "captures/example"
  - run wrench with "load" command

TODO:
- [x] cleanup
- [x] rebase
- [x] reviews
- [x] proper external textures support (`frame_output` example)

<!-- 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/2305)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

☀️ Test successful - status-appveyor, status-taskcluster
Approved by: glennw
Pushing 39abbda to master...

@bors-servo
bors-servo merged commit 712e62f into servo:master Jan 16, 2018
@kvark
kvark deleted the capture2 branch January 17, 2018 01:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants