summaryrefslogtreecommitdiff
path: root/gpu_tonemapper/glengine.cpp
diff options
context:
space:
mode:
authorArun Kumar K.R <akumarkr@codeaurora.org>2017-02-20 20:07:48 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2017-05-07 12:11:37 -0700
commit99ff47d39ed58a04890ccf8ba9d86ef2a5621270 (patch)
treed30a7c29e9d48febf8ca7aaf29a2930390eb34bb /gpu_tonemapper/glengine.cpp
parent1d1e57dc0e959f8c84be8913cf3d651ed3de49e0 (diff)
display: Store and restore the current eglContext
Tone mapper engine setting the current eglContext and never restored it. With multiple eglContexts used in same thread by SurfaceFlinger and GPU Tonemapper, it lead to incorrect eglContexts being used, hence always store the restore the eglContext in each GPUTonemapper call. CRs-Fixed: 2009259 Change-Id: Ic9fe73818ddfe3881e5fa82f7853dce130bba24e
Diffstat (limited to 'gpu_tonemapper/glengine.cpp')
-rw-r--r--gpu_tonemapper/glengine.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/gpu_tonemapper/glengine.cpp b/gpu_tonemapper/glengine.cpp
index 7a970c5d..90fe5022 100644
--- a/gpu_tonemapper/glengine.cpp
+++ b/gpu_tonemapper/glengine.cpp
@@ -47,6 +47,27 @@ void engine_bind(void* context)
}
//-----------------------------------------------------------------------------
+// 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
//
void* engine_initialize()