Merge branch 'devel/master' into tizen
authorJaehyun Cho <jae_hyun.cho@samsung.com>
Tue, 6 Sep 2022 07:21:55 +0000 (16:21 +0900)
committerJaehyun Cho <jae_hyun.cho@samsung.com>
Tue, 6 Sep 2022 07:21:55 +0000 (16:21 +0900)
Change-Id: I446abd93c26d3b3a5e43d28aeeea2c785036652f

automated-tests/src/dali-adaptor/dali-test-suite-utils/test-gl-abstraction.cpp
automated-tests/src/dali-adaptor/dali-test-suite-utils/test-gl-abstraction.h
automated-tests/src/dali-graphics/CMakeLists.txt
automated-tests/src/dali-graphics/utc-Dali-GraphicsFramebuffer.cpp [new file with mode: 0644]
dali/internal/graphics/gles-impl/gles-graphics-framebuffer.cpp
dali/internal/input/file.list
dali/internal/input/ubuntu-x11/input-method-context-impl-x.cpp
dali/internal/input/ubuntu-x11/virtual-keyboard-impl-x.cpp [deleted file]
dali/internal/window-system/common/window-render-surface.cpp
dali/public-api/dali-adaptor-version.cpp
packaging/dali-adaptor.spec

index e6416e3..7a31046 100644 (file)
@@ -46,28 +46,32 @@ TestGlAbstraction::~TestGlAbstraction()
 
 void TestGlAbstraction::Initialize()
 {
-  mCurrentProgram                  = 0;
-  mCompileStatus                   = GL_TRUE;
-  mLinkStatus                      = GL_TRUE;
-  mGetErrorResult                  = 0;
-  mGetStringResult                 = NULL;
-  mIsBufferResult                  = 0;
-  mIsEnabledResult                 = 0;
-  mIsFramebufferResult             = 0;
-  mIsProgramResult                 = 0;
-  mIsRenderbufferResult            = 0;
-  mIsShaderResult                  = 0;
-  mIsTextureResult                 = 0;
-  mActiveTextureUnit               = 0;
-  mCheckFramebufferStatusResult    = 0;
-  mFramebufferStatus               = 0;
-  mFramebufferDepthAttached        = 0;
-  mFramebufferStencilAttached      = 0;
-  mFramebufferColorAttachmentCount = 0;
-  mFrameBufferColorStatus          = 0;
-  mNumBinaryFormats                = 0;
-  mBinaryFormats                   = 0;
-  mProgramBinaryLength             = 0;
+  mCurrentProgram                         = 0;
+  mCompileStatus                          = GL_TRUE;
+  mLinkStatus                             = GL_TRUE;
+  mGetErrorResult                         = 0;
+  mGetStringResult                        = NULL;
+  mIsBufferResult                         = 0;
+  mIsEnabledResult                        = 0;
+  mIsFramebufferResult                    = 0;
+  mIsProgramResult                        = 0;
+  mIsRenderbufferResult                   = 0;
+  mIsShaderResult                         = 0;
+  mIsTextureResult                        = 0;
+  mActiveTextureUnit                      = 0;
+  mCheckFramebufferStatusResult           = 0;
+  mFramebufferStatus                      = 0;
+  mFramebufferDepthAttached               = 0;
+  mFramebufferStencilAttached             = 0;
+  mFramebufferDepthStencilAttached        = 0;
+  mFramebufferColorAttachmentCount        = 0;
+  mFrameBufferColorStatus                 = 0;
+  mFramebufferDepthAttachmentCount        = 0;
+  mFramebufferStencilAttachmentCount      = 0;
+  mFramebufferDepthStencilAttachmentCount = 0;
+  mNumBinaryFormats                       = 0;
+  mBinaryFormats                          = 0;
+  mProgramBinaryLength                    = 0;
 
   mVertexAttribArrayChanged = false;
   mGetProgramBinaryCalled   = false;
index a1f8405..f6878ae 100644 (file)
@@ -299,6 +299,21 @@ public:
     return mFramebufferColorAttachmentCount;
   }
 
+  inline GLuint CheckFramebufferDepthAttachmentCount()
+  {
+    return mFramebufferDepthAttachmentCount;
+  }
+
+  inline GLuint CheckFramebufferStencilAttachmentCount()
+  {
+    return mFramebufferStencilAttachmentCount;
+  }
+
+  inline GLuint CheckFramebufferDepthStencilAttachmentCount()
+  {
+    return mFramebufferDepthStencilAttachmentCount;
+  }
+
   inline GLenum CheckFramebufferDepthAttachment()
   {
     return mFramebufferDepthAttached;
@@ -309,6 +324,11 @@ public:
     return mFramebufferStencilAttached;
   }
 
