From: Heeyong Song Date: Mon, 30 Dec 2019 05:11:18 +0000 (+0900) Subject: Add a method to NativeImageSourceQueue X-Git-Tag: dali_1.5.11~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d9a356affd1eaa873d3c7e4d39e7ecf50eef13bd;p=platform%2Fcore%2Fuifw%2Fdali-adaptor-legacy.git Add a method to NativeImageSourceQueue There is a case not to show an image which is enqueued previously. So added a method to ignore a source buffer Change-Id: I571af6aff235955d441eef644300033d888003f5 --- diff --git a/dali/devel-api/adaptor-framework/native-image-source-queue.cpp b/dali/devel-api/adaptor-framework/native-image-source-queue.cpp index 297fd2a..acb10d5 100755 --- a/dali/devel-api/adaptor-framework/native-image-source-queue.cpp +++ b/dali/devel-api/adaptor-framework/native-image-source-queue.cpp @@ -56,6 +56,11 @@ void NativeImageSourceQueue::SetSize( uint32_t width, uint32_t height ) return mImpl->SetSize( width, height ); } +void NativeImageSourceQueue::IgnoreSourceImage() +{ + mImpl->IgnoreSourceImage(); +} + bool NativeImageSourceQueue::GlExtensionCreate() { return mImpl->GlExtensionCreate(); diff --git a/dali/devel-api/adaptor-framework/native-image-source-queue.h b/dali/devel-api/adaptor-framework/native-image-source-queue.h index 32b08c3..0e02903 100755 --- a/dali/devel-api/adaptor-framework/native-image-source-queue.h +++ b/dali/devel-api/adaptor-framework/native-image-source-queue.h @@ -104,6 +104,13 @@ public: */ void SetSize( uint32_t width, uint32_t height ); + /** + * @brief Ignores a source image which is inserted to the queue. + * + * @note This can be called from worker threads. + */ + void IgnoreSourceImage(); + private: // native image /** diff --git a/dali/internal/imaging/android/native-image-source-queue-impl-android.cpp b/dali/internal/imaging/android/native-image-source-queue-impl-android.cpp index 7043979..45905bd 100644 --- a/dali/internal/imaging/android/native-image-source-queue-impl-android.cpp +++ b/dali/internal/imaging/android/native-image-source-queue-impl-android.cpp @@ -72,6 +72,10 @@ void NativeImageSourceQueueAndroid::SetSize( uint32_t width, uint32_t height ) mHeight = height; } +void NativeImageSourceQueueAndroid::IgnoreSourceImage() +{ +} + bool NativeImageSourceQueueAndroid::GlExtensionCreate() { return true; diff --git a/dali/internal/imaging/android/native-image-source-queue-impl-android.h b/dali/internal/imaging/android/native-image-source-queue-impl-android.h index e1cb045..be5b8b6 100644 --- a/dali/internal/imaging/android/native-image-source-queue-impl-android.h +++ b/dali/internal/imaging/android/native-image-source-queue-impl-android.h @@ -65,6 +65,11 @@ public: void SetSize( uint32_t width, uint32_t height ) override; /** + * @copydoc Dali::NativeImageSourceQueue::IgnoreSourceImage + */ + void IgnoreSourceImage() override; + + /** * destructor */ ~NativeImageSourceQueueAndroid() override; diff --git a/dali/internal/imaging/common/native-image-source-queue-impl.h b/dali/internal/imaging/common/native-image-source-queue-impl.h index 889935e..eeb87f2 100755 --- a/dali/internal/imaging/common/native-image-source-queue-impl.h +++ b/dali/internal/imaging/common/native-image-source-queue-impl.h @@ -53,6 +53,11 @@ public: virtual void SetSize( uint32_t width, uint32_t height ) = 0; /** + * @copydoc Dali::NativeImageSourceQueue::IgnoreSourceImage + */ + virtual void IgnoreSourceImage() = 0; + + /** * destructor */ virtual ~NativeImageSourceQueue() = default; diff --git a/dali/internal/imaging/tizen/native-image-source-queue-impl-tizen.cpp b/dali/internal/imaging/tizen/native-image-source-queue-impl-tizen.cpp index e7fa554..f95ee1a 100644 --- a/dali/internal/imaging/tizen/native-image-source-queue-impl-tizen.cpp +++ b/dali/internal/imaging/tizen/native-image-source-queue-impl-tizen.cpp @@ -189,6 +189,26 @@ void NativeImageSourceQueueTizen::SetSize( uint32_t width, uint32_t height ) ResetEglImageList(); } +void NativeImageSourceQueueTizen::IgnoreSourceImage() +{ + Dali::Mutex::ScopedLock lock( mMutex ); + tbm_surface_h surface; + + if( tbm_surface_queue_can_acquire( mTbmQueue, 0 ) ) + { + if( tbm_surface_queue_acquire( mTbmQueue, &surface ) != TBM_SURFACE_QUEUE_ERROR_NONE ) + { + DALI_LOG_ERROR( "NativeImageSourceQueueTizen::IgnoreSourceImage: Failed to aquire a tbm_surface\n" ); + return; + } + + if( tbm_surface_internal_is_valid( surface ) ) + { + tbm_surface_queue_release( mTbmQueue, surface ); + } + } +} + bool NativeImageSourceQueueTizen::GlExtensionCreate() { mEglImageExtensions = mEglGraphics->GetImageExtensions(); diff --git a/dali/internal/imaging/tizen/native-image-source-queue-impl-tizen.h b/dali/internal/imaging/tizen/native-image-source-queue-impl-tizen.h index 88b27cb..7f16352 100755 --- a/dali/internal/imaging/tizen/native-image-source-queue-impl-tizen.h +++ b/dali/internal/imaging/tizen/native-image-source-queue-impl-tizen.h @@ -69,6 +69,11 @@ public: void SetSize( uint32_t width, uint32_t height ) override; /** + * @copydoc Dali::NativeImageSourceQueue::IgnoreSourceImage + */ + void IgnoreSourceImage() override; + + /** * destructor */ ~NativeImageSourceQueueTizen() override; diff --git a/dali/internal/imaging/ubuntu-x11/native-image-source-queue-impl-x.cpp b/dali/internal/imaging/ubuntu-x11/native-image-source-queue-impl-x.cpp index 4bd539b..6488487 100644 --- a/dali/internal/imaging/ubuntu-x11/native-image-source-queue-impl-x.cpp +++ b/dali/internal/imaging/ubuntu-x11/native-image-source-queue-impl-x.cpp @@ -73,6 +73,10 @@ void NativeImageSourceQueueX::SetSize( uint32_t width, uint32_t height ) mHeight = height; } +void NativeImageSourceQueueX::IgnoreSourceImage() +{ +} + bool NativeImageSourceQueueX::GlExtensionCreate() { return true; diff --git a/dali/internal/imaging/ubuntu-x11/native-image-source-queue-impl-x.h b/dali/internal/imaging/ubuntu-x11/native-image-source-queue-impl-x.h index c252bec..689f733 100755 --- a/dali/internal/imaging/ubuntu-x11/native-image-source-queue-impl-x.h +++ b/dali/internal/imaging/ubuntu-x11/native-image-source-queue-impl-x.h @@ -65,6 +65,11 @@ public: void SetSize( uint32_t width, uint32_t height ) override; /** + * @copydoc Dali::NativeImageSourceQueue::IgnoreSourceImage + */ + void IgnoreSourceImage() override; + + /** * destructor */ ~NativeImageSourceQueueX() override;