mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Auto merge of #21842 - jdm:android-extra-frame, r=paulrouget
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 -->
This commit is contained in:
commit
7fa2b2c879
2 changed files with 5 additions and 1 deletions
|
@ -54,6 +54,10 @@ public class Servo {
|
|||
return mJNI.version();
|
||||
}
|
||||
|
||||
public void performUpdates() {
|
||||
mRunCallback.inGLThread(() -> mJNI.performUpdates());
|
||||
}
|
||||
|
||||
public void setBatchMode(boolean mode) {
|
||||
mRunCallback.inGLThread(() -> mJNI.setBatchMode(mode));
|
||||
}
|
||||
|
|
|
@ -197,7 +197,7 @@ public class ServoView extends GLSurfaceView
|
|||
}
|
||||
|
||||
if (!zoomNecessary && !scrollNecessary && mAnimating) {
|
||||
requestRender();
|
||||
mServo.performUpdates();
|
||||
}
|
||||
|
||||
if (mZooming || mScrolling || mAnimating) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue