Revert "display: Store and restore the current eglContext"
This reverts commit 99ff47d39e.
Context restore is not required as HWC2 runs in hal context.
Change-Id: If12e53f684db6440b8232f5a694220e88842445c
This commit is contained in:
@@ -45,7 +45,6 @@ Tonemapper::Tonemapper()
|
|||||||
Tonemapper::~Tonemapper()
|
Tonemapper::~Tonemapper()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
{
|
{
|
||||||
void* caller_context = engine_backup();
|
|
||||||
engine_bind(engineContext);
|
engine_bind(engineContext);
|
||||||
engine_deleteInputBuffer(tonemapTexture);
|
engine_deleteInputBuffer(tonemapTexture);
|
||||||
engine_deleteInputBuffer(lutXformTexture);
|
engine_deleteInputBuffer(lutXformTexture);
|
||||||
@@ -58,9 +57,6 @@ Tonemapper::~Tonemapper()
|
|||||||
}
|
}
|
||||||
|
|
||||||
engine_shutdown(engineContext);
|
engine_shutdown(engineContext);
|
||||||
// restore the caller context
|
|
||||||
engine_bind(caller_context);
|
|
||||||
engine_free_backup(caller_context);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@@ -78,7 +74,6 @@ Tonemapper *Tonemapper::build(int type, void *colorMap, int colorMapSize, void *
|
|||||||
|
|
||||||
tonemapper->engineContext = engine_initialize(isSecure);
|
tonemapper->engineContext = engine_initialize(isSecure);
|
||||||
|
|
||||||
void* caller_context = engine_backup();
|
|
||||||
engine_bind(tonemapper->engineContext);
|
engine_bind(tonemapper->engineContext);
|
||||||
|
|
||||||
// load the 3d lut
|
// load the 3d lut
|
||||||
@@ -117,10 +112,6 @@ Tonemapper *Tonemapper::build(int type, void *colorMap, int colorMapSize, void *
|
|||||||
tonemapper->programID =
|
tonemapper->programID =
|
||||||
engine_loadProgram(1, &fullscreen_vertex_shader, fragmentShaderCount, fragmentShaders);
|
engine_loadProgram(1, &fullscreen_vertex_shader, fragmentShaderCount, fragmentShaders);
|
||||||
|
|
||||||
// restore the caller context
|
|
||||||
engine_bind(caller_context);
|
|
||||||
engine_free_backup(caller_context);
|
|
||||||
|
|
||||||
return tonemapper;
|
return tonemapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -128,7 +119,6 @@ Tonemapper *Tonemapper::build(int type, void *colorMap, int colorMapSize, void *
|
|||||||
int Tonemapper::blit(const void *dst, const void *src, int srcFenceFd)
|
int Tonemapper::blit(const void *dst, const void *src, int srcFenceFd)
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
{
|
{
|
||||||
void* caller_context = engine_backup();
|
|
||||||
// make current
|
// make current
|
||||||
engine_bind(engineContext);
|
engine_bind(engineContext);
|
||||||
|
|
||||||
@@ -159,10 +149,5 @@ int Tonemapper::blit(const void *dst, const void *src, int srcFenceFd)
|
|||||||
// perform
|
// perform
|
||||||
int fenceFD = engine_blit(srcFenceFd);
|
int fenceFD = engine_blit(srcFenceFd);
|
||||||
|
|
||||||
// restore the caller context
|
|
||||||
engine_bind(caller_context);
|
|
||||||
engine_free_backup(caller_context);
|
|
||||||
|
|
||||||
|
|
||||||
return fenceFD;
|
return fenceFD;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,8 +22,6 @@
|
|||||||
|
|
||||||
void* engine_initialize(bool isSecure);
|
void* engine_initialize(bool isSecure);
|
||||||
void engine_bind(void*);
|
void engine_bind(void*);
|
||||||
void* engine_backup();
|
|
||||||
void engine_free_backup(void*);
|
|
||||||
void engine_shutdown(void*);
|
void engine_shutdown(void*);
|
||||||
|
|
||||||
unsigned int engine_loadProgram(int, const char **, int, const char **);
|
unsigned int engine_loadProgram(int, const char **, int, const char **);
|
||||||
|
|||||||
@@ -46,27 +46,6 @@ void engine_bind(void* context)
|
|||||||
EGL(eglMakeCurrent(engineContext->eglDisplay, engineContext->eglSurface, engineContext->eglSurface, engineContext->eglContext));
|
EGL(eglMakeCurrent(engineContext->eglDisplay, engineContext->eglSurface, engineContext->eglSurface, engineContext->eglContext));
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// store the current context(caller)
|
|
||||||
void* engine_backup()
|
|
||||||
{
|
|
||||||
EngineContext* callerContext = new EngineContext();
|
|
||||||
// store the previous display/context
|
|
||||||
callerContext->eglDisplay = eglGetCurrentDisplay();
|
|
||||||
callerContext->eglContext = eglGetCurrentContext();
|
|
||||||
callerContext->eglSurface = eglGetCurrentSurface(EGL_DRAW);
|
|
||||||
|
|
||||||
return (void*)callerContext;
|
|
||||||
}
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// frees the backed up caller context
|
|
||||||
void engine_free_backup(void* context)
|
|
||||||
{
|
|
||||||
EngineContext* callerContext = (EngineContext*)(context);
|
|
||||||
|
|
||||||
delete callerContext;
|
|
||||||
}
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// initialize GL
|
// initialize GL
|
||||||
//
|
//
|
||||||
|
|||||||
Reference in New Issue
Block a user