diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2018-03-16 13:49:17 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-16 13:49:17 -0400 |
commit | 1ae5715309ab5acb9ac401fd99f34a0667b2ee53 (patch) | |
tree | 01977d5f5bc7a8af92323ecc4a07efc9d122f0c5 /components/servo/lib.rs | |
parent | f5c1f5117e4de30a02d2614c23a52fc863231d51 (diff) | |
parent | ee637dc26ee98f297cf5913f744e2f4824a6fa8b (diff) | |
download | servo-1ae5715309ab5acb9ac401fd99f34a0667b2ee53.tar.gz servo-1ae5715309ab5acb9ac401fd99f34a0667b2ee53.zip |
Auto merge of #20315 - kwonoj:feat-webrender-capture, r=jdm
feat(window): bind hotkey to trigger capture event
<!-- Please describe your changes on the following line: -->
Relates to #20295.
This PR intends to expose additional hotkey to window to allow capture webrender. Internally it adds one new `WindowEvent::CaptureWebRender` for those purpose. I took some liberty to make some decisions around which need to be reviewed & updated in PR.
- `Ctrl-shift-3` is binded to hotkey to follow described in Gecko's behavior. Is it good to go?
- Maybe do not need to create new event `CaptureWebRender` but reuse `ToggleWebRenderDebug`, having additional `WebRenderDebugOption` values?
: This sounds more right path for me, but `capture` isn't really `toggle` behavior to include capture into it.
- Capturing will create `capture_webrender` in cwd, creates new folder inside each time new capture stored
: Maybe it'd better to expose new cmdline args allow overrides, or some better way else. I took the simple approach to generate path without asking for it.
---
<!-- 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
- [x] These changes fix #20295 (github issue number if applicable).
<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____
- This change has manually verified on local machines (mac, windows, linux).
<!-- 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/20315)
<!-- Reviewable:end -->
Diffstat (limited to 'components/servo/lib.rs')
-rw-r--r-- | components/servo/lib.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/components/servo/lib.rs b/components/servo/lib.rs index 45b6af50c89..f5ebed9f04d 100644 --- a/components/servo/lib.rs +++ b/components/servo/lib.rs @@ -333,6 +333,10 @@ impl<Window> Servo<Window> where Window: WindowMethods + 'static { self.compositor.toggle_webrender_debug(option); } + WindowEvent::CaptureWebRender => { + self.compositor.capture_webrender(); + } + WindowEvent::NewBrowser(url, response_chan) => { let msg = ConstellationMsg::NewBrowser(url, response_chan); if let Err(e) = self.constellation_chan.send(msg) { |