[dali_2.2.31] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / dali-toolkit-test-utils / test-graphics-texture.cpp
index adeeeca..30a759d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
@@ -183,6 +183,7 @@ bool IsCompressedFormat(Graphics::Format pixelFormat)
     case Graphics::Format::R64G64B64A64_SINT:
     case Graphics::Format::R64G64B64A64_SFLOAT:
     case Graphics::Format::B10G11R11_UFLOAT_PACK32:
+    case Graphics::Format::R11G11B10_UFLOAT_PACK32:
     case Graphics::Format::E5B9G9R9_UFLOAT_PACK32:
     case Graphics::Format::D16_UNORM:
     case Graphics::Format::X8_D24_UNORM_PACK32:
@@ -618,6 +619,12 @@ void PixelFormatToGl(Graphics::Format pixelFormat, GLenum& glFormat, GLint& glIn
       glFormat = 0;
       break;
     }
+    case Graphics::Format::R11G11B10_UFLOAT_PACK32:
+    {
+      glFormat      = GL_RGB;
+      pixelDataType = GL_FLOAT;
+      break;
+    }
 
     case Graphics::Format::R4G4_UNORM_PACK8:
     case Graphics::Format::A1R5G5B5_UNORM_PACK16:
@@ -768,6 +775,7 @@ void PixelFormatToGl(Graphics::Format pixelFormat, GLenum& glFormat, GLint& glIn
   {
     case Graphics::Format::R16G16B16A16_SFLOAT:
     case Graphics::Format::R32G32B32A32_SFLOAT:
+    case Graphics::Format::R11G11B10_UFLOAT_PACK32:
     {
       glInternalFormat = GL_R11F_G11F_B10F;
       break;
@@ -908,22 +916,6 @@ void TestGraphicsTexture::Prepare()
 {
   if(mCreateInfo.nativeImagePtr)
   {
-    /***********************************************************************************
-     * If the native image source changes, we need to re-create the texture.           *
-     * In EGL, this is done in native image implementation in PrepareTexture below.    *
-     *                                                                                 *
-     * In Vulkan impl, this was done in dali-core side. I think we should make this    *
-     * work in the graphics implementation instead.                                    *
-     ***********************************************************************************/
-    if(mCreateInfo.nativeImagePtr->SourceChanged())
-    {
-      uint32_t width  = mCreateInfo.nativeImagePtr->GetWidth();
-      uint32_t height = mCreateInfo.nativeImagePtr->GetHeight();
-      mCreateInfo.SetSize({width, height}); // Size may change
-
-      // @todo Re-initialize this texture from the new create info.
-    }
-
     // Ensure the native image is up-to-date
     mCreateInfo.nativeImagePtr->PrepareTexture();
   }