Merge "Fix related to eglImage memory" into devel/master
authorsunghyun kim <scholb.kim@samsung.com>
Fri, 18 Jun 2021 01:34:16 +0000 (01:34 +0000)
committerGerrit Code Review <gerrit@review>
Fri, 18 Jun 2021 01:34:16 +0000 (01:34 +0000)
automated-tests/src/dali-adaptor/utc-Dali-ImageLoading.cpp
dali/devel-api/adaptor-framework/image-loading.cpp
dali/devel-api/adaptor-framework/image-loading.h
dali/internal/accessibility/bridge/bridge-accessible.cpp
dali/internal/graphics/gles-impl/gles-context.cpp
dali/internal/graphics/gles-impl/gles-graphics-framebuffer.cpp
dali/internal/system/common/file-reader.h
dali/internal/window-system/common/gl-window-impl.cpp
dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp
dali/public-api/dali-adaptor-version.cpp
packaging/dali-adaptor.spec

index 23e2450..1019707 100644 (file)
@@ -70,6 +70,23 @@ const char* IMAGE_WIDTH_EVEN_EXIF8_RGB = TEST_RESOURCE_DIR "/f-even-exif-8.jpg";
 
 // this is image is not exist, for negative test
 const char* IMAGENONEXIST = "non-exist.jpg";
+
+Dali::Vector<uint8_t> FileToMemory(const char* filename)
+{
+  Dali::Vector<uint8_t> buffer;
+  FILE *fp;
+  fp = fopen(filename, "rb");
+  if(fp != NULL)
+  {
+    fseek(fp, 0, SEEK_END);
+    size_t size = ftell(fp);
+    buffer.Resize(size);
+    fseek(fp, 0, SEEK_SET);
+    fread(buffer.Begin(), size, sizeof(uint8_t), fp);
+    fclose(fp);
+  }
+  return buffer;
+}
 } // namespace
 
 void utc_dali_load_image_startup(void)
@@ -223,6 +240,154 @@ int UtcDaliLoadImageN(void)
   END_TEST;
 }
 
