[Tizen] Revert "Use Texture for not file save case"
authorWoochan Lee <wc0917.lee@samsung.com>
Wed, 7 Aug 2024 05:11:11 +0000 (14:11 +0900)
committerWoochan Lee <wc0917.lee@samsung.com>
Wed, 7 Aug 2024 05:11:11 +0000 (14:11 +0900)
This reverts commit 9c5ba13bbcd00209c4730121134e6f902831fdfd.

dali/internal/system/common/capture-impl.cpp
dali/internal/system/common/capture-impl.h
dali/public-api/capture/capture.cpp
dali/public-api/capture/capture.h

index 713785d..07ddb93 100644 (file)
@@ -43,6 +43,7 @@ namespace
 static constexpr uint32_t ORDER_INDEX_CAPTURE_RENDER_TASK              = INT32_MAX;
 constexpr int32_t         SHADER_VERSION_NATIVE_IMAGE_SOURCE_AVAILABLE = 300;
 constexpr uint32_t        TIME_OUT_DURATION                            = 1000;
+constexpr int32_t  GL_VERSION_NATIVE_IMAGE_SOURCE_AVAILABLE = 30;
 } // namespace
 
 Capture::Capture()
@@ -141,11 +142,6 @@ Dali::NativeImageSourcePtr Capture::GetNativeImageSource() const
   return mNativeImageSourcePtr;
 }
 
-Dali::Texture Capture::GetTexture() const
-{
-  return mTexture;
-}
-
 Dali::Devel::PixelBuffer Capture::GetCapturedBuffer()
 {
   if(!mPixelBuffer || (mPixelBuffer && !mPixelBuffer.GetBuffer()))
@@ -170,17 +166,10 @@ Dali::Capture::CaptureFinishedSignalType& Capture::FinishedSignal()
 
 void Capture::CreateTexture(const Vector2& size)
 {
-  if(mFileSave)
-  {
-    if(!mNativeImageSourcePtr)
-    {
-      mNativeImageSourcePtr = Dali::NativeImageSource::New(size.width, size.height, Dali::NativeImageSource::COLOR_DEPTH_DEFAULT);
-      mTexture              = Dali::Texture::New(*mNativeImageSourcePtr);
-    }
-  }
-  else
+  if(!mNativeImageSourcePtr)
   {
-    mTexture = Dali::Texture::New(TextureType::TEXTURE_2D, Pixel::RGBA8888, unsigned(size.width), unsigned(size.height));
+    mNativeImageSourcePtr = Dali::NativeImageSource::New(size.width, size.height, Dali::NativeImageSource::COLOR_DEPTH_DEFAULT);
+    mTexture              = Dali::Texture::New(*mNativeImageSourcePtr);
   }
 }
 
@@ -317,12 +306,6 @@ bool Capture::IsRenderTaskSetup()
 
 void Capture::SetupResources(const Dali::Vector2& position, const Dali::Vector2& size, const Dali::Vector4& clearColor, Dali::Actor source)
 {
-  if(mFileSave && Dali::Shader::GetShaderLanguageVersion() < SHADER_VERSION_NATIVE_IMAGE_SOURCE_AVAILABLE)
-  {
-    DALI_LOG_ERROR("GLES is 2.0, we can't use native image source \n");
-    mFileSave = false;
-  }
-
   CreateTexture(size);
 
   CreateFrameBuffer();
@@ -388,7 +371,6 @@ bool Capture::SaveFile()
   {
     return Dali::DevelNativeImageSource::EncodeToFile(*mNativeImageSourcePtr, mPath, mQuality);
   }
-
   return false;
 }
 
index 6d42f8f..67159f2 100644 (file)
@@ -103,11 +103,6 @@ public:
   Dali::Devel::PixelBuffer GetCapturedBuffer();
 
   /**
-   * @copydoc Dali::Capture::GetTexture
-   */
-  Dali::Texture GetTexture() const;
-
-  /**
    * @copydoc Dali::Capture::FinishedSignal
    */
   Dali::Capture::CaptureFinishedSignalType& FinishedSignal();
index 4c96a61..ce9cd16 100644 (file)
@@ -98,11 +98,6 @@ Dali::NativeImageSourcePtr Capture::GetNativeImageSource() const
   return GetImpl(*this).GetNativeImageSource();
 }
 
-Dali::Texture Capture::GetTexture() const
-{
-  return GetImpl(*this).GetTexture();
-}
-
 Capture::CaptureFinishedSignalType& Capture::FinishedSignal()
 {
   return GetImpl(*this).FinishedSignal();
index 6f133da..b202576 100644 (file)
@@ -21,7 +21,6 @@
 // EXTERNAL HEADERS
 #include <dali/public-api/actors/actor.h>
 #include <dali/public-api/actors/camera-actor.h>
-#include <dali/public-api/rendering/texture.h>
 #include <dali/public-api/signals/dali-signal.h>
 
 // INTERNAL INCLUDES
@@ -275,13 +274,6 @@ public:
   Dali::NativeImageSourcePtr GetNativeImageSource() const;
 
   /**
-   * @brief Get Texture of captured image.
-   *
-   * @return Texture Captured result
-   */
-  Dali::Texture GetTexture() const;
-
-  /**
    * @brief Get finished signal.
    *
    * @SINCE_1_3_4