aboutsummaryrefslogtreecommitdiffstats
path: root/support/magicleap/Servo2D/code
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2018-10-30 09:57:56 -0400
committerGitHub <noreply@github.com>2018-10-30 09:57:56 -0400
commit4ead81717a0a9bde23304aaf5d7f9e1a005c2538 (patch)
tree7999d0b234d70e790b8ee580100a3f97952fcc6d /support/magicleap/Servo2D/code
parentc876592d84dc3e82fab355649a6f35d93b8bdd81 (diff)
parent0124baa82f1bd5119cf6398af2e97b4ddf444e9a (diff)
downloadservo-4ead81717a0a9bde23304aaf5d7f9e1a005c2538.tar.gz
servo-4ead81717a0a9bde23304aaf5d7f9e1a005c2538.zip
Auto merge of #22044 - asajeffrey:magicleap-less-egl-buffer-swapping, r=jdm
Reduce the amount of EGL buffer swapping the ML port is doing <!-- Please describe your changes on the following line: --> At the moment, we're swapping the EGL buffers every heartbeat, which produces a lot of flickering. We should only swap the buffers when needed. --- <!-- 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 do not require tests because we have no way to test on ML <!-- 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/22044) <!-- Reviewable:end -->
Diffstat (limited to 'support/magicleap/Servo2D/code')
-rw-r--r--support/magicleap/Servo2D/code/src/Servo2D.cpp16
1 files changed, 0 insertions, 16 deletions
diff --git a/support/magicleap/Servo2D/code/src/Servo2D.cpp b/support/magicleap/Servo2D/code/src/Servo2D.cpp
index 8704478e210..9b830ac6ca0 100644
--- a/support/magicleap/Servo2D/code/src/Servo2D.cpp
+++ b/support/magicleap/Servo2D/code/src/Servo2D.cpp
@@ -116,8 +116,6 @@ int Servo2D::init() {
EGLContext ctx = plane_->getEGLContext();
EGLSurface surf = plane_->getEGLSurface();
EGLDisplay dpy = eglGetDisplay(EGL_DEFAULT_DISPLAY);
- eglMakeCurrent(dpy, surf, surf, ctx);
- glViewport(0, 0, VIEWPORT_W, VIEWPORT_H);
// Hook into servo
servo_ = init_servo(ctx, surf, dpy, logger, "https://servo.org/", VIEWPORT_H, VIEWPORT_W, HIDPI);
@@ -127,9 +125,6 @@ int Servo2D::init() {
return 1;
}
- // Flush GL
- glFlush();
- eglSwapBuffers(dpy, surf);
return 0;
}
@@ -176,20 +171,9 @@ void Servo2D::instanceInitialScenes() {
}
bool Servo2D::updateLoop(float fDelta) {
- // Get the EGL context, surface and display.
- EGLContext ctx = plane_->getEGLContext();
- EGLSurface surf = plane_->getEGLSurface();
- EGLDisplay dpy = eglGetDisplay(EGL_DEFAULT_DISPLAY);
- eglMakeCurrent(dpy, surf, surf, ctx);
- glViewport(0, 0, VIEWPORT_W, VIEWPORT_H);
-
// Hook into servo
heartbeat_servo(servo_);
- // Flush GL
- glFlush();
- eglSwapBuffers(dpy, surf);
-
// Return true for your app to continue running, false to terminate the app.
return true;
}