+  inline GLenum CheckFramebufferDepthStencilAttachment()
+  {
+    return mFramebufferDepthStencilAttached;
+  }
+
   inline void Clear(GLbitfield mask) override
   {
     mClearCount++;
@@ -630,8 +650,9 @@ public:
     }
     else if(attachment == GL_DEPTH_STENCIL_ATTACHMENT)
     {
-      mFramebufferStencilAttached = true;
-      mFramebufferDepthAttached   = true;
+      mFramebufferStencilAttached      = true;
+      mFramebufferDepthAttached        = true;
+      mFramebufferDepthStencilAttached = true;
     }
   }
 
@@ -650,6 +671,20 @@ public:
         ++mFramebufferColorAttachmentCount;
       }
     }
+    else if(attachment == GL_DEPTH_ATTACHMENT)
+    {
+      ++mFramebufferDepthAttachmentCount;
+    }
+    else if(attachment == GL_STENCIL_ATTACHMENT)
+    {
+      ++mFramebufferStencilAttachmentCount;
+    }
+    else if(attachment == GL_DEPTH_STENCIL_ATTACHMENT)
+    {
+      ++mFramebufferDepthAttachmentCount;
+      ++mFramebufferStencilAttachmentCount;
+      ++mFramebufferDepthStencilAttachmentCount;
+    }
   }
 
   inline void FrontFace(GLenum mode) override
@@ -2491,8 +2526,12 @@ public:
   GLint                                 mFramebufferStatus;
   GLenum                                mFramebufferDepthAttached;
   GLenum                                mFramebufferStencilAttached;
+  GLenum                                mFramebufferDepthStencilAttached;
   GLuint                                mFramebufferColorAttachmentCount;
   GLuint                                mFrameBufferColorStatus;
+  GLuint                                mFramebufferDepthAttachmentCount;
+  GLuint                                mFramebufferStencilAttachmentCount;
+  GLuint                                mFramebufferDepthStencilAttachmentCount;
   GLint                                 mNumBinaryFormats;
   GLint                                 mBinaryFormats;
   GLint                                 mProgramBinaryLength;