+int UtcDaliLoadImageFromBufferP(void)
+{
+  Devel::PixelBuffer pixelBuffer = Dali::LoadImageFromBuffer(FileToMemory(IMAGE_34_RGBA));
+  DALI_TEST_CHECK(pixelBuffer);
+  DALI_TEST_EQUALS(pixelBuffer.GetWidth(), 34u, TEST_LOCATION);
+  DALI_TEST_EQUALS(pixelBuffer.GetHeight(), 34u, TEST_LOCATION);
+  DALI_TEST_EQUALS(pixelBuffer.GetPixelFormat(), Pixel::RGBA8888, TEST_LOCATION);
+
+  Devel::PixelBuffer pixelBuffer2 = Dali::LoadImageFromBuffer(FileToMemory(IMAGE_128_RGB));
+  DALI_TEST_CHECK(pixelBuffer2);
+  DALI_TEST_EQUALS(pixelBuffer2.GetWidth(), 128u, TEST_LOCATION);
+  DALI_TEST_EQUALS(pixelBuffer2.GetHeight(), 128u, TEST_LOCATION);
+  DALI_TEST_EQUALS(pixelBuffer2.GetPixelFormat(), Pixel::RGB888, TEST_LOCATION);
+
+  Devel::PixelBuffer pixelBufferJpeg = Dali::LoadImageFromBuffer(FileToMemory(IMAGE_LARGE_EXIF3_RGB));
+  DALI_TEST_CHECK(pixelBufferJpeg);
+  DALI_TEST_EQUALS(pixelBufferJpeg.GetWidth(), 2000u, TEST_LOCATION);
+  DALI_TEST_EQUALS(pixelBufferJpeg.GetHeight(), 2560u, TEST_LOCATION);
+  DALI_TEST_EQUALS(pixelBufferJpeg.GetPixelFormat(), Pixel::RGB888, TEST_LOCATION);
+
+  Devel::PixelBuffer BufferJpeg1 = Dali::LoadImageFromBuffer(FileToMemory(IMAGE_WIDTH_ODD_EXIF1_RGB));
+  DALI_TEST_CHECK(BufferJpeg1);
+  DALI_TEST_EQUALS(BufferJpeg1.GetWidth(), 55u, TEST_LOCATION);
+  DALI_TEST_EQUALS(BufferJpeg1.GetHeight(), 64u, TEST_LOCATION);
+  DALI_TEST_EQUALS(BufferJpeg1.GetPixelFormat(), Pixel::RGB888, TEST_LOCATION);
+
+  pixelBufferJpeg = Dali::LoadImageFromBuffer(FileToMemory(IMAGE_WIDTH_ODD_EXIF2_RGB));
+  DALI_TEST_CHECK(pixelBufferJpeg);
+  DALI_TEST_EQUALS(pixelBufferJpeg.GetWidth(), 55u, TEST_LOCATION);
+  DALI_TEST_EQUALS(pixelBufferJpeg.GetHeight(), 64u, TEST_LOCATION);
+  DALI_TEST_EQUALS(pixelBufferJpeg.GetPixelFormat(), Pixel::RGB888, TEST_LOCATION);
+  DALI_IMAGE_TEST_EQUALS(BufferJpeg1, pixelBufferJpeg, 8, TEST_LOCATION);
+
+  pixelBufferJpeg = Dali::LoadImageFromBuffer(FileToMemory(IMAGE_WIDTH_ODD_EXIF3_RGB));
+  DALI_TEST_CHECK(pixelBufferJpeg);
+  DALI_TEST_EQUALS(pixelBufferJpeg.GetWidth(), 55u, TEST_LOCATION);
+  DALI_TEST_EQUALS(pixelBufferJpeg.GetHeight(), 64u, TEST_LOCATION);
+  DALI_TEST_EQUALS(pixelBufferJpeg.GetPixelFormat(), Pixel::RGB888, TEST_LOCATION);
+  DALI_IMAGE_TEST_EQUALS(BufferJpeg1, pixelBufferJpeg, 8, TEST_LOCATION);
+
+  pixelBufferJpeg = Dali::LoadImageFromBuffer(FileToMemory(IMAGE_WIDTH_ODD_EXIF4_RGB));
+  DALI_TEST_CHECK(pixelBufferJpeg);
+  DALI_TEST_EQUALS(pixelBufferJpeg.GetWidth(), 55u, TEST_LOCATION);
+  DALI_TEST_EQUALS(pixelBufferJpeg.GetHeight(), 64u, TEST_LOCATION);
+  DALI_TEST_EQUALS(pixelBufferJpeg.GetPixelFormat(), Pixel::RGB888, TEST_LOCATION);
+  DALI_IMAGE_TEST_EQUALS(BufferJpeg1, pixelBufferJpeg, 8, TEST_LOCATION);
+
+  pixelBufferJpeg = Dali::LoadImageFromBuffer(FileToMemory(IMAGE_WIDTH_ODD_EXIF5_RGB));
+  DALI_TEST_CHECK(pixelBufferJpeg);
+  DALI_TEST_EQUALS(pixelBufferJpeg.GetWidth(), 55u, TEST_LOCATION);
+  DALI_TEST_EQUALS(pixelBufferJpeg.GetHeight(), 64u, TEST_LOCATION);
+  DALI_TEST_EQUALS(pixelBufferJpeg.GetPixelFormat(), Pixel::RGB888, TEST_LOCATION);
+  DALI_IMAGE_TEST_EQUALS(BufferJpeg1, pixelBufferJpeg, 8, TEST_LOCATION);
+
+  pixelBufferJpeg = Dali::LoadImageFromBuffer(FileToMemory(IMAGE_WIDTH_ODD_EXIF6_RGB));
+  DALI_TEST_CHECK(pixelBufferJpeg);
+  DALI_TEST_EQUALS(pixelBufferJpeg.GetWidth(), 55u, TEST_LOCATION);
+  DALI_TEST_EQUALS(pixelBufferJpeg.GetHeight(), 64u, TEST_LOCATION);
+  DALI_TEST_EQUALS(pixelBufferJpeg.GetPixelFormat(), Pixel::RGB888, TEST_LOCATION);
+  DALI_IMAGE_TEST_EQUALS(BufferJpeg1, pixelBufferJpeg, 8, TEST_LOCATION);
+
+  pixelBufferJpeg = Dali::LoadImageFromBuffer(FileToMemory(IMAGE_WIDTH_ODD_EXIF7_RGB));
+  DALI_TEST_CHECK(pixelBufferJpeg);
+  DALI_TEST_EQUALS(pixelBufferJpeg.GetWidth(), 55u, TEST_LOCATION);
+  DALI_TEST_EQUALS(pixelBufferJpeg.GetHeight(), 64u, TEST_LOCATION);
+  DALI_TEST_EQUALS(pixelBufferJpeg.GetPixelFormat(), Pixel::RGB888, TEST_LOCATION);
+  DALI_IMAGE_TEST_EQUALS(BufferJpeg1, pixelBufferJpeg, 8, TEST_LOCATION);
+
+  pixelBufferJpeg = Dali::LoadImageFromBuffer(FileToMemory(IMAGE_WIDTH_ODD_EXIF8_RGB));
+  DALI_TEST_CHECK(pixelBufferJpeg);
+  DALI_TEST_EQUALS(pixelBufferJpeg.GetWidth(), 55u, TEST_LOCATION);
+  DALI_TEST_EQUALS(pixelBufferJpeg.GetHeight(), 64u, TEST_LOCATION);
+  DALI_TEST_EQUALS(pixelBufferJpeg.GetPixelFormat(), Pixel::RGB888, TEST_LOCATION);
+  DALI_IMAGE_TEST_EQUALS(BufferJpeg1, pixelBufferJpeg, 8, TEST_LOCATION);
+
+  BufferJpeg1 = Dali::LoadImageFromBuffer(FileToMemory(IMAGE_WIDTH_EVEN_EXIF1_RGB));
+  DALI_TEST_CHECK(BufferJpeg1);
+  DALI_TEST_EQUALS(BufferJpeg1.GetWidth(), 50u, TEST_LOCATION);
+  DALI_TEST_EQUALS(BufferJpeg1.GetHeight(), 64u, TEST_LOCATION);
+  DALI_TEST_EQUALS(BufferJpeg1.GetPixelFormat(), Pixel::RGB888, TEST_LOCATION);
+
+  pixelBufferJpeg = Dali::LoadImageFromBuffer(FileToMemory(IMAGE_WIDTH_EVEN_EXIF2_RGB));
+  DALI_TEST_CHECK(pixelBufferJpeg);
+  DALI_TEST_EQUALS(pixelBufferJpeg.GetWidth(), 50u, TEST_LOCATION);
+  DALI_TEST_EQUALS(pixelBufferJpeg.GetHeight(), 64u, TEST_LOCATION);
+  DALI_TEST_EQUALS(pixelBufferJpeg.GetPixelFormat(), Pixel::RGB888, TEST_LOCATION);
+  DALI_IMAGE_TEST_EQUALS(BufferJpeg1, pixelBufferJpeg, 8, TEST_LOCATION);
+
+  pixelBufferJpeg = Dali::LoadImageFromBuffer(FileToMemory(IMAGE_WIDTH_EVEN_EXIF3_RGB));
+  DALI_TEST_CHECK(pixelBufferJpeg);
+  DALI_TEST_EQUALS(pixelBufferJpeg.GetWidth(), 50u, TEST_LOCATION);
+  DALI_TEST_EQUALS(pixelBufferJpeg.GetHeight(), 64u, TEST_LOCATION);
+  DALI_TEST_EQUALS(pixelBufferJpeg.GetPixelFormat(), Pixel::RGB888, TEST_LOCATION);
+  DALI_IMAGE_TEST_EQUALS(BufferJpeg1, pixelBufferJpeg, 8, TEST_LOCATION);
+
+  pixelBufferJpeg = Dali::LoadImageFromBuffer(FileToMemory(IMAGE_WIDTH_EVEN_EXIF4_RGB));
+  DALI_TEST_CHECK(pixelBufferJpeg);
+  DALI_TEST_EQUALS(pixelBufferJpeg.GetWidth(), 50u, TEST_LOCATION);
+  DALI_TEST_EQUALS(pixelBufferJpeg.GetHeight(), 64u, TEST_LOCATION);
+  DALI_TEST_EQUALS(pixelBufferJpeg.GetPixelFormat(), Pixel::RGB888, TEST_LOCATION);
+  DALI_IMAGE_TEST_EQUALS(BufferJpeg1, pixelBufferJpeg, 8, TEST_LOCATION);
+
+  pixelBufferJpeg = Dali::LoadImageFromBuffer(FileToMemory(IMAGE_WIDTH_EVEN_EXIF5_RGB));
+  DALI_TEST_CHECK(pixelBufferJpeg);
+  DALI_TEST_EQUALS(pixelBufferJpeg.GetWidth(), 50u, TEST_LOCATION);
+  DALI_TEST_EQUALS(pixelBufferJpeg.GetHeight(), 64u, TEST_LOCATION);
+  DALI_TEST_EQUALS(pixelBufferJpeg.GetPixelFormat(), Pixel::RGB888, TEST_LOCATION);
+  DALI_IMAGE_TEST_EQUALS(BufferJpeg1, pixelBufferJpeg, 8, TEST_LOCATION);
+
+  pixelBufferJpeg = Dali::LoadImageFromBuffer(FileToMemory(IMAGE_WIDTH_EVEN_EXIF6_RGB));
+  DALI_TEST_CHECK(pixelBufferJpeg);
+  DALI_TEST_EQUALS(pixelBufferJpeg.GetWidth(), 50u, TEST_LOCATION);
+  DALI_TEST_EQUALS(pixelBufferJpeg.GetHeight(), 64u, TEST_LOCATION);
+  DALI_TEST_EQUALS(pixelBufferJpeg.GetPixelFormat(), Pixel::RGB888, TEST_LOCATION);
+  DALI_IMAGE_TEST_EQUALS(BufferJpeg1, pixelBufferJpeg, 8, TEST_LOCATION);
+
+  pixelBufferJpeg = Dali::LoadImageFromBuffer(FileToMemory(IMAGE_WIDTH_EVEN_EXIF7_RGB));
+  DALI_TEST_CHECK(pixelBufferJpeg);
+  DALI_TEST_EQUALS(pixelBufferJpeg.GetWidth(), 50u, TEST_LOCATION);
+  DALI_TEST_EQUALS(pixelBufferJpeg.GetHeight(), 64u, TEST_LOCATION);
+  DALI_TEST_EQUALS(pixelBufferJpeg.GetPixelFormat(), Pixel::RGB888, TEST_LOCATION);
+  DALI_IMAGE_TEST_EQUALS(BufferJpeg1, pixelBufferJpeg, 8, TEST_LOCATION);
+
+  pixelBufferJpeg = Dali::LoadImageFromBuffer(FileToMemory(IMAGE_WIDTH_EVEN_EXIF8_RGB));
+  DALI_TEST_CHECK(pixelBufferJpeg);
+  DALI_TEST_EQUALS(pixelBufferJpeg.GetWidth(), 50u, TEST_LOCATION);
+  DALI_TEST_EQUALS(pixelBufferJpeg.GetHeight(), 64u, TEST_LOCATION);
+  DALI_TEST_EQUALS(pixelBufferJpeg.GetPixelFormat(), Pixel::RGB888, TEST_LOCATION);
+  DALI_IMAGE_TEST_EQUALS(BufferJpeg1, pixelBufferJpeg, 8, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliLoadImageFromBufferN(void)
+{
+  Devel::PixelBuffer pixelBufferEmpty = Dali::LoadImageFromBuffer(Dali::Vector<uint8_t>());
+  DALI_TEST_CHECK(!pixelBufferEmpty);
+
+  Dali::Vector<uint8_t> strange;
+  strange.PushBack(0x11);
+  strange.PushBack(0x22);
+  strange.PushBack(0x33);
+  Devel::PixelBuffer pixelBufferStrange = Dali::LoadImageFromBuffer(strange);
+  DALI_TEST_CHECK(!pixelBufferStrange);
+
+  END_TEST;
+}
+
 int UtcDaliDownloadImageP(void)
 {
   std::string url("file://");
index 44bcac7..cfaaa12 100644 (file)
@@ -51,6 +51,30 @@ Devel::PixelBuffer LoadImageFromFile(const std::string& url, ImageDimensions siz
   return Dali::Devel::PixelBuffer();
 }
 
+Devel::PixelBuffer LoadImageFromBuffer(const Dali::Vector<uint8_t>& buffer, ImageDimensions size, FittingMode::Type fittingMode, SamplingMode::Type samplingMode, bool orientationCorrection)
+{
+  if(buffer.Empty())
+  {
+    DALI_LOG_ERROR("buffer is empty!\n");
+    return Dali::Devel::PixelBuffer();
+  }
+  Integration::BitmapResourceType resourceType(size, fittingMode, samplingMode, orientationCorrection);
+
+  Internal::Platform::FileReader fileReader(buffer);
+  FILE* const                    fp = fileReader.GetFile();
+  if(fp != NULL)
+  {
+    Dali::Devel::PixelBuffer bitmap;
+    // Make path as empty string. Path information just for file format hint.
+    bool                     success = TizenPlatform::ImageLoader::ConvertStreamToBitmap(resourceType, std::string(""), fp, bitmap);
+    if(success && bitmap)
+    {
+      return bitmap;
+    }
+  }
+  return Dali::Devel::PixelBuffer();
+}
+
 ImageDimensions GetClosestImageSize(const std::string& filename,
                                     ImageDimensions    size,
                                     FittingMode::Type  fittingMode,
index a66028d..c1f7ad8 100644 (file)
@@ -47,6 +47,26 @@ DALI_ADAPTOR_API Devel::PixelBuffer LoadImageFromFile(
   bool               orientationCorrection = true);
 
 /**
+ * @brief Load an image synchronously from encoded buffer.
+ *
+ * @note This method is thread safe, i.e. can be called from any thread.
+ *
+ * @param [in] buffer The encoded buffer of the image to load.
+ *                    The buffer is not owned by FileStream and must be valid for entire lifetime of FileStream
+ * @param [in] size The width and height to fit the loaded image to, 0.0 means whole image
+ * @param [in] fittingMode The method used to fit the shape of the image before loading to the shape defined by the size parameter.
+ * @param [in] samplingMode The filtering method used when sampling pixels from the input image while fitting it to desired size.
+ * @param [in] orientationCorrection Reorient the image to respect any orientation metadata in its header.
+ * @return handle to the loaded PixelBuffer object or an empty handle in case loading failed.
+ */
+DALI_ADAPTOR_API Devel::PixelBuffer LoadImageFromBuffer(
+  const Dali::Vector<uint8_t>& buffer,
+  ImageDimensions              size                  = ImageDimensions(0, 0),
+  FittingMode::Type            fittingMode           = FittingMode::DEFAULT,
+  SamplingMode::Type           samplingMode          = SamplingMode::BOX_THEN_LINEAR,
+  bool                         orientationCorrection = true);
+
+/**
  * @brief Determine the size of an image that LoadImageFromFile will provide when
  * given the same image loading parameters.
  *
index eed9437..ed4a81c 100644 (file)
@@ -691,7 +691,7 @@ Accessible* BridgeAccessible::GetParent()
   // if you want more, then you need to change setApplicationRoot to
   // add/remove ApplicationRoot and make roots a vector.
   auto p = FindSelf()->GetParent();
-  assert(p);
+
   return p;
 }
 DBus::ValueOrError<std::vector<Accessible*>> BridgeAccessible::GetChildren()
index 31e0713..a0843e6 100644 (file)
@@ -246,7 +246,7 @@ void Context::Flush(bool reset, const GLES::DrawCallDescriptor& drawCall)
   }
 
   // for each attribute bind vertices
-  const auto& pipelineState = mImpl->mNewPipeline->GetCreateInfo();
+  const auto& pipelineState = mImpl->mNewPipeline ? mImpl->mNewPipeline->GetCreateInfo() : mImpl->mCurrentPipeline->GetCreateInfo();
   const auto& vi            = pipelineState.vertexInputState;
   for(const auto& attr : vi->attributes)
   {
@@ -270,7 +270,7 @@ void Context::Flush(bool reset, const GLES::DrawCallDescriptor& drawCall)
   }
 
   // Resolve topology
-  const auto& ia = mImpl->mNewPipeline->GetCreateInfo().inputAssemblyState;
+  const auto& ia = pipelineState.inputAssemblyState;
 
   // Bind uniforms
 
index d909146..2a190b5 100644 (file)
@@ -115,12 +115,14 @@ bool Framebuffer::InitializeResource()
       auto depthTexture = static_cast<const GLES::Texture*>(mCreateInfo.depthStencilAttachment.depthTexture);
       auto attachmentId = DEPTH_STENCIL_ATTACHMENT_TYPE(depthTexture->GetCreateInfo().format).attachment;
 
+      AttachTexture(depthTexture, attachmentId, 0, mCreateInfo.depthStencilAttachment.depthLevel);
+    }
+    else if(mCreateInfo.depthStencilAttachment.depthUsage == Graphics::DepthStencilAttachment::Usage::WRITE)
+    {
       gl->GenRenderbuffers(1, &mDepthBufferId);
       gl->BindRenderbuffer(GL_RENDERBUFFER, mDepthBufferId);
       gl->RenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, mCreateInfo.size.width, mCreateInfo.size.height);
-      gl->FramebufferRenderbuffer(GL_FRAMEBUFFER, attachmentId, GL_RENDERBUFFER, mDepthBufferId);
-
-      AttachTexture(depthTexture, attachmentId, 0, mCreateInfo.depthStencilAttachment.depthLevel);
+      gl->FramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, mDepthBufferId);
     }
 
     if(mCreateInfo.depthStencilAttachment.stencilTexture)
@@ -128,13 +130,14 @@ bool Framebuffer::InitializeResource()
       auto stencilTexture = static_cast<const GLES::Texture*>(mCreateInfo.depthStencilAttachment.stencilTexture);
       auto attachmentId   = DEPTH_STENCIL_ATTACHMENT_TYPE(stencilTexture->GetCreateInfo().format).attachment;
 
-      // Create a stencil render target.
+      AttachTexture(stencilTexture, attachmentId, 0, mCreateInfo.depthStencilAttachment.stencilLevel);
+    }
+    else if(mCreateInfo.depthStencilAttachment.stencilUsage == Graphics::DepthStencilAttachment::Usage::WRITE)
+    {
       gl->GenRenderbuffers(1, &mStencilBufferId);
       gl->BindRenderbuffer(GL_RENDERBUFFER, mStencilBufferId);
       gl->RenderbufferStorage(GL_RENDERBUFFER, GL_STENCIL_INDEX8, mCreateInfo.size.width, mCreateInfo.size.height);
-      gl->FramebufferRenderbuffer(GL_FRAMEBUFFER, attachmentId, GL_RENDERBUFFER, mStencilBufferId);
-
-      AttachTexture(stencilTexture, attachmentId, 0, mCreateInfo.depthStencilAttachment.stencilLevel);
+      gl->FramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, mStencilBufferId);
     }
 
     context->BindFrameBuffer(GL_FRAMEBUFFER, 0);
index 031ad2d..b6c3b5d 100644 (file)
@@ -36,14 +36,18 @@ public:
   {
   }
 
-  FileReader(Dali::Vector<uint8_t>& vector)
-  : FileStream(&vector[0], vector.Size(), FileStream::READ | FileStream::BINARY)
+  FileReader(const Dali::Vector<uint8_t>& vector)
+  : FileStream(vector.Begin(), vector.Size(), FileStream::READ | FileStream::BINARY)
   {
   }
 
-  FileReader(Dali::Vector<uint8_t>& vector, size_t dataSize)
-  : FileStream(&vector[0], dataSize, FileStream::READ | FileStream::BINARY)
+  FileReader(const Dali::Vector<uint8_t>& vector, size_t dataSize)
+  : FileStream(vector.Begin(), dataSize, FileStream::READ | FileStream::BINARY)
   {
+    if(dataSize > vector.Size())
+    {
+      DALI_LOG_ERROR("dataSize(%u) is bigger than vector.Size(%u)!\n", static_cast<uint32_t>(dataSize), static_cast<uint32_t>(vector.Size()));
+    }
   }
 
   FileReader(uint8_t* data, size_t dataSize)
index b491bc7..d94dbe8 100644 (file)
@@ -74,6 +74,7 @@ GlWindow::GlWindow()
   mOpaqueState(false),
   mResizeEnabled(false),
   mVisible(false),
+  mIsWindowRotated(false),
   mIsTouched(false),
   mIsEGLInitialized(false),
   mDepth(false),
index 4fe0a30..b8227e0 100644 (file)
@@ -980,6 +980,22 @@ void WindowBaseEcoreWl2::OnRotation(void* data, int type, void* event)
     RotationEvent rotationEvent;
     rotationEvent.angle     = ev->angle;
     rotationEvent.winResize = 0;
+
+    if(ev->w == 0 || ev->h ==0)
+    {
+      // Use previous client side window's size.
+      if(mWindowRotationAngle == 90 || mWindowRotationAngle == 270)
+      {
+        ev->w = mWindowPositionSize.height;
+        ev->h = mWindowPositionSize.width;
+      }
+      else
+      {
+        ev->w = mWindowPositionSize.width;
+        ev->h = mWindowPositionSize.height;
+      }
+    }
+
     mWindowRotationAngle    = ev->angle;
 
     if(ev->angle == 0 || ev->angle == 180)
@@ -1940,7 +1956,7 @@ Dali::WindowOperationResult WindowBaseEcoreWl2::SetNotificationLevel(Dali::Windo
   if(!mNotificationLevelChangeDone)
   {
     DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetNotificationLevel: Level change is failed [%d, %d]\n", level, mNotificationChangeState);
-    Dali::WindowOperationResult::UNKNOWN_ERROR;
+    return Dali::WindowOperationResult::UNKNOWN_ERROR;
   }
   else if(mNotificationChangeState == TIZEN_POLICY_ERROR_STATE_PERMISSION_DENIED)
   {
index f69a6d1..4aa2e3e 100644 (file)
@@ -27,7 +27,7 @@ namespace Dali
 {
 const unsigned int ADAPTOR_MAJOR_VERSION = 2;
 const unsigned int ADAPTOR_MINOR_VERSION = 0;
-const unsigned int ADAPTOR_MICRO_VERSION = 29;
+const unsigned int ADAPTOR_MICRO_VERSION = 30;
 const char* const  ADAPTOR_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index bc5290c..73db4a5 100644 (file)
@@ -17,7 +17,7 @@
 
 Name:       dali2-adaptor
 Summary:    The DALi Tizen Adaptor
-Version:    2.0.29
+Version:    2.0.30
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-3-Clause and MIT