surfaceflinger: add RenderEngine::setCurrentSurface
setCurrentSurface is a wrapper to eglMakeCurrent and it uses the EGL
context implied by the RenderEngine. This also allows us to
simplify DisplayDevice::makeCurrent.
Test: SurfaceFlinger_test
Change-Id: Idab581f0ef79af7263159a558d8fad493a198ce7
diff --git a/services/surfaceflinger/DisplayDevice.cpp b/services/surfaceflinger/DisplayDevice.cpp
index a9f3aa1..302f038 100644
--- a/services/surfaceflinger/DisplayDevice.cpp
+++ b/services/surfaceflinger/DisplayDevice.cpp
@@ -290,14 +290,14 @@
return mFlags;
}
-EGLBoolean DisplayDevice::makeCurrent(EGLDisplay dpy, EGLContext ctx) const {
+EGLBoolean DisplayDevice::makeCurrent() const {
EGLBoolean result = EGL_TRUE;
EGLSurface sur = eglGetCurrentSurface(EGL_DRAW);
if (sur != mSurface) {
- result = eglMakeCurrent(dpy, mSurface, mSurface, ctx);
+ result = mFlinger->getRenderEngine().setCurrentSurface(mSurface);
if (result == EGL_TRUE) {
if (mType >= DisplayDevice::DISPLAY_VIRTUAL)
- eglSwapInterval(dpy, 0);
+ eglSwapInterval(mDisplay, 0);
}
}
setViewportAndProjection();