Commit e5f9f5f
Increase frame capture quality, apply scaling after DPI normalization (#55731)
Summary:
Pull Request resolved: #55731
Updates Android screenshot capture for performance frame timings to improve image quality:
- Fix scale factor calculation by first normalizing output size based on display density.
- Increase (in most cases) output image size and encoding quality.
**Impact**
- Output images are now net larger (depending on DPI), and have significantly more clarity.
- Each captured frame now uses **~9x more space** (vs a worst case device scaling starting point).
NOTE: These changes come with a memory tradeoff, and we may explore multi-frame sampling and a bounded buffer in future. Not a major bottleneck, even with this size increase (the bottleneck remains in expanding JS Sampling Profiler events).
Changelog: [Internal]
Reviewed By: rubennorte
Differential Revision: D94256691
fbshipit-source-id: 91f3610f5a5ac10a9806c07c21c38b30599b93de1 parent f56b295 commit e5f9f5f
1 file changed
Lines changed: 15 additions & 13 deletions
File tree
- packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/inspector
Lines changed: 15 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
135 | 132 | | |
136 | 133 | | |
137 | 134 | | |
| |||
141 | 138 | | |
142 | 139 | | |
143 | 140 | | |
144 | | - | |
145 | | - | |
146 | | - | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
147 | 144 | | |
148 | 145 | | |
149 | 146 | | |
150 | 147 | | |
151 | 148 | | |
152 | | - | |
| 149 | + | |
153 | 150 | | |
154 | 151 | | |
155 | 152 | | |
156 | | - | |
| 153 | + | |
157 | 154 | | |
158 | 155 | | |
159 | 156 | | |
| |||
171 | 168 | | |
172 | 169 | | |
173 | 170 | | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
174 | 176 | | |
0 commit comments