Support NativeImageSourceQueue::ColorFormat::RGB~~ really works 25/316225/2
authorEunki, Hong <eunkiki.hong@samsung.com>
Fri, 16 Aug 2024 05:04:14 +0000 (14:04 +0900)
committerEunki, Hong <eunkiki.hong@samsung.com>
Fri, 16 Aug 2024 05:31:12 +0000 (14:31 +0900)
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 <eunkiki.hong@samsung.com>
dali/internal/canvas-renderer/tizen/canvas-renderer-impl-tizen.cpp
dali/internal/imaging/tizen/native-image-source-queue-impl-tizen.cpp
dali/internal/imaging/tizen/native-image-source-queue-impl-tizen.h

index a2f2572..67413da 100644 (file)
@@ -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
   {
index 665fece..e5fe55c 100644 (file)
@@ -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");
index 3f66b5a..2673059 100644 (file)
@@ -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);