From: Eunki, Hong Date: Fri, 16 Aug 2024 05:04:14 +0000 (+0900) Subject: Support NativeImageSourceQueue::ColorFormat::RGB~~ really works X-Git-Tag: dali_2.3.38~9^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F25%2F316225%2F2;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git Support NativeImageSourceQueue::ColorFormat::RGB~~ really works Until now, we use BGRA format as RGBA at tbm_queue_h implements. It might give confuse in future. So we just make new enum as BGRA. Now RGBA enum looks seperated well until now. So let we change the real behavior at TBM side. Change-Id: I322bffe365a60bdc100d98126f965f2c5c17696a Signed-off-by: Eunki, Hong --- diff --git a/dali/internal/canvas-renderer/tizen/canvas-renderer-impl-tizen.cpp b/dali/internal/canvas-renderer/tizen/canvas-renderer-impl-tizen.cpp index a2f2572..67413da 100644 --- a/dali/internal/canvas-renderer/tizen/canvas-renderer-impl-tizen.cpp +++ b/dali/internal/canvas-renderer/tizen/canvas-renderer-impl-tizen.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Samsung Electronics Co., Ltd. + * Copyright (c) 2024 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -448,7 +448,7 @@ void CanvasRendererTizen::MakeTargetBuffer(const Vector2& size) #ifdef THORVG_SUPPORT if(!mNativeImageQueue) { - mNativeImageQueue = Dali::NativeImageSourceQueue::New(size.width, size.height, Dali::NativeImageSourceQueue::ColorFormat::RGBA8888); + mNativeImageQueue = Dali::NativeImageSourceQueue::New(size.width, size.height, Dali::NativeImageSourceQueue::ColorFormat::BGRA8888); } else { 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 665fece..e5fe55c 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 @@ -70,7 +70,7 @@ int32_t GetTbmSurfaceQueueSize() NativeImageSourceQueueTizen* NativeImageSourceQueueTizen::New(uint32_t queueCount, uint32_t width, uint32_t height, Dali::NativeImageSourceQueue::ColorFormat colorFormat, Any nativeImageSourceQueue) { - NativeImageSourceQueueTizen* image = new NativeImageSourceQueueTizen(queueCount, width, height, colorFormat, nativeImageSourceQueue); + NativeImageSourceQueueTizen* image = new NativeImageSourceQueueTizen(queueCount, width, height, nativeImageSourceQueue); DALI_ASSERT_DEBUG(image && "NativeImageSourceQueueTizen allocation failed."); if(image) @@ -81,7 +81,7 @@ NativeImageSourceQueueTizen* NativeImageSourceQueueTizen::New(uint32_t queueCoun return image; } -NativeImageSourceQueueTizen::NativeImageSourceQueueTizen(uint32_t queueCount, uint32_t width, uint32_t height, Dali::NativeImageSourceQueue::ColorFormat colorFormat, Any nativeImageSourceQueue) +NativeImageSourceQueueTizen::NativeImageSourceQueueTizen(uint32_t queueCount, uint32_t width, uint32_t height, Any nativeImageSourceQueue) : mMutex(), mQueueCount(queueCount), mWidth(width), @@ -137,27 +137,42 @@ void NativeImageSourceQueueTizen::Initialize(Dali::NativeImageSourceQueue::Color switch(colorFormat) { - case Dali::NativeImageSourceQueue::ColorFormat::RGBA8888: // TODO : Implement me after other codes fixed. case Dali::NativeImageSourceQueue::ColorFormat::BGRA8888: { tbmFormat = TBM_FORMAT_ARGB8888; mBlendingRequired = true; break; } - case Dali::NativeImageSourceQueue::ColorFormat::RGBX8888: // TODO : Implement me after other codes fixed. case Dali::NativeImageSourceQueue::ColorFormat::BGRX8888: { tbmFormat = TBM_FORMAT_XRGB8888; mBlendingRequired = false; break; } - case Dali::NativeImageSourceQueue::ColorFormat::RGB888: // TODO : Implement me after other codes fixed. case Dali::NativeImageSourceQueue::ColorFormat::BGR888: { tbmFormat = TBM_FORMAT_RGB888; mBlendingRequired = false; break; } + case Dali::NativeImageSourceQueue::ColorFormat::RGBA8888: + { + tbmFormat = TBM_FORMAT_ABGR8888; + mBlendingRequired = true; + break; + } + case Dali::NativeImageSourceQueue::ColorFormat::RGBX8888: + { + tbmFormat = TBM_FORMAT_XBGR8888; + mBlendingRequired = false; + break; + } + case Dali::NativeImageSourceQueue::ColorFormat::RGB888: + { + tbmFormat = TBM_FORMAT_BGR888; + mBlendingRequired = false; + break; + } default: { DALI_LOG_WARNING("Wrong color format.\n"); 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 3f66b5a..2673059 100644 --- a/dali/internal/imaging/tizen/native-image-source-queue-impl-tizen.h +++ b/dali/internal/imaging/tizen/native-image-source-queue-impl-tizen.h @@ -195,10 +195,9 @@ private: * @param[in] queueCount The number of queue of the image. If it is 0, will use default. * @param[in] width The width of the image. * @param[in] height The height of the image. - * @param[in] colorFormat The format of the image. * @param[in] nativeImageSourceQueue contains tbm_surface_queue_h or is empty */ - NativeImageSourceQueueTizen(uint32_t queueCount, uint32_t width, uint32_t height, Dali::NativeImageSourceQueue::ColorFormat colorFormat, Any nativeImageSourceQueue); + NativeImageSourceQueueTizen(uint32_t queueCount, uint32_t width, uint32_t height, Any nativeImageSourceQueue); void Initialize(Dali::NativeImageSourceQueue::ColorFormat colorFormat);