index 639ee31..8a6364e 100644 (file)
@@ -5,10 +5,11 @@ SET(RPM_NAME "core-${PKG_NAME}-tests")
 
 SET(CAPI_LIB "dali-graphics")
 SET(TC_SOURCES
-    utc-Dali-GraphicsSampler.cpp
+    utc-Dali-GraphicsFramebuffer.cpp
     utc-Dali-GraphicsGeometry.cpp
-    utc-Dali-GraphicsProgram.cpp
     utc-Dali-GraphicsNativeImage.cpp
+    utc-Dali-GraphicsProgram.cpp
+    utc-Dali-GraphicsSampler.cpp
 )
 
 LIST(APPEND TC_SOURCES
diff --git a/automated-tests/src/dali-graphics/utc-Dali-GraphicsFramebuffer.cpp b/automated-tests/src/dali-graphics/utc-Dali-GraphicsFramebuffer.cpp
new file mode 100644 (file)
index 0000000..4ba7f19
--- /dev/null
@@ -0,0 +1,301 @@
+/*
+ * Copyright (c) 2022 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <dali-test-suite-utils.h>
+#include <dali/dali.h>
+
+#include <dali/internal/graphics/gles-impl/egl-graphics-controller.h>
+#include <test-actor-utils.h>
+#include <test-graphics-application.h>
+#include <test-graphics-framebuffer.h>
+
+using namespace Dali;
+
+namespace
+{
+RenderTask CreateRenderTask(TestGraphicsApplication& application,
+                            FrameBuffer              framebuffer)
+{
+  Actor rootActor = Actor::New();
+  application.GetScene().Add(rootActor);
+  Texture img         = CreateTexture(TextureType::TEXTURE_2D, Pixel::RGBA8888, 1, 1);
+  Actor   sourceActor = CreateRenderableActor(img);
+  application.GetScene().Add(sourceActor);
+
+  CameraActor offscreenCameraActor = CameraActor::New(Size(TestApplication::DEFAULT_SURFACE_WIDTH,
+                                                           TestApplication::DEFAULT_SURFACE_HEIGHT));
+  application.GetScene().Add(offscreenCameraActor);
+
+  // Change main render task to use a different root
+  RenderTaskList taskList = application.GetScene().GetRenderTaskList();
+  taskList.GetTask(0u).SetSourceActor(rootActor);
+
+  RenderTask newTask = taskList.CreateTask();
+  newTask.SetCameraActor(offscreenCameraActor);
+  newTask.SetSourceActor(sourceActor);
+  newTask.SetInputEnabled(false);
+  newTask.SetClearColor(Vector4(0.f, 0.f, 0.f, 0.f));
+  newTask.SetClearEnabled(true);
+  newTask.SetExclusive(true);
+  newTask.SetFrameBuffer(framebuffer);
+
+  return newTask;
+}
+} // namespace
+
+void utc_dali_graphics_framebuffer_startup(void)
+{
+  test_return_value = TET_UNDEF;
+}
+void utc_dali_graphics_framebuffer_cleanup(void)
+{
+  test_return_value = TET_PASS;
+}
+
+int UtcDaliGraphicsFramebufferAttachDepth(void)
+{
+  TestGraphicsApplication app;
+  tet_infoline("UtcDaliGraphicsFramebufferAttachDepth - Test for GLES specific behavior");
+
+  auto& gl = app.GetGlAbstraction();
+
+  uint32_t width  = 16u;
+  uint32_t height = 24u;
+
+  FrameBuffer framebuffer = FrameBuffer::New(width, height, FrameBuffer::Attachment::DEPTH);
+
+  DALI_TEST_CHECK(framebuffer);
+
+  Texture dummyColorTexture = CreateTexture(TextureType::TEXTURE_2D, Pixel::RGBA8888, width, height);
+  Actor   dummyActor        = CreateRenderableActor(dummyColorTexture);
+  framebuffer.AttachColorTexture(dummyColorTexture);
+
+  app.GetScene().Add(dummyActor);
+
+  auto renderTask = CreateRenderTask(app, framebuffer);
+
+  DALI_TEST_CHECK(renderTask);
+
+  app.SendNotification();
+  app.Render(16); // The above actor will get rendered and drawn once.
+
+  DALI_TEST_EQUALS(gl.CheckFramebufferColorAttachmentCount(), 1u, TEST_LOCATION);
+  DALI_TEST_EQUALS(gl.CheckFramebufferDepthAttachmentCount(), 0u, TEST_LOCATION);
+  DALI_TEST_EQUALS(gl.CheckFramebufferStencilAttachmentCount(), 0u, TEST_LOCATION);
+  DALI_TEST_EQUALS(gl.CheckFramebufferDepthStencilAttachmentCount(), 0u, TEST_LOCATION);
+  DALI_TEST_EQUALS(gl.CheckFramebufferDepthAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
+  DALI_TEST_EQUALS(gl.CheckFramebufferStencilAttachment(), (GLenum)GL_FALSE, TEST_LOCATION);
+  DALI_TEST_EQUALS(gl.CheckFramebufferDepthStencilAttachment(), (GLenum)GL_FALSE, TEST_LOCATION); // Check whether renderbuffer attached by DEPTH_STENCIL.
+
+  END_TEST;
+}
+
+int UtcDaliGraphicsFramebufferAttachStencil(void)
+{
+  TestGraphicsApplication app;
+  tet_infoline("UtcDaliGraphicsFramebufferAttachStencil - Test for GLES specific behavior");
+
+  auto& gl = app.GetGlAbstraction();
+
+  uint32_t width  = 16u;
+  uint32_t height = 24u;
+
+  FrameBuffer framebuffer = FrameBuffer::New(width, height, FrameBuffer::Attachment::STENCIL);
+
+  DALI_TEST_CHECK(framebuffer);
+
+  Texture dummyColorTexture = CreateTexture(TextureType::TEXTURE_2D, Pixel::RGBA8888, width, height);
+  Actor   dummyActor        = CreateRenderableActor(dummyColorTexture);
+  framebuffer.AttachColorTexture(dummyColorTexture);
+
+  app.GetScene().Add(dummyActor);
+
+  auto renderTask = CreateRenderTask(app, framebuffer);
+
+  DALI_TEST_CHECK(renderTask);
+
+  app.SendNotification();
+  app.Render(16); // The above actor will get rendered and drawn once.
+
+  DALI_TEST_EQUALS(gl.CheckFramebufferColorAttachmentCount(), 1u, TEST_LOCATION);
+  DALI_TEST_EQUALS(gl.CheckFramebufferDepthAttachmentCount(), 0u, TEST_LOCATION);
+  DALI_TEST_EQUALS(gl.CheckFramebufferStencilAttachmentCount(), 0u, TEST_LOCATION);
+  DALI_TEST_EQUALS(gl.CheckFramebufferDepthStencilAttachmentCount(), 0u, TEST_LOCATION);
+  DALI_TEST_EQUALS(gl.CheckFramebufferDepthAttachment(), (GLenum)GL_FALSE, TEST_LOCATION);
+  DALI_TEST_EQUALS(gl.CheckFramebufferStencilAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
+  DALI_TEST_EQUALS(gl.CheckFramebufferDepthStencilAttachment(), (GLenum)GL_FALSE, TEST_LOCATION); // Check whether renderbuffer attached by DEPTH_STENCIL.
+
+  END_TEST;
+}
+
+int UtcDaliGraphicsFramebufferAttachDepthStencil(void)
+{
+  TestGraphicsApplication app;
+  tet_infoline("UtcDaliGraphicsFramebufferAttachDepthStencil - Test for GLES specific behavior");
+
+  auto& gl = app.GetGlAbstraction();
+
+  uint32_t width  = 16u;
+  uint32_t height = 24u;
+
+  FrameBuffer framebuffer = FrameBuffer::New(width, height, FrameBuffer::Attachment::DEPTH_STENCIL);
+
+  DALI_TEST_CHECK(framebuffer);
+
+  Texture dummyColorTexture = CreateTexture(TextureType::TEXTURE_2D, Pixel::RGBA8888, width, height);
+  Actor   dummyActor        = CreateRenderableActor(dummyColorTexture);
+  framebuffer.AttachColorTexture(dummyColorTexture);
+
+  app.GetScene().Add(dummyActor);
+
+  auto renderTask = CreateRenderTask(app, framebuffer);
+
+  DALI_TEST_CHECK(renderTask);
+
+  app.SendNotification();
+  app.Render(16); // The above actor will get rendered and drawn once.
+
+  DALI_TEST_EQUALS(gl.CheckFramebufferColorAttachmentCount(), 1u, TEST_LOCATION);
+  DALI_TEST_EQUALS(gl.CheckFramebufferDepthAttachmentCount(), 0u, TEST_LOCATION);
+  DALI_TEST_EQUALS(gl.CheckFramebufferStencilAttachmentCount(), 0u, TEST_LOCATION);
+  DALI_TEST_EQUALS(gl.CheckFramebufferDepthStencilAttachmentCount(), 0u, TEST_LOCATION);
+  DALI_TEST_EQUALS(gl.CheckFramebufferDepthAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
+  DALI_TEST_EQUALS(gl.CheckFramebufferStencilAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
+  DALI_TEST_EQUALS(gl.CheckFramebufferDepthStencilAttachment(), (GLenum)GL_TRUE, TEST_LOCATION); // Check whether renderbuffer attached by DEPTH_STENCIL.
+
+  END_TEST;
+}
+
+int UtcDaliGraphicsFramebufferAttachDepthTexture(void)
+{
+  TestGraphicsApplication app;
+  tet_infoline("UtcDaliGraphicsFramebufferAttachDepthTexture - Test for GLES specific behavior");
+
+  auto& gl = app.GetGlAbstraction();
+
+  uint32_t width  = 16u;
+  uint32_t height = 24u;
+
+  FrameBuffer framebuffer = FrameBuffer::New(width, height, FrameBuffer::Attachment::NONE);
+
+  DALI_TEST_CHECK(framebuffer);
+
+  Texture dummyColorTexture = CreateTexture(TextureType::TEXTURE_2D, Pixel::RGBA8888, width, height);
+  Texture dummyDepthTexture = CreateTexture(TextureType::TEXTURE_2D, Pixel::DEPTH_UNSIGNED_INT, width, height);
+  Actor   dummyActor        = CreateRenderableActor(dummyColorTexture);
+  framebuffer.AttachColorTexture(dummyColorTexture);
+  DevelFrameBuffer::AttachDepthTexture(framebuffer, dummyDepthTexture);
+
+  app.GetScene().Add(dummyActor);
+
+  auto renderTask = CreateRenderTask(app, framebuffer);
+
+  DALI_TEST_CHECK(renderTask);
+
+  app.SendNotification();
+  app.Render(16); // The above actor will get rendered and drawn once.
+
+  DALI_TEST_EQUALS(gl.CheckFramebufferColorAttachmentCount(), 1u, TEST_LOCATION);
+  DALI_TEST_EQUALS(gl.CheckFramebufferDepthAttachmentCount(), 1u, TEST_LOCATION);
+  DALI_TEST_EQUALS(gl.CheckFramebufferStencilAttachmentCount(), 0u, TEST_LOCATION);
+  DALI_TEST_EQUALS(gl.CheckFramebufferDepthStencilAttachmentCount(), 0u, TEST_LOCATION);
+  DALI_TEST_EQUALS(gl.CheckFramebufferDepthAttachment(), (GLenum)GL_FALSE, TEST_LOCATION);
+  DALI_TEST_EQUALS(gl.CheckFramebufferStencilAttachment(), (GLenum)GL_FALSE, TEST_LOCATION);
+  DALI_TEST_EQUALS(gl.CheckFramebufferDepthStencilAttachment(), (GLenum)GL_FALSE, TEST_LOCATION); // Check whether renderbuffer attached by DEPTH_STENCIL.
+
+  END_TEST;
+}
+
+int UtcDaliGraphicsFramebufferAttachDepthStencilTexture(void)
+{
+  TestGraphicsApplication app;
+  tet_infoline("UtcDaliGraphicsFramebufferAttachDepthStencilTexture - Test for GLES specific behavior");
+
+  auto& gl = app.GetGlAbstraction();
+
+  uint32_t width  = 16u;
+  uint32_t height = 24u;
+
+  FrameBuffer framebuffer = FrameBuffer::New(width, height, FrameBuffer::Attachment::STENCIL);
+
+  DALI_TEST_CHECK(framebuffer);
+
+  Texture dummyColorTexture        = CreateTexture(TextureType::TEXTURE_2D, Pixel::RGBA8888, width, height);
+  Texture dummyDepthStencilTexture = CreateTexture(TextureType::TEXTURE_2D, Pixel::DEPTH_STENCIL, width, height);
+  Actor   dummyActor               = CreateRenderableActor(dummyColorTexture);
+  framebuffer.AttachColorTexture(dummyColorTexture);
+  DevelFrameBuffer::AttachDepthStencilTexture(framebuffer, dummyDepthStencilTexture);
+
+  app.GetScene().Add(dummyActor);
+
+  auto renderTask = CreateRenderTask(app, framebuffer);
+
+  DALI_TEST_CHECK(renderTask);
+
+  app.SendNotification();
+  app.Render(16); // The above actor will get rendered and drawn once.
+
+  DALI_TEST_EQUALS(gl.CheckFramebufferColorAttachmentCount(), 1u, TEST_LOCATION);
+  DALI_TEST_EQUALS(gl.CheckFramebufferDepthAttachmentCount(), 1u, TEST_LOCATION);
+  DALI_TEST_EQUALS(gl.CheckFramebufferStencilAttachmentCount(), 1u, TEST_LOCATION);
+  DALI_TEST_EQUALS(gl.CheckFramebufferDepthStencilAttachmentCount(), 1u, TEST_LOCATION);
+  DALI_TEST_EQUALS(gl.CheckFramebufferDepthAttachment(), (GLenum)GL_FALSE, TEST_LOCATION);
+  DALI_TEST_EQUALS(gl.CheckFramebufferStencilAttachment(), (GLenum)GL_FALSE, TEST_LOCATION);
+  DALI_TEST_EQUALS(gl.CheckFramebufferDepthStencilAttachment(), (GLenum)GL_FALSE, TEST_LOCATION); // Check whether renderbuffer attached by DEPTH_STENCIL.
+
+  END_TEST;
+}
+
+int UtcDaliGraphicsFramebufferAttachStencilAndDepthTexture(void)
+{
+  TestGraphicsApplication app;
+  tet_infoline("UtcDaliGraphicsFramebufferAttachStencilAndDepthTexture - Test for GLES specific behavior");
+
+  auto& gl = app.GetGlAbstraction();
+
+  uint32_t width  = 16u;
+  uint32_t height = 24u;
+
+  FrameBuffer framebuffer = FrameBuffer::New(width, height, FrameBuffer::Attachment::STENCIL);
+
+  DALI_TEST_CHECK(framebuffer);
+
+  Texture dummyColorTexture = CreateTexture(TextureType::TEXTURE_2D, Pixel::RGBA8888, width, height);
+  // Note : Current GLES cannot seperate destination of depth result and stencil result. We need to make the texture as DEPTH_STENCIL
+  Texture dummyDepthTexture = CreateTexture(TextureType::TEXTURE_2D, Pixel::DEPTH_STENCIL, width, height);
+  Actor   dummyActor        = CreateRenderableActor(dummyColorTexture);
+  framebuffer.AttachColorTexture(dummyColorTexture);
+  DevelFrameBuffer::AttachDepthTexture(framebuffer, dummyDepthTexture);
+
+  app.GetScene().Add(dummyActor);
+
+  auto renderTask = CreateRenderTask(app, framebuffer);
+
+  DALI_TEST_CHECK(renderTask);
+
+  app.SendNotification();
+  app.Render(16); // The above actor will get rendered and drawn once.
+
+  DALI_TEST_EQUALS(gl.CheckFramebufferColorAttachmentCount(), 1u, TEST_LOCATION);
+  DALI_TEST_EQUALS(gl.CheckFramebufferDepthAttachmentCount(), 1u, TEST_LOCATION);
+  DALI_TEST_EQUALS(gl.CheckFramebufferStencilAttachmentCount(), 1u, TEST_LOCATION);
+  DALI_TEST_EQUALS(gl.CheckFramebufferDepthStencilAttachmentCount(), 1u, TEST_LOCATION);
+  DALI_TEST_EQUALS(gl.CheckFramebufferDepthAttachment(), (GLenum)GL_FALSE, TEST_LOCATION);
+  DALI_TEST_EQUALS(gl.CheckFramebufferStencilAttachment(), (GLenum)GL_FALSE, TEST_LOCATION);
+  DALI_TEST_EQUALS(gl.CheckFramebufferDepthStencilAttachment(), (GLenum)GL_FALSE, TEST_LOCATION); // Check whether renderbuffer attached by DEPTH_STENCIL.
+
+  END_TEST;
+}
\ No newline at end of file
index 2a190b5..f5f750b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -109,31 +109,54 @@ bool Framebuffer::InitializeResource()
     // @todo is this per framebuffer, or more immediate state that needs setting when framebuffer changed?
     context->DrawBuffers(mCreateInfo.colorAttachments.size(), COLOR_ATTACHMENTS);
 
-    if(mCreateInfo.depthStencilAttachment.depthTexture)
+    // @todo Currently, we don't assume that GL_EXT_PACKED_DEPTH_STENCIL valid.
+    // We will assume that stencilTexture / stencilBufferId always mean depth-stencil.
+    if(mCreateInfo.depthStencilAttachment.stencilTexture)
     {
-      // Create a depth or depth/stencil render target.
+      // bind depth 24 bits + stencil 8 bits texture, or 8 tencil texture.
+      auto stencilTexture = static_cast<const GLES::Texture*>(mCreateInfo.depthStencilAttachment.stencilTexture);
+      auto attachmentId   = DEPTH_STENCIL_ATTACHMENT_TYPE(stencilTexture->GetCreateInfo().format).attachment;
+
+      if(attachmentId != GL_DEPTH_STENCIL_ATTACHMENT)
+      {
+        DALI_LOG_ERROR("Current Depth/Stencil Texture Type doesn't support. Please check depth/stencil texture's pixel format");
+      }
+
+      AttachTexture(stencilTexture, attachmentId, 0, mCreateInfo.depthStencilAttachment.stencilLevel);
+    }
+    else if(mCreateInfo.depthStencilAttachment.depthTexture)
+    {
+      // bind depth texture.
       auto depthTexture = static_cast<const GLES::Texture*>(mCreateInfo.depthStencilAttachment.depthTexture);
       auto attachmentId = DEPTH_STENCIL_ATTACHMENT_TYPE(depthTexture->GetCreateInfo().format).attachment;
 
+      if(attachmentId != GL_DEPTH_STENCIL_ATTACHMENT && mCreateInfo.depthStencilAttachment.stencilUsage == Graphics::DepthStencilAttachment::Usage::WRITE)
+      {
+        DALI_LOG_ERROR("Current Depth Texture Type doesn't support to store Stencil. Please check depth texture's pixel format");
+      }
+
       AttachTexture(depthTexture, attachmentId, 0, mCreateInfo.depthStencilAttachment.depthLevel);
     }
+    else if(mCreateInfo.depthStencilAttachment.depthUsage == Graphics::DepthStencilAttachment::Usage::WRITE &&
+            mCreateInfo.depthStencilAttachment.stencilUsage == Graphics::DepthStencilAttachment::Usage::WRITE)
+    {
+      // Create depth+stencil renderbuffer
+      gl->GenRenderbuffers(1, &mStencilBufferId);
+      gl->BindRenderbuffer(GL_RENDERBUFFER, mStencilBufferId);
+      gl->RenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH24_STENCIL8, mCreateInfo.size.width, mCreateInfo.size.height);
+      gl->FramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER, mStencilBufferId);
+    }
     else if(mCreateInfo.depthStencilAttachment.depthUsage == Graphics::DepthStencilAttachment::Usage::WRITE)
     {
+      // Create depth renderbuffer
       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, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, mDepthBufferId);
     }
-
-    if(mCreateInfo.depthStencilAttachment.stencilTexture)
-    {
-      auto stencilTexture = static_cast<const GLES::Texture*>(mCreateInfo.depthStencilAttachment.stencilTexture);
-      auto attachmentId   = DEPTH_STENCIL_ATTACHMENT_TYPE(stencilTexture->GetCreateInfo().format).attachment;
-
-      AttachTexture(stencilTexture, attachmentId, 0, mCreateInfo.depthStencilAttachment.stencilLevel);
-    }
     else if(mCreateInfo.depthStencilAttachment.stencilUsage == Graphics::DepthStencilAttachment::Usage::WRITE)
     {
+      // Create stencil renderbuffer
       gl->GenRenderbuffers(1, &mStencilBufferId);
       gl->BindRenderbuffer(GL_RENDERBUFFER, mStencilBufferId);
       gl->RenderbufferStorage(GL_RENDERBUFFER, GL_STENCIL_INDEX8, mCreateInfo.size.width, mCreateInfo.size.height);
index 89f9b93..404abb0 100644 (file)
@@ -19,11 +19,10 @@ SET( adaptor_input_tizen_wayland_src_files
 
 # module: input, backend: ubuntu-x11
 SET( adaptor_input_ubuntu_x11_src_files
-    ${adaptor_input_dir}/tizen-wayland/ecore-virtual-keyboard.cpp
     ${adaptor_input_dir}/ubuntu-x11/input-method-context-factory-x.cpp
     ${adaptor_input_dir}/ubuntu-x11/input-method-context-impl-x.cpp
     ${adaptor_input_dir}/ubuntu-x11/key-mapping-x.cpp
-    ${adaptor_input_dir}/ubuntu-x11/virtual-keyboard-impl-x.cpp
+    ${adaptor_input_dir}/generic/virtual-keyboard-impl-generic.cpp
 )
 
 # module: input, backend: libuv-x11
index baa721e..3f8abe0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -30,7 +30,6 @@
 #include <dali/internal/input/common/key-impl.h>
 #include <dali/internal/input/common/virtual-keyboard-impl.h>
 #include <dali/internal/input/linux/dali-ecore-imf.h>
-#include <dali/internal/input/tizen-wayland/ecore-virtual-keyboard.h>
 #include <dali/internal/input/ubuntu-x11/dali-ecore-input.h>
 #include <dali/internal/system/common/locale-utils.h>
 #include <dali/internal/system/linux/dali-ecore.h>
@@ -143,7 +142,6 @@ InputMethodContextPtr InputMethodContextX::New(Dali::Actor actor)
 void InputMethodContextX::Finalize()
 {
   DALI_LOG_INFO(gLogFilter, Debug::General, "InputMethodContextX::Finalize\n");
-  VirtualKeyboard::DisconnectCallbacks(mIMFContext);
   DisconnectCallbacks();
   DeleteContext();
 }
@@ -171,7 +169,6 @@ void InputMethodContextX::Initialize()
 {
   CreateContext();
   ConnectCallbacks();
-  VirtualKeyboard::ConnectCallbacks(mIMFContext);
 }
 
 void InputMethodContextX::CreateContext()
diff --git a/dali/internal/input/ubuntu-x11/virtual-keyboard-impl-x.cpp b/dali/internal/input/ubuntu-x11/virtual-keyboard-impl-x.cpp
deleted file mode 100644 (file)
index 1e01853..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Copyright (c) 2021 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// CLASS HEADER
-#include <dali/internal/input/common/virtual-keyboard-impl.h>
-
-// EXTERNAL INCLUDES
-#include <X11/Xlib.h>
-#include <dali/integration-api/debug.h>
-#include <algorithm>
-
-// INTERNAL INCLUDES
-#include <dali/integration-api/adaptor-framework/adaptor.h>
-#include <dali/internal/input/ubuntu-x11/input-method-context-impl-x.h>
-#include <dali/internal/system/common/locale-utils.h>
-#include <dali/internal/system/linux/dali-ecore-x.h>
-
-namespace Dali
-{
-namespace Internal
-{
-namespace Adaptor
-{
-namespace VirtualKeyboard
-{
-Dali::InputMethod::ButtonAction::Type gButtonActionFunction = Dali::InputMethod::ButtonAction::DEFAULT;
-
-Ecore_IMF_Input_Panel_Return_Key_Type buttonActionMapping(Dali::InputMethod::ButtonAction::Type buttonAction)
-{
-  switch(buttonAction)
-  {
-    case InputMethod::ButtonAction::DEFAULT:
-      return ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT;
-    case InputMethod::ButtonAction::DONE:
-      return ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DONE;
-    case InputMethod::ButtonAction::GO:
-      return ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_GO;
-    case InputMethod::ButtonAction::JOIN:
-      return ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_JOIN;
-    case InputMethod::ButtonAction::LOGIN:
-      return ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_LOGIN;
-    case InputMethod::ButtonAction::NEXT:
-      return ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_NEXT;
-    case InputMethod::ButtonAction::SEARCH:
-      return ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_SEARCH;
-    case InputMethod::ButtonAction::SEND:
-      return ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_SEND;
-    case InputMethod::ButtonAction::SIGNIN:
-      return ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_SIGNIN;
-    default:
-      return ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT;
-  }
-}
-
-void RotateTo(int angle)
-{
-  // Get focus window used by Keyboard and rotate it
-  Display* display = XOpenDisplay(0);
-  if(display)
-  {
-    ::Window focusWindow;
-    int      revert;
-    // Get Focus window
-    XGetInputFocus(display, &focusWindow, &revert);
-
-    ecore_x_window_prop_property_set(static_cast<Ecore_X_Window>(focusWindow),
-                                     ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE,
-                                     ECORE_X_ATOM_CARDINAL,
-                                     32,
-                                     &angle,
-                                     1);
-    XCloseDisplay(display);
-  }
-}
-
-void SetReturnKeyType(const InputMethod::ButtonAction::Type type)
-{
-}
-
-Dali::InputMethod::ButtonAction::Type GetReturnKeyType()
-{
-  return gButtonActionFunction;
-}
-
-} // namespace VirtualKeyboard
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
index 22ac0f3..8dd26e9 100644 (file)
@@ -636,12 +636,6 @@ bool WindowRenderSurface::PreRender(bool resizingSurface, const std::vector<Rect
     {
       mDamagedRects.assign(1, surfaceRect);
     }
-    else if(mDamagedRects.empty() && !clippingRect.IsEmpty())
-    {
-      // We will render clippingRect area but mDamagedRects is empty.
-      // So make mDamagedRects same with clippingRect to swap buffers.
-      mDamagedRects.assign(1, clippingRect);
-    }
   }
 
   // This is now done when the render pass for the render surface begins
@@ -887,6 +881,13 @@ void WindowRenderSurface::SetBufferDamagedRects(const std::vector<Rect<int>>& da
       return;
     }
 
+    if(damagedRects.empty())
+    {
+      // Empty damaged rect. We don't need rendering
+      clippingRect = Rect<int>();
+      return;
+    }
+
     mGraphics->ActivateSurfaceContext(this);
 
     EGLint bufferAge = eglImpl.GetBufferAge(mEGLSurface);
index 6feb1cf..d4008e9 100644 (file)
@@ -27,7 +27,7 @@ namespace Dali
 {
 const unsigned int ADAPTOR_MAJOR_VERSION = 2;
 const unsigned int ADAPTOR_MINOR_VERSION = 1;
-const unsigned int ADAPTOR_MICRO_VERSION = 37;
+const unsigned int ADAPTOR_MICRO_VERSION = 38;
 const char* const  ADAPTOR_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index be10a96..8f266b9 100644 (file)
@@ -17,7 +17,7 @@
 
 Name:       dali2-adaptor
 Summary:    The DALi Tizen Adaptor
-Version:    2.1.37
+Version:    2.1.38
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-3-Clause and MIT