Android's `View` has multiple constructors. Currently only `ServoView(Context, AttributeSet)` is available.
This constructor is usually used by Android when inflating a View from a layout XML file. However when
creating the `View` in code no `AttributeSet` is available.
Make JNI code more robust and introduce antialiasing option
This throws exceptions in various places. Trying to reduce the amount of unwrap/expect.
---
<!-- 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#21306 (github issue number if applicable).
<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____
<!-- 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/21871)
<!-- Reviewable:end -->
Fix flickering on Android
This is particularly noticeable in debug builds on WebGL pages, but also appears during startup when loading normal pages. requestRender() causes Android to swap buffers under the assumption that the buffer contains a fully rendered frame, but when calling it from `doFrame` there are no guarantees that Servo has finished compositing yet. This causes stale buffers to be composited instead, leading to flickering at startup when there is no content, or general jerkiness on pages using animation callbacks as previous frames replace current frames.
---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix#21796
- [x] These changes do not require tests because no android integration tests.
<!-- 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/21842)
<!-- Reviewable:end -->