hwc: gpu_tonemapper: Create Secure EGL Context
- HWC tonemapper passes secure flag to GPU tonemapper to create object with secure EGL context. - Tonemapper object gets created with secure EGL context for the tone mapping of secure HDR layer. CRs-Fixed: 2048764 Change-Id: I7129505283527dbab17f1e9731d8f141b48bb310
This commit is contained in:
committed by
Gerrit - the friendly Code Review server
parent
ec4b547fbf
commit
70bc2c01f0
@@ -70,7 +70,7 @@ void engine_free_backup(void* context)
|
||||
//-----------------------------------------------------------------------------
|
||||
// initialize GL
|
||||
//
|
||||
void* engine_initialize()
|
||||
void* engine_initialize(bool isSecure)
|
||||
//-----------------------------------------------------------------------------
|
||||
{
|
||||
EngineContext* engineContext = new EngineContext();
|
||||
@@ -94,11 +94,18 @@ void* engine_initialize()
|
||||
EGL(eglChooseConfig(engineContext->eglDisplay, eglConfigAttribList, &eglConfig, 1, &numConfig));
|
||||
|
||||
// context
|
||||
EGLint eglContextAttribList[] = {EGL_CONTEXT_CLIENT_VERSION, 3, EGL_NONE};
|
||||
EGLint eglContextAttribList[] = {EGL_CONTEXT_CLIENT_VERSION, 3,
|
||||
isSecure ? EGL_PROTECTED_CONTENT_EXT : EGL_NONE,
|
||||
isSecure ? EGL_TRUE : EGL_NONE,
|
||||
EGL_NONE};
|
||||
engineContext->eglContext = eglCreateContext(engineContext->eglDisplay, eglConfig, NULL, eglContextAttribList);
|
||||
|
||||
// surface
|
||||
EGLint eglSurfaceAttribList[] = {EGL_WIDTH, 1, EGL_HEIGHT, 1, EGL_NONE, EGL_NONE};
|
||||
EGLint eglSurfaceAttribList[] = {EGL_WIDTH, 1,
|
||||
EGL_HEIGHT, 1,
|
||||
isSecure ? EGL_PROTECTED_CONTENT_EXT : EGL_NONE,
|
||||
isSecure ? EGL_TRUE : EGL_NONE,
|
||||
EGL_NONE};
|
||||
engineContext->eglSurface = eglCreatePbufferSurface(engineContext->eglDisplay, eglConfig, eglSurfaceAttribList);
|
||||
|
||||
eglMakeCurrent(engineContext->eglDisplay, engineContext->eglSurface, engineContext->eglSurface, engineContext->eglContext);
|
||||
|
||||
Reference in New Issue
Block a user