From f71d15be85e2bf041c39dc63b3b97487b3f1224d Mon Sep 17 00:00:00 2001 From: Sunghyun Kim Date: Mon, 31 May 2021 10:22:53 +0900 Subject: [PATCH] [Tizen] Fix related to eglImage memory 1. Create only when there is no eglImage 2. When new eglImage is prepared, the existing eglImage need to update Change-Id: I03d4f0df913203a29bc6f3f912ddcf08072a5911 --- .../imaging/tizen/native-image-source-impl-tizen.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/dali/internal/imaging/tizen/native-image-source-impl-tizen.cpp b/dali/internal/imaging/tizen/native-image-source-impl-tizen.cpp index f3b526d..816fd14 100644 --- a/dali/internal/imaging/tizen/native-image-source-impl-tizen.cpp +++ b/dali/internal/imaging/tizen/native-image-source-impl-tizen.cpp @@ -401,6 +401,12 @@ bool NativeImageSourceTizen::IsColorDepthSupported(Dali::NativeImageSource::Colo bool NativeImageSourceTizen::CreateResource() { + // If an EGL image exists, use it as it is without creating it. + if(mEglImageKHR != NULL) + { + return true; + } + // casting from an unsigned int to a void *, which should then be cast back // to an unsigned int in the driver. EGLClientBuffer eglBuffer = reinterpret_cast(mTbmSurface); @@ -440,15 +446,16 @@ void NativeImageSourceTizen::PrepareTexture() Dali::Mutex::ScopedLock lock(mMutex); if(mSetSource) { - void* eglImage = mEglImageKHR; + // Destroy previous eglImage because use for new one. + // if mEglImageKHR is not to be NULL here, it will not be updated with a new eglImage. + mEglImageExtensions->DestroyImageKHR(mEglImageKHR); + mEglImageKHR = NULL; if(CreateResource()) { TargetTexture(); } - mEglImageExtensions->DestroyImageKHR(eglImage); - mSetSource = false; } } -- 2.7.4