diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2017-01-18 08:25:38 -0800 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-01-18 08:25:38 -0800 |
commit | 8492f1af4f655e88895e6a37b0110a1d2466e3ef (patch) | |
tree | c65815e6f4f199f4f5f296d62e4b865ed6b4b6a0 /gpu_tonemapper | |
parent | 5bab554484633820d22b6c7411afb44ed12597a3 (diff) | |
parent | 1cc416f1223c47e75c2f7342f15d4e4cae09c976 (diff) | |
download | display-8492f1af4f655e88895e6a37b0110a1d2466e3ef.tar.gz |
Merge "gpu_tonemapper: Clear EGLImage mappings in Tonemapper"
Diffstat (limited to 'gpu_tonemapper')
-rw-r--r-- | gpu_tonemapper/EGLImageWrapper.cpp | 6 | ||||
-rw-r--r-- | gpu_tonemapper/EGLImageWrapper.h | 10 | ||||
-rw-r--r-- | gpu_tonemapper/TonemapFactory.cpp | 5 | ||||
-rw-r--r-- | gpu_tonemapper/Tonemapper.cpp | 14 | ||||
-rw-r--r-- | gpu_tonemapper/Tonemapper.h | 5 |
5 files changed, 23 insertions, 17 deletions
diff --git a/gpu_tonemapper/EGLImageWrapper.cpp b/gpu_tonemapper/EGLImageWrapper.cpp index eb0a2ca5..298475fe 100644 --- a/gpu_tonemapper/EGLImageWrapper.cpp +++ b/gpu_tonemapper/EGLImageWrapper.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 @@ -22,8 +22,6 @@ #include <gralloc_priv.h> #include <ui/GraphicBuffer.h> -std::map<int, EGLImageBuffer *> EGLImageWrapper::eglImageBufferMap; - //----------------------------------------------------------------------------- EGLImageBuffer *EGLImageWrapper::wrap(const void *pvt_handle) //----------------------------------------------------------------------------- @@ -65,4 +63,4 @@ void EGLImageWrapper::destroy() delete it->second; } eglImageBufferMap.clear(); -}
\ No newline at end of file +} diff --git a/gpu_tonemapper/EGLImageWrapper.h b/gpu_tonemapper/EGLImageWrapper.h index d7fc84ba..90aaf583 100644 --- a/gpu_tonemapper/EGLImageWrapper.h +++ b/gpu_tonemapper/EGLImageWrapper.h @@ -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 @@ -24,11 +24,11 @@ #include "EGLImageBuffer.h" class EGLImageWrapper { - static std::map<int, EGLImageBuffer *> eglImageBufferMap; + std::map<int, EGLImageBuffer *> eglImageBufferMap; public: - static EGLImageBuffer *wrap(const void *pvt_handle); - static void destroy(); + EGLImageBuffer *wrap(const void *pvt_handle); + void destroy(); }; -#endif //__TONEMAPPER_EGLIMAGEWRAPPER_H__
\ No newline at end of file +#endif //__TONEMAPPER_EGLIMAGEWRAPPER_H__ diff --git a/gpu_tonemapper/TonemapFactory.cpp b/gpu_tonemapper/TonemapFactory.cpp index 81e9f7fc..cffc33a0 100644 --- a/gpu_tonemapper/TonemapFactory.cpp +++ b/gpu_tonemapper/TonemapFactory.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 @@ -19,7 +19,6 @@ #include "TonemapFactory.h" #include <utils/Log.h> -#include "EGLImageWrapper.h" #include "Tonemapper.h" #include "engine.h" @@ -41,8 +40,6 @@ Tonemapper *TonemapperFactory_GetInstance(int type, void *colorMap, int colorMap void TonemapperFactory_Destroy() //------------------------------------------ { - // clear EGLImage mappings - EGLImageWrapper::destroy(); // shutdown the engine engine_shutdown(); } 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); diff --git a/gpu_tonemapper/Tonemapper.h b/gpu_tonemapper/Tonemapper.h index 9c41670d..0f9bd513 100644 --- a/gpu_tonemapper/Tonemapper.h +++ b/gpu_tonemapper/Tonemapper.h @@ -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 @@ -23,11 +23,14 @@ #define TONEMAP_FORWARD 0 #define TONEMAP_INVERSE 1 +#include "EGLImageWrapper.h" + class Tonemapper { private: unsigned int tonemapTexture; unsigned int lutXformTexture; unsigned int programID; + EGLImageWrapper* eglImageWrapper; Tonemapper(); public: |