diff options
author | Sushil Chauhan <sushilchauhan@codeaurora.org> | 2017-01-11 18:09:02 -0800 |
---|---|---|
committer | Sushil Chauhan <sushilchauhan@codeaurora.org> | 2017-01-11 18:51:08 -0800 |
commit | 1cc416f1223c47e75c2f7342f15d4e4cae09c976 (patch) | |
tree | 1f919b3ab8efe7170060bdf63ec6be17861fce80 /gpu_tonemapper/Tonemapper.cpp | |
parent | eb5c32bed2b2a73c4b68efd3ad18ed9a76a2aeb1 (diff) | |
download | android_hardware_qcom_sdm710_display-1cc416f1223c47e75c2f7342f15d4e4cae09c976.tar.gz android_hardware_qcom_sdm710_display-1cc416f1223c47e75c2f7342f15d4e4cae09c976.tar.bz2 android_hardware_qcom_sdm710_display-1cc416f1223c47e75c2f7342f15d4e4cae09c976.zip |
gpu_tonemapper: Clear EGLImage mappings in Tonemapper
Tonemapper does not clear the eglImage/fd mappings in the destructor,
which leads to incorrect usage of those fds, when a tone map session
gets deleted and a new session gets created, leading to artifcats.
CRs-Fixed: 1104823
Change-Id: I9697eff93f9e5f150796a582f471246bca3b2816
Diffstat (limited to 'gpu_tonemapper/Tonemapper.cpp')
-rw-r--r-- | gpu_tonemapper/Tonemapper.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/gpu_tonemapper/Tonemapper.cpp b/gpu_tonemapper/Tonemapper.cpp index 957c1335..5f2f9741 100644 --- a/gpu_tonemapper/Tonemapper.cpp +++ b/gpu_tonemapper/Tonemapper.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2017, The Linux Foundation. All rights reserved. * Not a Contribution. * * Copyright 2015 The Android Open Source Project @@ -32,6 +32,7 @@ Tonemapper::Tonemapper() tonemapTexture = 0; lutXformTexture = 0; programID = 0; + eglImageWrapper = new EGLImageWrapper(); } //----------------------------------------------------------------------------- @@ -41,6 +42,13 @@ Tonemapper::~Tonemapper() engine_deleteInputBuffer(tonemapTexture); engine_deleteInputBuffer(lutXformTexture); engine_deleteProgram(programID); + + // clear EGLImage mappings + if (eglImageWrapper != 0) { + eglImageWrapper->destroy(); + delete eglImageWrapper; + eglImageWrapper = 0; + } } //----------------------------------------------------------------------------- @@ -95,8 +103,8 @@ int Tonemapper::blit(const void *dst, const void *src, int srcFenceFd) engine_bind(); // create eglimages if required - EGLImageBuffer *dst_buffer = EGLImageWrapper::wrap(dst); - EGLImageBuffer *src_buffer = EGLImageWrapper::wrap(src); + EGLImageBuffer *dst_buffer = eglImageWrapper->wrap(dst); + EGLImageBuffer *src_buffer = eglImageWrapper->wrap(src); // bind the program engine_setProgram(programID); |