diff options
author | Sushil Chauhan <sushilchauhan@codeaurora.org> | 2017-05-02 17:09:47 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-05-23 18:09:45 -0700 |
commit | 70bc2c01f0786908bc29de1d93ca462734b0c933 (patch) | |
tree | 6ae0c3bb60857a74fde763ecf2dcea7fbc2d2453 /gpu_tonemapper/glengine.cpp | |
parent | ec4b547fbf3b4243ca30fde1c025fe5089111658 (diff) |
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
Diffstat (limited to 'gpu_tonemapper/glengine.cpp')
-rw-r--r-- | gpu_tonemapper/glengine.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/gpu_tonemapper/glengine.cpp b/gpu_tonemapper/glengine.cpp index 90fe5022..6cfe15f5 100644 --- a/gpu_tonemapper/glengine.cpp +++ b/gpu_tonemapper/glengine.cpp @@ -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); |