[dali_1.4.55] Merge branch 'devel/master' 96/223196/1
authorVictor Cebollada <v.cebollada@samsung.com>
Fri, 24 Jan 2020 13:50:01 +0000 (13:50 +0000)
committerVictor Cebollada <v.cebollada@samsung.com>
Fri, 24 Jan 2020 13:50:01 +0000 (13:50 +0000)
Change-Id: I15fe97a64d7de5cf988b14685404b288d932151b

53 files changed:
README.md
automated-tests/src/dali/dali-test-suite-utils/test-gl-abstraction.cpp
automated-tests/src/dali/dali-test-suite-utils/test-gl-abstraction.h
automated-tests/src/dali/utc-Dali-FrameBuffer.cpp
automated-tests/src/dali/utc-Dali-FrameBufferImage.cpp
automated-tests/src/dali/utc-Dali-LongPressGestureDetector.cpp
automated-tests/src/dali/utc-Dali-RenderTask.cpp
automated-tests/src/dali/utc-Dali-Scene.cpp
build/tizen/CMakeLists.txt
dali/devel-api/events/long-press-gesture-detector-devel.cpp [new file with mode: 0644]
dali/devel-api/events/long-press-gesture-detector-devel.h [new file with mode: 0644]
dali/devel-api/file.list
dali/devel-api/rendering/frame-buffer-devel.cpp [new file with mode: 0644]
dali/devel-api/rendering/frame-buffer-devel.h [new file with mode: 0644]
dali/integration-api/core-enumerations.h
dali/integration-api/debug.cpp
dali/integration-api/debug.h
dali/integration-api/file.list
dali/integration-api/input-options.cpp
dali/integration-api/input-options.h
dali/integration-api/trace.h
dali/internal/event/actors/actor-impl.cpp
dali/internal/event/common/demangler-unix.cpp [moved from dali/internal/event/common/demangler.cpp with 60% similarity]
dali/internal/event/common/demangler-windows.cpp [new file with mode: 0644]
dali/internal/event/common/demangler.h
dali/internal/event/common/scene-impl.cpp
dali/internal/event/common/type-registry-impl.cpp
dali/internal/event/events/gesture-event-processor.cpp
dali/internal/event/events/gesture-event-processor.h
dali/internal/event/events/long-press-gesture/long-press-gesture-detector-impl.cpp
dali/internal/event/events/long-press-gesture/long-press-gesture-detector-impl.h
dali/internal/event/events/long-press-gesture/long-press-gesture-processor.cpp
dali/internal/event/events/long-press-gesture/long-press-gesture-processor.h
dali/internal/event/events/long-press-gesture/long-press-gesture-recognizer.cpp
dali/internal/event/events/long-press-gesture/long-press-gesture-recognizer.h
dali/internal/event/rendering/frame-buffer-impl.cpp
dali/internal/event/rendering/frame-buffer-impl.h
dali/internal/file-unix.list [new file with mode: 0644]
dali/internal/file-windows.list [new file with mode: 0644]
dali/internal/file.list
dali/internal/render/common/render-manager.cpp
dali/internal/render/common/render-manager.h
dali/internal/render/renderers/render-surface-frame-buffer.cpp
dali/internal/render/renderers/render-surface-frame-buffer.h
dali/internal/render/renderers/render-texture-frame-buffer.cpp
dali/internal/render/renderers/render-texture-frame-buffer.h
dali/internal/update/manager/update-manager.cpp
dali/internal/update/manager/update-manager.h
dali/public-api/common/dali-common.h
dali/public-api/dali-core-version.cpp
dali/public-api/rendering/frame-buffer.cpp
dali/public-api/rendering/frame-buffer.h
packaging/dali.spec

index 17972bc..b78598d 100644 (file)
--- a/README.md
+++ b/README.md
@@ -13,6 +13,7 @@
          * [NON-SMACK Targets](#non-smack-targets)
          * [SMACK enabled Targets](#smack-enabled-targets)
          * [DEBUG Builds](#debug-builds)
+      * [3. Building for MS Windows](#3-building-for-ms-windows)
 
 # Build Instructions
 
@@ -91,3 +92,13 @@ See the README.md in dali-core/automated-tests.
 
          $ gbs build -A [TARGET_ARCH] --define "%enable_debug 1"
 
+## 3. Building for MS Windows
+
+Third party dependencies are built using vcpkg. Instructions on how to install vcpkg can be found in the
+vcpkg-script folder in the windows-dependencies repository.
+
+- Download the windows-dependencies repository from DaliHub
+
+         $ git clone https://github.com/dalihub/windows-dependencies.git
+
+- Read the README.md and vcpkg-script/Readme.md files for more instructions on how to install and build the third-party dependencies.
\ No newline at end of file
index 8372e03..98a2fa5 100644 (file)
@@ -46,9 +46,10 @@ void TestGlAbstraction::Initialize()
   mActiveTextureUnit = 0;
   mCheckFramebufferStatusResult = 0;
   mFramebufferStatus = 0;
-  mFramebufferColorAttached = 0;
   mFramebufferDepthAttached = 0;
   mFramebufferStencilAttached = 0;
+  mFramebufferColorAttachmentCount = 0;
+  mFrameBufferColorStatus = 0;
   mNumBinaryFormats = 0;
   mBinaryFormats = 0;
   mProgramBinaryLength = 0;
@@ -58,6 +59,7 @@ void TestGlAbstraction::Initialize()
 
   mLastShaderCompiled = 0;
   mLastClearBitMask = 0;
+  mLastClearColor = Color::TRANSPARENT;
   mClearCount = 0;
 
   mLastBlendEquationRgb   = 0;
@@ -131,3 +133,4 @@ bool BlendDisabled(const Dali::TraceCallStack& callStack)
   bool blendEnabled = callStack.FindMethodAndParams( "Disable", out.str() );
   return blendEnabled;
 }
+
index 3fae461..9f458fc 100644 (file)
@@ -2,7 +2,7 @@
 #define TEST_GL_ABSTRACTION_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
@@ -29,6 +29,7 @@
 
 // INTERNAL INCLUDES
 #include <dali/public-api/dali-core.h>
+#include <dali/devel-api/rendering/frame-buffer-devel.h>
 #include <dali/integration-api/core.h>
 #include <dali/integration-api/gl-abstraction.h>
 #include <dali/integration-api/gl-defines.h>
@@ -252,9 +253,9 @@ public:
     return mCheckFramebufferStatusResult;
   }
 
-  inline GLenum CheckFramebufferColorAttachment()
+  inline GLuint CheckFramebufferColorAttachmentCount()
   {
-    return mFramebufferColorAttached;
+    return mFramebufferColorAttachmentCount;
   }
 
   inline GLenum CheckFramebufferDepthAttachment()
@@ -275,6 +276,15 @@ public:
 
   inline void ClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
   {
+    mLastClearColor.r = red;
+    mLastClearColor.g = green;
+    mLastClearColor.b = blue;
+    mLastClearColor.a = alpha;
+  }
+
+  inline const Vector4& GetLastClearColor() const
+  {
+    return mLastClearColor;
   }
 
   inline void ClearDepthf(GLclampf depth)
@@ -575,9 +585,14 @@ public:
     mFramebufferStatus |= 4;
 
     //We check 4 attachment colors
-    if ((attachment == GL_COLOR_ATTACHMENT0) || (attachment == GL_COLOR_ATTACHMENT1) || (attachment == GL_COLOR_ATTACHMENT2)  || (attachment == GL_COLOR_ATTACHMENT4))
+    if ((attachment >= GL_COLOR_ATTACHMENT0) && (attachment < GL_COLOR_ATTACHMENT0 + Dali::DevelFrameBuffer::MAX_COLOR_ATTACHMENTS))
     {
-      mFramebufferColorAttached = true;
+      uint8_t mask = 1 << (attachment - GL_COLOR_ATTACHMENT0);
+      if ((mFrameBufferColorStatus & mask) == 0)
+      {
+        mFrameBufferColorStatus |= mask;
+        ++mFramebufferColorAttachmentCount;
+      }
     }
   }
 
@@ -2169,9 +2184,10 @@ private:
   GLenum     mActiveTextureUnit;
   GLenum     mCheckFramebufferStatusResult;
   GLint      mFramebufferStatus;
-  GLenum     mFramebufferColorAttached;
   GLenum     mFramebufferDepthAttached;
   GLenum     mFramebufferStencilAttached;
+  GLuint     mFramebufferColorAttachmentCount;
+  GLuint     mFrameBufferColorStatus;
   GLint      mNumBinaryFormats;
   GLint      mBinaryFormats;
   GLint      mProgramBinaryLength;
@@ -2182,6 +2198,7 @@ private:
   ShaderSourceMap mShaderSources;
   GLuint     mLastShaderCompiled;
   GLbitfield mLastClearBitMask;
+  Vector4 mLastClearColor;
   unsigned int mClearCount;
 
   Vector4 mLastBlendColor;
index e19a7f8..5a9a0fc 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
@@ -17,6 +17,7 @@
 
 #include <dali/public-api/dali-core.h>
 #include <dali-test-suite-utils.h>
+#include <dali/devel-api/rendering/frame-buffer-devel.h>
 
 using namespace Dali;
 
@@ -45,7 +46,7 @@ int UtcDaliFrameBufferNew01(void)
   application.SendNotification();
   application.Render();
 
-  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachment(), (GLenum)GL_FALSE, TEST_LOCATION);
+  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachmentCount(), 0u, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferDepthAttachment(), (GLenum)GL_FALSE, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferStencilAttachment(), (GLenum)GL_FALSE, TEST_LOCATION);
 
@@ -65,7 +66,7 @@ int UtcDaliFrameBufferNew02(void)
   application.SendNotification();
   application.Render();
 
-  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachment(), (GLenum)GL_FALSE, TEST_LOCATION);
+  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachmentCount(), 0u, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferDepthAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferStencilAttachment(), (GLenum)GL_FALSE, TEST_LOCATION);
 
@@ -85,7 +86,7 @@ int UtcDaliFrameBufferNew03(void)
   application.SendNotification();
   application.Render();
 
-  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachment(), (GLenum)GL_FALSE, TEST_LOCATION);
+  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachmentCount(), 0u, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferDepthAttachment(), (GLenum)GL_FALSE, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferStencilAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
 
@@ -105,7 +106,7 @@ int UtcDaliFrameBufferNew04(void)
   application.SendNotification();
   application.Render();
 
-  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachment(), (GLenum)GL_FALSE, TEST_LOCATION);
+  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachmentCount(), 0u, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferDepthAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferStencilAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
 
@@ -133,7 +134,7 @@ int UtcDaliFrameBufferNew06(void)
   application.SendNotification();
   application.Render();
 
-  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachment(), (GLenum)GL_FALSE, TEST_LOCATION);
+  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachmentCount(), 0u, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferDepthAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferStencilAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
 
@@ -148,7 +149,7 @@ int UtcDaliFrameBufferNewWithColor01(void)
   FrameBuffer frameBuffer = FrameBuffer::New( width, height );
   application.SendNotification();
   application.Render();
-  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
+  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachmentCount(), 1u, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferDepthAttachment(), (GLenum)GL_FALSE, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferStencilAttachment(), (GLenum)GL_FALSE, TEST_LOCATION);
   // check that texture is not empty handle
@@ -164,7 +165,7 @@ int UtcDaliFrameBufferNewWithColor02(void)
   FrameBuffer frameBuffer = FrameBuffer::New( width, height, FrameBuffer::Attachment::COLOR );
   application.SendNotification();
   application.Render();
-  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
+  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachmentCount(), 1u, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferDepthAttachment(), (GLenum)GL_FALSE, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferStencilAttachment(), (GLenum)GL_FALSE, TEST_LOCATION);
   // check that texture is not empty handle
@@ -180,7 +181,7 @@ int UtcDaliFrameBufferNewWithColor03(void)
   FrameBuffer frameBuffer = FrameBuffer::New( width, height, FrameBuffer::Attachment::COLOR_DEPTH );
   application.SendNotification();
   application.Render();
-  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
+  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachmentCount(), 1u, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferDepthAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferStencilAttachment(), (GLenum)GL_FALSE, TEST_LOCATION);
   // check that texture is not empty handle
@@ -196,7 +197,7 @@ int UtcDaliFrameBufferNewWithColor04(void)
   FrameBuffer frameBuffer = FrameBuffer::New( width, height, FrameBuffer::Attachment::COLOR_STENCIL );
   application.SendNotification();
   application.Render();
-  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
+  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachmentCount(), 1u, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferDepthAttachment(), (GLenum)GL_FALSE, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferStencilAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
   // check that texture is not empty handle
@@ -212,7 +213,7 @@ int UtcDaliFrameBufferNewWithColor05(void)
   FrameBuffer frameBuffer = FrameBuffer::New( width, height, FrameBuffer::Attachment::COLOR_DEPTH_STENCIL );
   application.SendNotification();
   application.Render();
-  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
+  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachmentCount(), 1u, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferDepthAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferStencilAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
   // check that texture is not empty handle
@@ -289,7 +290,7 @@ int UtcDaliFrameBufferAttachColorTexture01(void)
   application.SendNotification();
   application.Render();
 
-  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
+  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachmentCount(), 1u, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferDepthAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferStencilAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
 
@@ -312,7 +313,7 @@ int UtcDaliFrameBufferAttachColorTexture02(void)
   application.SendNotification();
   application.Render();
 
-  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
+  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachmentCount(), 1u, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferDepthAttachment(), (GLenum)GL_FALSE, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferStencilAttachment(), (GLenum)GL_FALSE, TEST_LOCATION);
 
@@ -335,7 +336,7 @@ int UtcDaliFrameBufferAttachColorTexture03(void)
   application.SendNotification();
   application.Render();
 
-  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
+  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachmentCount(), 1u, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferDepthAttachment(), (GLenum)GL_FALSE, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferStencilAttachment(), (GLenum)GL_FALSE, TEST_LOCATION);
 
@@ -355,13 +356,38 @@ int UtcDaliFrameBufferAttachColorTexture04(void)
   application.SendNotification();
   application.Render();
 
-  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
+  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachmentCount(), 1u, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferDepthAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferStencilAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
 
   END_TEST;
 }
 
+int UtcDaliFrameBufferAttachColorTexture05(void)
+{
+  TestApplication application;
+
+  unsigned int width(64);
+  unsigned int height(64);
+  FrameBuffer frameBuffer = FrameBuffer::New( width, height, FrameBuffer::Attachment::NONE );
+  Texture texture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, width, height );
+
+  // N.B. it doesn't make sense per se, however the OGL standard doesn't seem to forbid attaching the same texture to different slots.
+  for (int i = 0; i < Dali::DevelFrameBuffer::MAX_COLOR_ATTACHMENTS + 1; ++i)
+  {
+    frameBuffer.AttachColorTexture( texture );
+  }
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachmentCount(), Dali::DevelFrameBuffer::MAX_COLOR_ATTACHMENTS, TEST_LOCATION);
+  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferDepthAttachment(), (GLenum)GL_FALSE, TEST_LOCATION);
+  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferStencilAttachment(), (GLenum)GL_FALSE, TEST_LOCATION);
+
+  END_TEST;
+}
+
 int UtcDaliFrameBufferGetColorTexture01(void)
 {
   TestApplication application;
@@ -392,6 +418,53 @@ int UtcDaliFrameBufferGetColorTexture02(void)
   END_TEST;
 }
 
+int UtcDaliFrameBufferGetColorTexture03(void)
+{ // FrameBuffer::GetColorTexture() and GetColorTexture(0) are equivalent
+  TestApplication application;
+
+  unsigned int width(64);
+  unsigned int height(64);
+  FrameBuffer frameBuffer = FrameBuffer::New( width, height, FrameBuffer::Attachment::NONE );
+  Texture texture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, width, height );
+  frameBuffer.AttachColorTexture( texture, 0u, 1u );
+
+  DALI_TEST_EQUALS(frameBuffer.GetColorTexture(), texture, TEST_LOCATION);
+  DALI_TEST_EQUALS(DevelFrameBuffer::GetColorTexture(frameBuffer, 0), texture, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliFrameBufferGetColorTexture04(void)
+{
+  TestApplication application;
+
+  unsigned int width(64);
+  unsigned int height(64);
+  FrameBuffer frameBuffer = FrameBuffer::New( width, height, FrameBuffer::Attachment::NONE );
+  Texture textures[] = {
+      Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, width, height ),
+      Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, width, height ),
+      Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, width, height ),
+      Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, width, height ),
+      Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, width, height ),
+      Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, width, height ),
+      Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, width, height ),
+      Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, width, height ),
+  };
+
+  for (auto& t: textures)
+  {
+    frameBuffer.AttachColorTexture( t, 0u, 1u );
+  }
+
+  for (unsigned int i = 0; i < std::extent<decltype(textures)>::value; ++i)
+  {
+    DALI_TEST_EQUALS(DevelFrameBuffer::GetColorTexture(frameBuffer, i), textures[i], TEST_LOCATION);
+  }
+
+  END_TEST;
+}
+
 int UtcDaliFramebufferContextLoss(void)
 {
   tet_infoline("UtcDaliFramebufferContextLoss\n");
index af150dc..dfdc772 100644 (file)
@@ -127,7 +127,7 @@ int UtcDaliFrameBufferImageAttachments01(void)
   application.Render();
   application.SendNotification();
 
-  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
+  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachmentCount(), 1u, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferDepthAttachment(), (GLenum)GL_FALSE, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferStencilAttachment(), (GLenum)GL_FALSE, TEST_LOCATION);
 
@@ -153,7 +153,7 @@ int UtcDaliFrameBufferImageAttachments02(void)
   application.Render();
   application.SendNotification();
 
-  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
+  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachmentCount(), 1u, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferDepthAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferStencilAttachment(), (GLenum)GL_FALSE, TEST_LOCATION);
 
@@ -179,7 +179,7 @@ int UtcDaliFrameBufferImageAttachments03(void)
   application.Render();
   application.SendNotification();
 
-  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
+  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachmentCount(), 1u, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferDepthAttachment(), (GLenum)GL_FALSE, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferStencilAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
 
@@ -205,7 +205,7 @@ int UtcDaliFrameBufferImageAttachments04(void)
   application.Render();
   application.SendNotification();
 
-  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
+  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachmentCount(), 1u, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferDepthAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferStencilAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
 
index b7387f1..2f9773e 100644 (file)
@@ -20,7 +20,9 @@
 #include <stdlib.h>
 #include <dali/public-api/dali-core.h>
 #include <dali/integration-api/events/touch-event-integ.h>
+#include <dali/integration-api/input-options.h>
 #include <dali/integration-api/render-task-list-integ.h>
+#include <dali/devel-api/events/long-press-gesture-detector-devel.h>
 #include <dali-test-suite-utils.h>
 #include <test-touch-utils.h>
 
@@ -959,3 +961,36 @@ int UtcDaliLongPressGestureLayerConsumesTouch(void)
 
   END_TEST;
 }
+
+int UtcDaliLongPressGestureSetMinimumHoldingTime(void)
+{
+  TestApplication application;
+
+  const uint32_t kMinumumHolding1 = 5000;
+  const uint32_t kMinumumHolding2 = 3000;
+
+  Integration::SetLongPressMinimumHoldingTime( kMinumumHolding1 );
+
+  Actor actor = Actor::New();
+  actor.SetSize( 100.0f, 100.0f );
+  actor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  Stage::GetCurrent().Add( actor );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  SignalData data;
+  GestureReceivedFunctor functor( data );
+
+  LongPressGestureDetector detector = LongPressGestureDetector::New();
+  detector.Attach(actor);
+  detector.DetectedSignal().Connect(&application, functor);
+
+  DALI_TEST_EQUALS( DevelLongPressGestureDetector::GetMinimumHoldingTime( detector ), kMinumumHolding1, TEST_LOCATION );
+
+  Integration::SetLongPressMinimumHoldingTime( kMinumumHolding2 );
+  DALI_TEST_EQUALS( DevelLongPressGestureDetector::GetMinimumHoldingTime( detector ), kMinumumHolding2, TEST_LOCATION );
+
+  END_TEST;
+}
index 8067f58..0b86a22 100644 (file)
@@ -1641,13 +1641,13 @@ int UtcDaliRenderTaskSetClearEnabledP(void)
   RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
 
   RenderTask task = taskList.GetTask( 0u );
-  DALI_TEST_CHECK( !task.GetClearEnabled() ); // defaults to false
-
-  task.SetClearEnabled( true );
-  DALI_TEST_EQUALS( task.GetClearEnabled(), true, TEST_LOCATION );
+  DALI_TEST_CHECK( task.GetClearEnabled() ); // defaults to true
 
   task.SetClearEnabled( false );
   DALI_TEST_EQUALS( task.GetClearEnabled(), false, TEST_LOCATION );
+
+  task.SetClearEnabled( true );
+  DALI_TEST_EQUALS( task.GetClearEnabled(), true, TEST_LOCATION );
   END_TEST;
 }
 
@@ -1679,7 +1679,7 @@ int UtcDaliRenderTaskGetClearEnabledP(void)
   RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
 
   RenderTask task = taskList.GetTask( 0u );
-  DALI_TEST_CHECK( !task.GetClearEnabled() ); // defaults to false
+  DALI_TEST_CHECK( task.GetClearEnabled() ); // defaults to true
   END_TEST;
 }
 
index 8508728..b439957 100644 (file)
@@ -922,25 +922,47 @@ int UtcDaliSceneEnsureEmptySceneCleared(void)
 
   TestApplication application;
 
-  // Create a new scene and set the background colors of both the new and the main scenes
-  auto defaultScene = application.GetScene();
-  defaultScene.SetBackgroundColor( Color::WHITE );
+  auto& glAbstraction = application.GetGlAbstraction();
+  auto clearCountBefore = glAbstraction.GetClearCountCalled();
 
-  TestRenderSurface surface( PositionSize( 0.0f, 0.0f, 480.0f, 800.0f ) );
-  auto newScene = Integration::Scene::New( surface );
-  newScene.SetBackgroundColor( Color::RED );
+  application.SendNotification();
+  application.Render();
+
+  // No actor, no rendering at all
+  DALI_TEST_EQUALS( glAbstraction.GetClearCountCalled(), clearCountBefore, TEST_LOCATION );
+  DALI_TEST_EQUALS( glAbstraction.GetLastClearColor(), Color::TRANSPARENT, TEST_LOCATION );
 
   // Need to create a renderable as we don't start rendering until we have at least one
   // We don't need to add this to any scene
   auto actor = CreateRenderableActor();
 
-  auto& glAbstraction = application.GetGlAbstraction();
-  auto clearCountBefore = glAbstraction.GetClearCountCalled();
+  application.SendNotification();
+  application.Render();
+
+  // Default background color
+  DALI_TEST_EQUALS( glAbstraction.GetClearCountCalled(), clearCountBefore + 1, TEST_LOCATION );
+  DALI_TEST_EQUALS( glAbstraction.GetLastClearColor(), Color::BLACK, TEST_LOCATION );
+
+  // Create a new scene and set the background colors of both the new and the main scenes
+  auto defaultScene = application.GetScene();
+  defaultScene.SetBackgroundColor( Color::WHITE );
 
   application.SendNotification();
   application.Render();
 
   DALI_TEST_EQUALS( glAbstraction.GetClearCountCalled(), clearCountBefore + 2, TEST_LOCATION );
+  DALI_TEST_EQUALS( glAbstraction.GetLastClearColor(), Color::WHITE, TEST_LOCATION );
+
+  TestRenderSurface surface( PositionSize( 0.0f, 0.0f, 480.0f, 800.0f ) );
+  auto newScene = Integration::Scene::New( surface );
+  newScene.SetBackgroundColor( Color::RED );
+
+  application.SendNotification();
+  application.Render();
+
+  // + 2 clear for 2 scenes
+  DALI_TEST_EQUALS( glAbstraction.GetClearCountCalled(), clearCountBefore + 4, TEST_LOCATION );
+  DALI_TEST_EQUALS( glAbstraction.GetLastClearColor(), Color::RED, TEST_LOCATION );
 
   // Add the actor to the main scene
   defaultScene.Add( actor );
@@ -948,18 +970,21 @@ int UtcDaliSceneEnsureEmptySceneCleared(void)
   application.SendNotification();
   application.Render();
 
-  // Add another scene and set its background color, ensure we clear it to the appropriate color
+  // + 2 clear for 2 scenes
+  DALI_TEST_EQUALS( glAbstraction.GetClearCountCalled(), clearCountBefore + 6, TEST_LOCATION );
+  DALI_TEST_EQUALS( glAbstraction.GetLastClearColor(), Color::RED, TEST_LOCATION );
 
+  // Add another scene and set its background color, ensure we clear it to the appropriate color
+  // + 3 clear for 3 scenes
   TestRenderSurface surface2( PositionSize( 0.0f, 0.0f, 480.0f, 800.0f ) );
   auto thirdScene = Integration::Scene::New( surface2 );
   thirdScene.SetBackgroundColor( Color::BLUE );
 
-  clearCountBefore = glAbstraction.GetClearCountCalled();
-
   application.SendNotification();
   application.Render();
 
-  DALI_TEST_EQUALS( glAbstraction.GetClearCountCalled(), clearCountBefore + 3, TEST_LOCATION );
+  DALI_TEST_EQUALS( glAbstraction.GetClearCountCalled(), clearCountBefore + 9, TEST_LOCATION );
+  DALI_TEST_EQUALS( glAbstraction.GetLastClearColor(), Color::BLUE, TEST_LOCATION );
 
   END_TEST;
 }
@@ -1231,3 +1256,64 @@ int UtcDaliSceneKeyEventGeneratedSignalP(void)
   DALI_TEST_CHECK( event4.state == static_cast<Integration::KeyEvent::State>( data.receivedKeyEvent.state ) );
   END_TEST;
 }
+
+int UtcDaliSceneEnsureReplacedSurfaceKeepsClearColor(void)
+{
+  tet_infoline( "Ensure we keep background color when the scene surface is replaced " );
+
+  TestApplication application;
+
+  // Create a new scene and set the background color of the main scene
+  auto defaultScene = application.GetScene();
+  defaultScene.SetBackgroundColor( Color::BLUE );
+
+  // Need to create a renderable as we don't start rendering until we have at least one
+  // We don't need to add this to any scene
+  auto actor = CreateRenderableActor();
+
+  auto& glAbstraction = application.GetGlAbstraction();
+  auto clearCountBefore = glAbstraction.GetClearCountCalled();
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( glAbstraction.GetClearCountCalled(), clearCountBefore + 1, TEST_LOCATION );
+  DALI_TEST_EQUALS( glAbstraction.GetLastClearColor(), Color::BLUE, TEST_LOCATION );
+
+  TestRenderSurface surface( PositionSize( 0.0f, 0.0f, 480.0f, 800.0f ) );
+  defaultScene.SetSurface( surface );
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( glAbstraction.GetClearCountCalled(), clearCountBefore + 2, TEST_LOCATION );
+  DALI_TEST_EQUALS( glAbstraction.GetLastClearColor(), Color::BLUE, TEST_LOCATION );
+
+  // Check when the main render task viewport is set the clear color is clipped using scissors
+  TraceCallStack& scissorTrace = glAbstraction.GetScissorTrace();
+  TraceCallStack& enabledDisableTrace = glAbstraction.GetEnableDisableTrace();
+  scissorTrace.Enable( true );
+  enabledDisableTrace.Enable( true );
+
+  defaultScene.GetRenderTaskList().GetTask( 0 ).SetViewport( Viewport( 0.0f, 0.0f, 100.0f, 100.0f ) );
+
+  application.SendNotification();
+  application.Render();
+
+  // Check scissor test was enabled.
+  DALI_TEST_CHECK( enabledDisableTrace.FindMethodAndParams( "Enable", "3089" ) ); // 3089 = 0xC11 (GL_SCISSOR_TEST)
+
+  // Check the scissor was set, and the coordinates are correct.
+  DALI_TEST_CHECK( scissorTrace.FindMethodAndParams( "Scissor", "0, 700, 100, 100" ) );
+
+  DALI_TEST_EQUALS( glAbstraction.GetClearCountCalled(), clearCountBefore + 3, TEST_LOCATION );
+  DALI_TEST_EQUALS( glAbstraction.GetLastClearColor(), Color::BLUE, TEST_LOCATION );
+
+  scissorTrace.Enable( false );
+  scissorTrace.Reset();
+
+  enabledDisableTrace.Enable( false );
+  enabledDisableTrace.Reset();
+
+  END_TEST;
+}
index b41d996..94dbedb 100644 (file)
@@ -1,4 +1,4 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+CMAKE_MINIMUM_REQUIRED(VERSION 3.1)
 CMAKE_POLICY(SET CMP0012 NEW) # Prevent dereferencing of OFF/ON as variables
 
 SET(name "dali-core")
@@ -7,11 +7,11 @@ PROJECT(${name})
 SET(PKG_NAME ${name})
 
 SET(GCC_COMPILER_VERSION_REQUIRED "6")
-if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
-  if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS GCC_COMPILER_VERSION_REQUIRED)
+IF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+  IF(CMAKE_CXX_COMPILER_VERSION VERSION_LESS GCC_COMPILER_VERSION_REQUIRED)
     MESSAGE(FATAL_ERROR "The GCC required compiler version is " ${GCC_COMPILER_VERSION_REQUIRED})
-  endif()
-endif()
+  ENDIF()
+ENDIF()
 
 # API VERSION (Not DALi release version)
 SET(${name}_VERSION_MAJOR 0)
@@ -29,6 +29,13 @@ OPTION(ENABLE_BACKTRACE      "Enable Backtrace" OFF)
 OPTION(ENABLE_LOCK_BACKTRACE "Enable" OFF)
 OPTION(ENABLE_COVERAGE       "Coverage" OFF)
 OPTION(ENABLE_TRACE          "Enable Trace" OFF)
+OPTION(ENABLE_PKG_CONFIGURE  "Use pkgconfig" ON)
+OPTION(ENABLE_LINK_TEST      "Enable the link test" ON)
+
+IF( WIN32 ) # WIN32 includes x64 as well according to the cmake doc.
+  FIND_PACKAGE( dali-windows-dependencies REQUIRED )
+  FIND_PATH( SYSTEM_INCLUDE_DIR "dali-windows-dependencies.h" )
+ENDIF()
 
 # Set up compiler definitions
 
@@ -39,28 +46,46 @@ ELSE()
   MESSAGE( STATUS "CMAKE_BUILD_TYPE: " Release )
 ENDIF()
 
-ADD_DEFINITIONS(-DPIC -DSTDC_HEADERS)
-
-IF("${ARCH}" STREQUAL "arm")
-  ADD_DEFINITIONS("-DTARGET")
-ENDIF("${ARCH}" STREQUAL "arm")
-
 IF( ENABLE_DEBUG )
   ADD_DEFINITIONS( "-DDEBUG_ENABLED" )
   SET( ENABLE_EXPORTALL ON )
-ENDIF( ENABLE_DEBUG )
+ENDIF()
+
+IF( WIN32 ) # WIN32 includes x64 as well according to the cmake doc.
+
+  IF(NOT DEFINED STATIC)
+    ADD_DEFINITIONS( "-DBUILDING_DALI_CORE" )
+  ENDIF()
+
+ELSEIF( UNIX )
+
+  IF( NOT ${ENABLE_EXPORTALL} )
+    ADD_DEFINITIONS( "-DHIDE_DALI_INTERNALS" )
+  ENDIF()
 
-IF( NOT ${ENABLE_EXPORTALL} )
-  ADD_DEFINITIONS( "-fvisibility=hidden -DHIDE_DALI_INTERNALS" )
-ENDIF( NOT ${ENABLE_EXPORTALL} )
+  ADD_DEFINITIONS(-DPIC -DSTDC_HEADERS)
+
+  IF("${ARCH}" STREQUAL "arm")
+    ADD_DEFINITIONS("-DTARGET")
+  ENDIF()
+
+  IF( NOT ${ENABLE_EXPORTALL} )
+    ADD_DEFINITIONS( "-fvisibility=hidden" )
+  ENDIF()
+
+ENDIF()
 
 IF( ENABLE_BACKTRACE OR ENABLE_LOCK_BACKTRACE )
   ADD_DEFINITIONS( "-DBACKTRACE_ENABLED" )
-ENDIF( ENABLE_BACKTRACE OR ENABLE_LOCK_BACKTRACE )
+ENDIF()
 
 IF( ENABLE_LOCK_BACKTRACE )
   ADD_DEFINITIONS( "-DLOCK_BACKTRACE_ENABLED" )
-ENDIF( ENABLE_LOCK_BACKTRACE )
+ENDIF()
+
+IF( ENABLE_TRACE )
+  ADD_DEFINITIONS("-DTRACE_ENABLED")
+ENDIF()
 
 # Deployment folder should come from spec file or command line:
 SET( PREFIX ${CMAKE_INSTALL_PREFIX})
@@ -82,46 +107,58 @@ IF( NOT INCLUDE_DIR )
 ENDIF()
 
 # Set up the lib dir
-SET( LIB_DIR $ENV{libdir} )
-IF( NOT LIB_DIR )
-  SET( LIB_DIR ${CMAKE_INSTALL_LIBDIR} )
-ENDIF()
-IF( NOT LIB_DIR )
+IF( SET_VCPKG_INSTALL_PREFIX )
   SET( LIB_DIR ${PREFIX}/lib )
+  SET( BIN_DIR ${PREFIX}/bin )
+ELSE()
+  SET( LIB_DIR $ENV{libdir} )
+  IF( NOT LIB_DIR )
+    SET( LIB_DIR ${CMAKE_INSTALL_LIBDIR} )
+  ENDIF()
+  IF( NOT LIB_DIR )
+    SET( LIB_DIR ${PREFIX}/lib )
+  ENDIF()
 ENDIF()
 
-# Configure the pkg-config file
-# Requires the following variables to be setup:
-# @PREFIX@ @EXEC_PREFIX@ @DALI_VERSION@ @LIB_DIR@ @DEV_INCLUDE_PATH@
-SET( DEV_INCLUDE_PATH ${INCLUDE_DIR} )
-SET( CORE_PKG_CFG_FILE ${CMAKE_CURRENT_SOURCE_DIR}/dali-core.pc )
-CONFIGURE_FILE( ${CORE_PKG_CFG_FILE}.in ${CORE_PKG_CFG_FILE} @ONLY )
-
-# Set up compiler flags and warnings
-ADD_COMPILE_OPTIONS( -std=c++11 )
-ADD_COMPILE_OPTIONS( -Wnon-virtual-dtor -Woverloaded-virtual -Wold-style-cast )
-
-# TODO: Clang is a lot more strict with warnings, we should address
-# those issues at some point.
-IF( NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" )
-  ADD_COMPILE_OPTIONS( -Werror )
+IF( ENABLE_PKG_CONFIGURE )
+  # Configure the pkg-config file
+  # Requires the following variables to be setup:
+  # @PREFIX@ @EXEC_PREFIX@ @DALI_VERSION@ @LIB_DIR@ @DEV_INCLUDE_PATH@
+  SET( DEV_INCLUDE_PATH ${INCLUDE_DIR} )
+  SET( CORE_PKG_CFG_FILE ${CMAKE_CURRENT_SOURCE_DIR}/dali-core.pc )
+  CONFIGURE_FILE( ${CORE_PKG_CFG_FILE}.in ${CORE_PKG_CFG_FILE} @ONLY )
 ENDIF()
 
-ADD_COMPILE_OPTIONS( -Wall -Wextra -Wno-unused-parameter -Wfloat-equal -Wno-class-memaccess -Wno-cast-function-type )
+IF( WIN32 ) # WIN32 includes x64 as well according to the cmake doc.
 
-IF( ENABLE_COVERAGE OR "$ENV{CXXFLAGS}" MATCHES --coverage )
-  ADD_COMPILE_OPTIONS( --coverage )
-  SET(ENABLE_COVERAGE ON)
-  SET(COVERAGE --coverage)
-ENDIF()
+  ADD_COMPILE_OPTIONS( /FIdali-windows-dependencies.h ) # Adds missing definitions.
+  ADD_COMPILE_OPTIONS( /vmg )                           # Avoids a 'reinterpret_cast' compile error while compiling signals and callbacks.
 
-IF( ENABLE_TRACE )
-  ADD_DEFINITIONS("-DTRACE_ENABLED")
-ENDIF()
+ELSEIF( UNIX )
+
+  # Set up compiler flags and warnings
+  ADD_COMPILE_OPTIONS( -std=c++11 )
+  ADD_COMPILE_OPTIONS( -Wnon-virtual-dtor -Woverloaded-virtual -Wold-style-cast )
+
+  # TODO: Clang is a lot more strict with warnings, we should address
+  # those issues at some point.
+  IF( NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" )
+    ADD_COMPILE_OPTIONS( -Werror )
+  ENDIF()
+
+  ADD_COMPILE_OPTIONS( -Wall -Wextra -Wno-unused-parameter -Wfloat-equal -Wno-class-memaccess -Wno-cast-function-type )
+
+  IF( ENABLE_COVERAGE OR "$ENV{CXXFLAGS}" MATCHES --coverage )
+    ADD_COMPILE_OPTIONS( --coverage )
+    SET(ENABLE_COVERAGE ON)
+    SET(COVERAGE --coverage)
+  ENDIF()
 
+ENDIF()
 
 INCLUDE_DIRECTORIES(
   ${ROOT_SRC_DIR}
+  ${SYSTEM_INCLUDE_DIR}
 )
 
 SET(SOURCE_DIR "${ROOT_SRC_DIR}/dali")
@@ -135,6 +172,11 @@ INCLUDE( ${ROOT_SRC_DIR}/dali/internal/file.list )
 INCLUDE( ${ROOT_SRC_DIR}/dali/integration-api/file.list )
 INCLUDE( ${ROOT_SRC_DIR}/dali/public-api/file.list )
 INCLUDE( ${ROOT_SRC_DIR}/dali/devel-api/file.list )
+IF( WIN32 )
+  INCLUDE( ${ROOT_SRC_DIR}/dali/internal/file-windows.list )
+ELSEIF( UNIX )
+  INCLUDE( ${ROOT_SRC_DIR}/dali/internal/file-unix.list )
+ENDIF()
 INCLUDE( ${ROOT_SRC_DIR}/doc/file.list )
 
 SET(LIBTYPE SHARED)
@@ -145,9 +187,13 @@ ENDIF()
 ADD_LIBRARY( ${name} ${LIBTYPE} ${SOURCES} )
 
 # pthread required due to gcc issue
-FIND_LIBRARY(PTHREAD pthread)
-IF(PTHREAD)
-  SET(OPTIONAL_LIBS ${OPTIONAL_LIBS} -lpthread)
+IF( WIN32 )
+    SET( OPTIONAL_LIBS ${OPTIONAL_LIBS} dali-windows-dependencies::dali-windows-dependencies )
+ELSEIF( UNIX )
+  FIND_LIBRARY(PTHREAD pthread)
+  IF(PTHREAD)
+    SET(OPTIONAL_LIBS ${OPTIONAL_LIBS} -lpthread)
+  ENDIF()
 ENDIF()
 
 TARGET_LINK_LIBRARIES( ${name}
@@ -163,10 +209,35 @@ SET_TARGET_PROPERTIES( ${name}
 )
 
 # Install the library so file and symlinks
-INSTALL( TARGETS ${name} DESTINATION ${LIB_DIR} )
+IF( INSTALL_CMAKE_MODULES )
+  INSTALL( TARGETS ${name}
+    EXPORT ${name}-targets
+    LIBRARY DESTINATION ${LIB_DIR}
+    ARCHIVE DESTINATION ${LIB_DIR}
+    RUNTIME DESTINATION ${BIN_DIR}
+  )
+
+  INSTALL(
+    EXPORT ${name}-targets
+    NAMESPACE ${name}::
+    FILE ${name}-targets.cmake
+    DESTINATION share/${name}
+  )
+
+  FILE( WRITE ${CMAKE_CURRENT_BINARY_DIR}/${name}-config.cmake "
+    include(CMakeFindDependencyMacro)
+    include(\${CMAKE_CURRENT_LIST_DIR}/${name}-targets.cmake)
+  ")
+  INSTALL( FILES ${CMAKE_CURRENT_BINARY_DIR}/${name}-config.cmake DESTINATION share/${name} )
+ELSE()
+  INSTALL( TARGETS ${name} DESTINATION ${LIB_DIR} )
+ENDIF()
+
 
 # Install the pkg-config file
-INSTALL( FILES ${CORE_PKG_CFG_FILE} DESTINATION ${LIB_DIR}/pkgconfig )
+IF( ENABLE_PKG_CONFIGURE )
+  INSTALL( FILES ${CORE_PKG_CFG_FILE} DESTINATION ${LIB_DIR}/pkgconfig )
+ENDIF()
 
 # macro for installing headers by replacing prefix. (TODO, investigate
 # if there is a CMAKE way of doing this automatically)
@@ -188,7 +259,7 @@ INSTALL_HEADERS_WITH_DIRECTORY(PACKAGE_DOXY_HEADERS ${PACKAGE_DOXY_SRC_DIR} "dal
 # The DALI_CORE_PREFIX must be set if this CMakeLists.txt is executed
 # from the top-level CMake script using ADD_SUBDIRECTORY() to avoid
 # target names duplication with other DALi modules.
-IF( UNIX )
+IF( ENABLE_COVERAGE )
   FIND_PROGRAM( LCOV_BIN "lcov" )
   IF( LCOV_BIN )
 
@@ -248,29 +319,32 @@ IF( UNIX )
           )
 
   ENDIF( LCOV_BIN )
-ENDIF( UNIX )
-
-# Linker Test
-SET( DALI_TEST_SUITE_DIR ${ROOT_SRC_DIR}/automated-tests/src/dali/dali-test-suite-utils )
-SET( LINKER_TEST_NAME ${DALI_CORE_PREFIX}linker-test )
-SET( LINKER_TEST_SOURCES
-  linker-test.cpp
-  ${DALI_TEST_SUITE_DIR}/test-application.cpp
-  ${DALI_TEST_SUITE_DIR}/test-platform-abstraction.cpp
-  ${DALI_TEST_SUITE_DIR}/test-render-controller.cpp
-  ${DALI_TEST_SUITE_DIR}/test-render-surface.cpp
-  ${DALI_TEST_SUITE_DIR}/test-gl-abstraction.cpp
-  ${DALI_TEST_SUITE_DIR}/test-gl-sync-abstraction.cpp
-  ${DALI_TEST_SUITE_DIR}/test-trace-call-stack.cpp
-)
-ADD_EXECUTABLE( ${LINKER_TEST_NAME} ${LINKER_TEST_SOURCES} )
-TARGET_LINK_LIBRARIES(${LINKER_TEST_NAME} ${name} )
-TARGET_INCLUDE_DIRECTORIES( ${LINKER_TEST_NAME} PRIVATE ${DALI_TEST_SUITE_DIR} )
+ENDIF()
+
+IF( ENABLE_LINK_TEST )
+  # Linker Test
+  SET( DALI_TEST_SUITE_DIR ${ROOT_SRC_DIR}/automated-tests/src/dali/dali-test-suite-utils )
+  SET( LINKER_TEST_NAME ${DALI_CORE_PREFIX}linker-test )
+  SET( LINKER_TEST_SOURCES
+    linker-test.cpp
+    ${DALI_TEST_SUITE_DIR}/test-application.cpp
+    ${DALI_TEST_SUITE_DIR}/test-platform-abstraction.cpp
+    ${DALI_TEST_SUITE_DIR}/test-render-controller.cpp
+    ${DALI_TEST_SUITE_DIR}/test-render-surface.cpp
+    ${DALI_TEST_SUITE_DIR}/test-gl-abstraction.cpp
+    ${DALI_TEST_SUITE_DIR}/test-gl-sync-abstraction.cpp
+    ${DALI_TEST_SUITE_DIR}/test-trace-call-stack.cpp
+  )
+  ADD_EXECUTABLE( ${LINKER_TEST_NAME} ${LINKER_TEST_SOURCES} )
+  TARGET_LINK_LIBRARIES(${LINKER_TEST_NAME} ${name} )
+  TARGET_INCLUDE_DIRECTORIES( ${LINKER_TEST_NAME} PRIVATE ${DALI_TEST_SUITE_DIR} )
+ENDIF()
 
 # Configuration Messages
 MESSAGE( STATUS "Configuration:\n" )
 MESSAGE( STATUS "Prefix:                " ${PREFIX} )
 MESSAGE( STATUS "Lib Dir:               " ${LIB_DIR} )
+MESSAGE( STATUS "Bin Dir:               " ${BIN_DIR} )
 MESSAGE( STATUS "Include Dir:           " ${INCLUDE_DIR} )
 MESSAGE( STATUS "Debug build:           " ${ENABLE_DEBUG} )
 MESSAGE( STATUS "Export all symbols:    " ${ENABLE_EXPORTALL} )
@@ -278,5 +352,7 @@ MESSAGE( STATUS "Backtrace:             " ${ENABLE_BACKTRACE} )
 MESSAGE( STATUS "Scoped Lock backtrace: " ${ENABLE_LOCK_BACKTRACE} )
 MESSAGE( STATUS "Coverage:              " ${ENABLE_COVERAGE} )
 MESSAGE( STATUS "Trace:                 " ${ENABLE_TRACE} )
+MESSAGE( STATUS "Use pkg configure:     " ${ENABLE_PKG_CONFIGURE} )
+MESSAGE( STATUS "Enable link test:      " ${ENABLE_LINK_TEST} )
 MESSAGE( STATUS "CXXFLAGS:              " ${CMAKE_CXX_FLAGS} )
 MESSAGE( STATUS "LDFLAGS:               " ${CMAKE_SHARED_LINKER_FLAGS_INIT}${CMAKE_SHARED_LINKER_FLAGS} )
diff --git a/dali/devel-api/events/long-press-gesture-detector-devel.cpp b/dali/devel-api/events/long-press-gesture-detector-devel.cpp
new file mode 100644 (file)
index 0000000..6d11fb2
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2020 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.
+ *
+ */
+
+// // EXTERNAL INCLUDES
+// #include <dali/public-api/events/key-event.h>
+// #include <dali/public-api/events/touch-event.h>
+// #include <dali/public-api/events/wheel-event.h>
+
+// INTERNAL INCLUDES
+#include <dali/devel-api/events/long-press-gesture-detector-devel.h>
+#include <dali/internal/event/events/long-press-gesture/long-press-gesture-detector-impl.h>
+
+namespace Dali
+{
+
+namespace DevelLongPressGestureDetector
+{
+
+uint32_t GetMinimumHoldingTime( LongPressGestureDetector longPressGestureDetector )
+{
+  return GetImplementation( longPressGestureDetector ).GetMinimumHoldingTime();
+}
+
+
+} // namespace DevelLongPressGestureDetector
+
+} // namespace Dali
+
diff --git a/dali/devel-api/events/long-press-gesture-detector-devel.h b/dali/devel-api/events/long-press-gesture-detector-devel.h
new file mode 100644 (file)
index 0000000..f757b21
--- /dev/null
@@ -0,0 +1,44 @@
+#ifndef DALI_LONG_PRESS_GESTURE_DETECTOR_DEVEL_H
+#define DALI_LONG_PRESS_GESTURE_DETECTOR_DEVEL_H
+
+/*
+ * Copyright (c) 2020 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.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/public-api/events/long-press-gesture-detector.h>
+
+namespace Dali
+{
+
+class LongPressGestureDetector;
+
+namespace DevelLongPressGestureDetector
+{
+
+/**
+ * @brief Get the minimum holding time required to be recognized as a long press gesture in milliseconds
+ *
+ * @param[in] longPressGestureDetector The target LongPressGestureDetector instance
+ * @return The time value in milliseconds
+ */
+DALI_CORE_API uint32_t GetMinimumHoldingTime( LongPressGestureDetector longPressGestureDetector );
+
+} // namespace DevelLongPressGestureDetector
+
+} // namespace Dali
+
+#endif // DALI_LONG_PRESS_GESTURE_DETECTOR_DEVEL_H
index 1631960..78f1aab 100644 (file)
@@ -11,6 +11,7 @@ SET( devel_api_src_files
   ${devel_api_src_dir}/common/hash.cpp
   ${devel_api_src_dir}/common/stage-devel.cpp
   ${devel_api_src_dir}/events/hit-test-algorithm.cpp
+  ${devel_api_src_dir}/events/long-press-gesture-detector-devel.cpp
   ${devel_api_src_dir}/events/rotation-gesture.cpp
   ${devel_api_src_dir}/events/rotation-gesture-detector.cpp
   ${devel_api_src_dir}/events/touch-data-devel.cpp
@@ -21,6 +22,7 @@ SET( devel_api_src_files
   ${devel_api_src_dir}/images/pixel-data-devel.cpp
   ${devel_api_src_dir}/object/handle-devel.cpp
   ${devel_api_src_dir}/object/csharp-type-registry.cpp
+  ${devel_api_src_dir}/rendering/frame-buffer-devel.cpp
   ${devel_api_src_dir}/scripting/scripting.cpp
   ${devel_api_src_dir}/signals/signal-delegate.cpp
   ${devel_api_src_dir}/threading/conditional-wait.cpp
@@ -61,6 +63,7 @@ SET( devel_api_core_common_header_files
 SET( devel_api_core_events_header_files
   ${devel_api_src_dir}/events/gesture-devel.h
   ${devel_api_src_dir}/events/hit-test-algorithm.h
+  ${devel_api_src_dir}/events/long-press-gesture-detector-devel.h
   ${devel_api_src_dir}/events/rotation-gesture.h
   ${devel_api_src_dir}/events/rotation-gesture-detector.h
   ${devel_api_src_dir}/events/touch-data-devel.h
@@ -86,6 +89,7 @@ SET( devel_api_core_object_header_files
 
 
 SET( devel_api_core_rendering_header_files
+  ${devel_api_src_dir}/rendering/frame-buffer-devel.h
   ${devel_api_src_dir}/rendering/renderer-devel.h
 )
 
diff --git a/dali/devel-api/rendering/frame-buffer-devel.cpp b/dali/devel-api/rendering/frame-buffer-devel.cpp
new file mode 100644 (file)
index 0000000..f515e70
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2020 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.
+ *
+ */
+
+// HEADER
+#include <dali/devel-api/rendering/frame-buffer-devel.h>
+
+// INTERNAL INCLUDES
+#include <dali/internal/event/rendering/frame-buffer-impl.h> // Dali::Internal::FrameBuffer
+
+namespace Dali
+{
+
+namespace DevelFrameBuffer
+{
+
+Texture GetColorTexture( const FrameBuffer frameBuffer, uint8_t index )
+{
+  Internal::Texture* texturePtr = GetImplementation( frameBuffer ).GetColorTexture(index);
+  return Dali::Texture( texturePtr );
+}
+
+} // namespace DevelFrameBuffer
+
+} // namespace Dali
diff --git a/dali/devel-api/rendering/frame-buffer-devel.h b/dali/devel-api/rendering/frame-buffer-devel.h
new file mode 100644 (file)
index 0000000..455d567
--- /dev/null
@@ -0,0 +1,52 @@
+#ifndef DALI_FRAME_BUFFER_DEVEL_H
+#define DALI_FRAME_BUFFER_DEVEL_H
+
+/*
+ * Copyright (c) 2020 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.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/public-api/rendering/frame-buffer.h>
+
+namespace Dali
+{
+
+namespace DevelFrameBuffer
+{
+
+/**
+ * @brief Maximum number of color attachments supported.
+ */
+constexpr uint8_t MAX_COLOR_ATTACHMENTS = 8;
+
+/**
+ * @brief Gets the color texture at the given @a index used as output in the FrameBuffer.
+ *
+ * @param[in] frameBuffer A handle to the framebuffer
+ * @param[in] index The index required
+ *
+ * @return A handle to the texture used as color output, or an uninitialized handle
+ *
+ * @note A maximum of 8 color attachments are supported. Passing an invalid index will return
+ * an uninitialized handle.
+ */
+Texture GetColorTexture( const FrameBuffer frameBuffer, uint8_t index );
+
+} // namespace DevelFrameBuffer
+
+} // namespace Dali
+
+#endif // DALI_FRAME_BUFFER_DEVEL_H
index 24299f4..e11dc63 100644 (file)
@@ -23,6 +23,9 @@
 #include <dali/integration-api/context-notifier.h>
 #include <dali/integration-api/resource-policies.h>
 
+#undef FALSE
+#undef TRUE
+
 namespace Dali
 {
 
index b9b5044..84c9cdf 100644 (file)
@@ -61,7 +61,7 @@ namespace Integration
 namespace Log
 {
 
-thread_local LogFunction gthreadLocalLogFunction = NULL;
+thread_local LogFunction gthreadLocalLogFunction = nullptr;
 
 /* Forward declarations */
 std::string FormatToString(const char *format, ...);
@@ -92,7 +92,7 @@ void InstallLogFunction(const LogFunction& logFunction)
 
 void UninstallLogFunction()
 {
-  gthreadLocalLogFunction = NULL;
+  gthreadLocalLogFunction = nullptr;
 }
 
 #ifdef DEBUG_ENABLED
@@ -101,11 +101,11 @@ void UninstallLogFunction()
 Filter* Filter::gRender     = Filter::New(Debug::Concise, false, "LOG_RENDER");
 Filter* Filter::gResource   = Filter::New(Debug::Concise, false, "LOG_RESOURCE");
 Filter* Filter::gGLResource = Filter::New(Debug::Concise, false, "LOG_GL_RESOURCE");
-Filter* Filter::gObject     = NULL;
+Filter* Filter::gObject     = nullptr;
 Filter* Filter::gImage      = Filter::New(Debug::Concise, false, "LOG_IMAGE");
 Filter* Filter::gModel      = Filter::New(Debug::Concise, false, "LOG_MODEL");
-Filter* Filter::gNode       = NULL;
-Filter* Filter::gElement    = NULL;
+Filter* Filter::gNode       = nullptr;
+Filter* Filter::gElement    = nullptr;
 Filter* Filter::gActor      = Filter::New(Debug::Concise, false, "LOG_ACTOR");
 Filter* Filter::gShader     = Filter::New(Debug::Concise, false, "LOG_SHADER");
 
@@ -179,7 +179,7 @@ void Filter::Log(LogLevel level, const char* format, ...)
 
     if( mTraceEnabled )
     {
-      char *buffer = NULL;
+      char *buffer = nullptr;
       int numChars = asprintf( &buffer, "    %-*c %s", mNesting, ':', format );
       if( numChars >= 0 ) // No error
       {
@@ -226,7 +226,6 @@ TraceObj::~TraceObj()
 
 #endif // DEBUG_ENABLED
 
-
 std::string ArgListToString(const char *format, va_list args)
 {
   std::string str; // empty string
index 807c0d0..d1313a8 100755 (executable)
@@ -142,7 +142,7 @@ DALI_CORE_API void UninstallLogFunction();
 /**
  * Provides unfiltered logging for global warning level messages
  */
-#define DALI_LOG_WARNING(format, ...)   Dali::Integration::Log::LogMessage(Dali::Integration::Log::DebugWarning, "%s " format, __PRETTY_FUNCTION__, ## __VA_ARGS__)
+#define DALI_LOG_WARNING(format, ...)   Dali::Integration::Log::LogMessage(Dali::Integration::Log::DebugWarning, "%s " format, ASSERT_LOCATION, ## __VA_ARGS__)
 
 
 #else // DEBUG_ENABLED
@@ -354,10 +354,10 @@ public:
 
 
 #define DALI_LOG_TRACE_METHOD_FMT(filter, format, ...)                 \
-  Dali::Integration::Log::TraceObj debugTraceObj(filter, "%s: " format, __PRETTY_FUNCTION__, ## __VA_ARGS__)
+  Dali::Integration::Log::TraceObj debugTraceObj(filter, "%s: " format, ASSERT_LOCATION, ## __VA_ARGS__)
 
 #define DALI_LOG_TRACE_METHOD(filter)                                      \
-  Dali::Integration::Log::TraceObj debugTraceObj(filter, __PRETTY_FUNCTION__)
+  Dali::Integration::Log::TraceObj debugTraceObj(filter, ASSERT_LOCATION)
 
 
 #else // DEBUG_ENABLED
index e03ced4..a6d44bf 100644 (file)
@@ -1,7 +1,7 @@
 # Set the source directory
 SET( platform_abstraction_src_dir ${ROOT_SRC_DIR}/dali/integration-api )
 
-# Add platform abstraction headers here
+# Add platform abstraction source files here
 SET( platform_abstraction_src_files
    ${platform_abstraction_src_dir}/bitmap.cpp
    ${platform_abstraction_src_dir}/core.cpp
index 54eb9fb..b432b9e 100644 (file)
@@ -120,6 +120,12 @@ void SetPinchGestureMinimumDistance( float value )
   eventProcessor.SetPinchGestureMinimumDistance( value );
 }
 
+void SetLongPressMinimumHoldingTime( unsigned int value )
+{
+  GestureEventProcessor& eventProcessor = ThreadLocalStorage::Get().GetGestureEventProcessor();
+  eventProcessor.SetLongPressMinimumHoldingTime( value );
+}
+
 
 } // namespace Integration
 
index 464eff7..f4df355 100644 (file)
@@ -163,6 +163,14 @@ DALI_CORE_API void SetPanGestureMinimumPanEvents( int value );
  * @param[in] value Distance to move in pixels
  */
 DALI_CORE_API void SetPinchGestureMinimumDistance( float value );
+
+/**
+ * @brief Sets the minimum holding time required to be recognized as a long press gesture
+ *
+ * @param[in] value The time value in milliseconds
+ */
+DALI_CORE_API void SetLongPressMinimumHoldingTime( unsigned int value );
+
 } // namespace Integration
 
 } // namespace Dali
index c884a71..fe9a3bd 100644 (file)
@@ -198,7 +198,7 @@ namespace
  * Used for function tracing. It logs tracing of the fuction from start to end.
  */
 #define DALI_TRACE_FUNCTION( filter ) \
-  Dali::Integration::Trace::Tracer logTraceFunction( filter, __PRETTY_FUNCTION__ );
+  Dali::Integration::Trace::Tracer logTraceFunction( filter, ASSERT_LOCATION );
 
 /**
  * Used for scope tracing. It logs tracing around a scope.
index 44a9e89..23c7977 100644 (file)
@@ -4638,15 +4638,8 @@ void Actor::SetPreferredSize( const Vector2& size )
 {
   EnsureRelayoutData();
 
-  if( size.width > 0.0f )
-  {
-    SetResizePolicy( ResizePolicy::FIXED, Dimension::WIDTH );
-  }
-
-  if( size.height > 0.0f )
-  {
-    SetResizePolicy( ResizePolicy::FIXED, Dimension::HEIGHT );
-  }
+  SetResizePolicy( ResizePolicy::FIXED, Dimension::WIDTH );
+  SetResizePolicy( ResizePolicy::FIXED, Dimension::HEIGHT );
 
   mRelayoutData->preferredSize = size;
 
similarity index 60%
rename from dali/internal/event/common/demangler.cpp
rename to dali/internal/event/common/demangler-unix.cpp
index 5a2caed..07a63a1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
  *
  */
 
-//
-// gcc and clang minimal demangling
-// Both follow Itanium C++ ABI
-//
-// We only decode namespaces and class typeid names for simplicity as its all we need.
-//
-// From http://mentorembedded.github.io/cxx-abi/abi.html#mangling-structure
-//
-// <nested-name> ::= N [<CV-qualifiers>] <prefix> <unqualified-name> E
-//     ::= N [<CV-qualifiers>] <template-prefix> <template-args> E
-//
-// <prefix> ::= <prefix> <unqualified-name>
-//     ::= <template-prefix> <template-args>
-//          ::= <template-param>
-//          ::= <decltype>
-//     ::= # empty
-//     ::= <substitution>
-//          ::= <prefix> <data-member-prefix>
-//
-// <template-prefix> ::= <prefix> <template unqualified-name>
-//                   ::= <template-param>
-//                   ::= <substitution>
-// <unqualified-name> ::= <operator-name>
-//                    ::= <ctor-dtor-name>
-//                    ::= <source-name>
-//                    ::= <unnamed-type-name>
-//
-// <source-name> ::= <positive length number> <identifier>
-// <number> ::= [n] <non-negative decimal integer>
-// <identifier> ::= <unqualified source code identifier>
-//
-// So for example
-//
-// Dali::Internal::Actor would be
-//
-//   N4Dali8Internal5ActorE
-//
-
-// CLASS HEADER
+// FILE HEADER
 #include <dali/internal/event/common/demangler.h>
 
+// INTERNAL HEADERS
+#include <dali/public-api/common/vector-wrapper.h>
+
 namespace
 {
 
@@ -98,21 +63,17 @@ size_t GetNumberOfCharacters(const std::string& s, const size_t& start, int& res
   return i - start;
 }
 
-} // anon namespace
-
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-#if defined(__clang__) || defined(__GNUC__)
-
-// Demangle class name mangled according to the Itanium C++ ABI
-// Returns demangled names ie "N4Dali8Internal5ActorE" is ["Dali","Internal","Actor"]
+/**
+ * @brief Demangle a nested typeid name into its component parts.
+ * A nested type name is one containing namespaces and class names only.
+ *   eg DemangleNestedNames(typeid(Dali::Actor).name());
+ * @param[in] typeIdName The type id name string to demangle.
+ * @returns the demangled list of names ie ["Dali","Actor"] or an empty list
+ */
 std::vector<std::string> DemangleNestedNames(const char *typeIdName)
 {
+  // Demangle class name mangled according to the Itanium C++ ABI
+  // Returns demangled names ie "N4Dali8Internal5ActorE" is ["Dali","Internal","Actor"]
   std::vector<std::string> ret;
 
   const std::string mangledName(typeIdName);
@@ -143,10 +104,13 @@ std::vector<std::string> DemangleNestedNames(const char *typeIdName)
   return ret;
 }
 
-#else
-# error Unsupported Compiler
-#endif
+} // anon namespace
 
+namespace Dali
+{
+
+namespace Internal
+{
 
 const std::string DemangleClassName(const char *typeIdName)
 {
diff --git a/dali/internal/event/common/demangler-windows.cpp b/dali/internal/event/common/demangler-windows.cpp
new file mode 100644 (file)
index 0000000..9d6612a
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2019 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.
+ *
+ */
+
+// FILE HEADER
+#include <dali/internal/event/common/demangler.h>
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+const std::string DemangleClassName(const char *typeIdName)
+{
+  std::string name = typeIdName;
+  int index = name.find_last_of(' ');
+
+  if( 0 <= index )
+  {
+    name = name.substr( index + 1, name.size() - index );
+  }
+
+  index = name.find_last_of(':');
+
+  if( 0 <= index )
+  {
+    name = name.substr(index + 1, name.size() - index);
+  }
+
+  return name;
+}
+
+} // namespace Internal
+
+} // namespace Dali
index 3e63ac8..4d9790b 100644 (file)
@@ -21,9 +21,6 @@
 // EXTERNAL INCLUDES
 #include <string>
 
-// INTERNAL INCLUDES
-#include <dali/public-api/common/vector-wrapper.h>
-
 namespace Dali
 {
 
@@ -31,16 +28,7 @@ namespace Internal
 {
 
 /**
- * Demangle a nested typeid name into its component parts.
- * A nested type name is one containing namespaces and class names only.
- *   eg DemangleNestedNames(typeid(Dali::Actor).name());
- * @param[in] typeIdName The type id name string to demangle.
- * @returns the demangled list of names ie ["Dali","Actor"] or an empty list
- */
-std::vector<std::string> DemangleNestedNames(const char *typeIdName);
-
-/**
- * Demangle a nested typeid name to its class name.
+ * @brief Demangle a nested typeid name to its class name.
  * @param[in] typeIdName The type id name string to demangle.
  * @returns the class name ie "Actor" or an empty string
  */
index c14470d..69b0724 100644 (file)
@@ -303,7 +303,8 @@ void Scene::SetBackgroundColor( const Vector4& color )
 
   if( mSurface )
   {
-    mRenderTaskList->GetTask( 0u )->GetFrameBuffer()->SetBackgroundColor( color );
+    mRenderTaskList->GetTask( 0u )->SetClearColor( color );
+    mRenderTaskList->GetTask( 0u )->SetClearEnabled( true );
   }
 }
 
index 2495d5f..99c3337 100644 (file)
 #include <dali/internal/event/common/type-registry-impl.h>
 
 // INTERNAL INCLUDES
-#include <dali/internal/event/common/thread-local-storage.h>
 #include <dali/public-api/object/type-registry.h>
 #include <dali/public-api/object/base-handle.h>
 #include <dali/internal/event/actors/custom-actor-internal.h>
 #include <dali/internal/event/common/demangler.h>
+#include <dali/internal/event/common/thread-local-storage.h>
 
 #include <dali/integration-api/debug.h>
 
@@ -39,8 +39,6 @@ Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_TYP
 namespace Dali
 {
 
-extern std::string Demangle(const char* symbol);
-
 namespace Internal
 {
 
index fbfad1b..04863ff 100644 (file)
@@ -321,6 +321,16 @@ void GestureEventProcessor::SetPinchGestureMinimumDistance( float value)
   mPinchGestureProcessor.SetMinimumPinchDistance( value );
 }
 
+void GestureEventProcessor::SetLongPressMinimumHoldingTime( uint32_t value )
+{
+  mLongPressGestureProcessor.SetMinimumHoldingTime( value );
+}
+
+uint32_t GestureEventProcessor::GetLongPressMinimumHoldingTime() const
+{
+  return mLongPressGestureProcessor.GetMinimumHoldingTime();
+}
+
 const PanGestureProcessor& GestureEventProcessor::GetPanGestureProcessor()
 {
   return mPanGestureProcessor;
index a181588..9ae5d6f 100644 (file)
@@ -252,6 +252,18 @@ public: // Called by Core
    */
   void SetPinchGestureMinimumDistance( float value);
 
+  /**
+   * @brief Sets the minimum holding time required to be recognized as a long press gesture
+   *
+   * @param[in] value The time value in milliseconds
+   */
+  void SetLongPressMinimumHoldingTime( uint32_t value );
+
+  /**
+   * @return The minimum holding time required to be recognized as a long press gesture in milliseconds
+   */
+  uint32_t GetLongPressMinimumHoldingTime() const;
+
 public: // needed for PanGesture
 
   /**
index d7f1778..21adbe5 100644 (file)
@@ -173,6 +173,11 @@ void LongPressGestureDetector::OnActorDestroyed(Object& object)
   // Do nothing
 }
 
+uint32_t LongPressGestureDetector::GetMinimumHoldingTime() const
+{
+  return mGestureEventProcessor.GetLongPressMinimumHoldingTime();
+}
+
 } // namespace Internal
 
 } // namespace Dali
index b049433..561012b 100644 (file)
@@ -97,6 +97,11 @@ public:
    */
   unsigned int GetMaximumTouchesRequired() const;
 
+  /**
+   * @return The minimum holding time required to be recognized as a long press gesture in milliseconds
+   */
+  uint32_t GetMinimumHoldingTime() const;
+
 public:
 
   /**
index e08d7e8..d9a2914 100644 (file)
@@ -42,6 +42,8 @@ namespace Internal
 namespace
 {
 
+const unsigned long DEFAULT_MINIMUM_HOLDING_TIME = 500u;
+
 /**
  * Creates a LongPressGesture and asks the specified detector to emit its detected signal.
  * @param[in]  actor             The actor on which the long press gesture has occurred.
@@ -106,7 +108,8 @@ LongPressGestureProcessor::LongPressGestureProcessor()
   mCurrentRenderTask(),
   mMinTouchesRequired( 1 ),
   mMaxTouchesRequired( 1 ),
-  mCurrentLongPressEvent( NULL )
+  mCurrentLongPressEvent( NULL ),
+  mMinimumHoldingTime( DEFAULT_MINIMUM_HOLDING_TIME )
 {
 }
 
@@ -230,7 +233,7 @@ void LongPressGestureProcessor::AddGestureDetector( LongPressGestureDetector* ge
 
     Size size = scene.GetSize();
 
-    mGestureRecognizer = new LongPressGestureRecognizer(*this, Vector2(size.width, size.height), static_cast<const LongPressGestureRequest&>(request));
+    mGestureRecognizer = new LongPressGestureRecognizer(*this, Vector2(size.width, size.height), static_cast<const LongPressGestureRequest&>(request), mMinimumHoldingTime );
   }
   else
   {
@@ -264,6 +267,28 @@ void LongPressGestureProcessor::GestureDetectorUpdated( LongPressGestureDetector
   UpdateDetection();
 }
 
+void LongPressGestureProcessor::SetMinimumHoldingTime( uint32_t time )
+{
+  if( time > 0u && mMinimumHoldingTime != time )
+  {
+    mMinimumHoldingTime = time;
+
+    if( mGestureRecognizer )
+    {
+      LongPressGestureRecognizer* longPressRecognizer = dynamic_cast<LongPressGestureRecognizer*>( mGestureRecognizer.Get() );
+      if( longPressRecognizer )
+      {
+        longPressRecognizer->SetMinimumHoldingTime( time );
+      }
+    }
+  }
+}
+
+uint32_t LongPressGestureProcessor::GetMinimumHoldingTime() const
+{
+  return mMinimumHoldingTime;
+}
+
 void LongPressGestureProcessor::UpdateDetection()
 {
   DALI_ASSERT_DEBUG(!mLongPressGestureDetectors.empty());
index 4933c46..8026167 100644 (file)
@@ -88,6 +88,18 @@ public: // To be called by GestureEventProcessor
    */
   void GestureDetectorUpdated(LongPressGestureDetector* gestureDetector);
 
+  /**
+   * @brief This method sets the minimum holding time required to be recognized as a long press gesture
+   *
+   * @param[in] value The time value in milliseconds
+   */
+  void SetMinimumHoldingTime( uint32_t time );
+
+  /**
+   * @return The minimum holding time required to be recognized as a long press gesture in milliseconds
+   */
+  uint32_t GetMinimumHoldingTime() const;
+
 private:
 
   // Undefined
@@ -130,6 +142,8 @@ private:
   uint32_t mMaxTouchesRequired;
 
   const LongPressGestureEvent* mCurrentLongPressEvent; ///< Pointer to current longPressEvent, used when calling ProcessAndEmit()
+
+  uint32_t mMinimumHoldingTime;
 };
 
 } // namespace Internal
index 6e0b24d..1d5d116 100644 (file)
@@ -39,18 +39,18 @@ namespace
 {
 // TODO: Set these according to DPI
 const float MAXIMUM_MOTION_ALLOWED = 60.0f;
-// TODO: Set this time according to system setting (vconf)
-const unsigned long LONG_PRESS_TIME = 500u;
+
 } // unnamed namespace
 
-LongPressGestureRecognizer::LongPressGestureRecognizer(Observer& observer, Vector2 screenSize, const LongPressGestureRequest& request )
+LongPressGestureRecognizer::LongPressGestureRecognizer(Observer& observer, Vector2 screenSize, const LongPressGestureRequest& request, uint32_t minimumHoldingTime )
 : GestureRecognizer( screenSize, Gesture::LongPress ),
   mObserver( observer ),
   mState( Clear ),
   mMinimumTouchesRequired( request.minTouches ),
   mMaximumTouchesRequired( request.maxTouches ),
   mTouchTime( 0 ),
-  mTimerId( 0 )
+  mTimerId( 0 ),
+  mMinimumHoldingTime( minimumHoldingTime )
 {
 }
 
@@ -77,7 +77,7 @@ void LongPressGestureRecognizer::SendEvent(const Integration::TouchEvent& event)
 
         mTouchTime = event.time;
 
-        mTimerId = platformAbstraction.StartTimer(GetSystemValue(), MakeCallback( this, &LongPressGestureRecognizer::TimerCallback));
+        mTimerId = platformAbstraction.StartTimer( mMinimumHoldingTime, MakeCallback( this, &LongPressGestureRecognizer::TimerCallback ) );
 
         // A long press gesture may be possible, tell Core about this and change state to Touched.
         mState = Touched;
@@ -186,6 +186,12 @@ void LongPressGestureRecognizer::Update(const GestureRequest& request)
   mMaximumTouchesRequired = longPress.maxTouches;
 }
 
+void LongPressGestureRecognizer::SetMinimumHoldingTime( uint32_t time )
+{
+  mMinimumHoldingTime = time;
+}
+
+
 bool LongPressGestureRecognizer::TimerCallback()
 {
   EmitGesture(Gesture::Started);
@@ -217,7 +223,7 @@ void LongPressGestureRecognizer::EmitGesture(Gesture::State state)
     longPress.time = mTouchTime;
     if ( state != Gesture::Possible )
     {
-      longPress.time += GetSystemValue();
+      longPress.time += mMinimumHoldingTime;
     }
 
     if( mScene )
@@ -230,11 +236,6 @@ void LongPressGestureRecognizer::EmitGesture(Gesture::State state)
   }
 }
 
-int LongPressGestureRecognizer::GetSystemValue()
-{
-  return LONG_PRESS_TIME;
-}
-
 } // namespace Internal
 
 } // namespace Dali
index 7bcab05..cb2cbfa 100644 (file)
@@ -56,8 +56,9 @@ public:
    * @param[in] coreEventInterface Used to send events to Core.
    * @param[in] screenSize  The size of the screen.
    * @param[in] request     The long press gesture request.
+   * @param[in] minimumHoldingTime The minimum holding time required in milliseconds.
    */
-  LongPressGestureRecognizer( Observer& observer, Vector2 screenSize, const LongPressGestureRequest& request );
+  LongPressGestureRecognizer( Observer& observer, Vector2 screenSize, const LongPressGestureRequest& request, uint32_t minimumHoldingTime );
 
   /**
    * Virtual destructor.
@@ -76,6 +77,13 @@ public:
    */
   virtual void Update(const GestureRequest& request);
 
+  /**
+   * @brief This method sets the minimum holding time required to be recognized as a long press gesture
+   *
+   * @param[in] value The time value in milliseconds
+   */
+  void SetMinimumHoldingTime( uint32_t time );
+
 private:
 
   /**
@@ -90,12 +98,6 @@ private:
    */
   void EmitGesture(Gesture::State state);
 
-  /**
-   * Get current system setting value for tap and hold gesture
-   * @return system value for tap and hold gesture [ms]
-   */
-  int GetSystemValue();
-
 private:
 
   // Reference to the gesture processor for this recognizer
@@ -121,6 +123,8 @@ private:
   uint32_t mTouchTime;               ///< The time we first pressed down.
 
   uint32_t mTimerId;
+
+  uint32_t mMinimumHoldingTime;
 };
 
 } // namespace Internal
index 33afe35..1703fd7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
@@ -53,10 +53,11 @@ Render::FrameBuffer* FrameBuffer::GetRenderObject() const
 FrameBuffer::FrameBuffer( uint32_t width, uint32_t height, Mask attachments )
 : mEventThreadServices( EventThreadServices::Get() ),
   mRenderObject( NULL ),
-  mColor( NULL ),
+  mColor{ nullptr },
   mWidth( width ),
   mHeight( height ),
   mAttachments( attachments ),
+  mColorAttachmentCount( 0 ),
   mIsSurfaceBacked( false )
 {
 }
@@ -88,22 +89,28 @@ void FrameBuffer::AttachColorTexture( TexturePtr texture, uint32_t mipmapLevel,
   }
   else
   {
-    if( ( texture->GetWidth() / ( 1u << mipmapLevel ) == mWidth ) &&
-        ( texture->GetHeight() / ( 1u << mipmapLevel ) == mHeight ) )
+    if( ( texture->GetWidth() / ( 1u << mipmapLevel ) != mWidth ) ||
+        ( texture->GetHeight() / ( 1u << mipmapLevel ) != mHeight ) )
     {
-      mColor = texture;
-      AttachColorTextureToFrameBuffer( mEventThreadServices.GetUpdateManager(), *mRenderObject, texture->GetRenderObject(), mipmapLevel, layer );
+      DALI_LOG_ERROR( "Failed to attach color texture to FrameBuffer: Size mismatch \n" );
+    }
+    else if ( mColorAttachmentCount >= Dali::DevelFrameBuffer::MAX_COLOR_ATTACHMENTS )
+    {
+      DALI_LOG_ERROR( "Failed to attach color texture to FrameBuffer: Exceeded maximum supported color attachments.\n" );
     }
     else
     {
-      DALI_LOG_ERROR( "Failed to attach color texture to FrameBuffer: Size mismatch \n" );
+      mColor[mColorAttachmentCount] = texture;
+      ++mColorAttachmentCount;
+
+      AttachColorTextureToFrameBuffer( mEventThreadServices.GetUpdateManager(), *mRenderObject, texture->GetRenderObject(), mipmapLevel, layer );
     }
   }
 }
 
-Texture* FrameBuffer::GetColorTexture()
+Texture* FrameBuffer::GetColorTexture(uint8_t index) const
 {
-  return mIsSurfaceBacked ? nullptr : mColor.Get();
+  return ( mIsSurfaceBacked || index >= mColorAttachmentCount ) ? nullptr : mColor[index].Get();
 }
 
 void FrameBuffer::SetSize( uint32_t width, uint32_t height )
@@ -117,14 +124,6 @@ void FrameBuffer::SetSize( uint32_t width, uint32_t height )
   }
 }
 
-void FrameBuffer::SetBackgroundColor( const Vector4& color )
-{
-  if( mRenderObject->IsSurfaceBacked() )
-  {
-    SetFrameBufferBackgroundColorMessage( mEventThreadServices.GetUpdateManager(), static_cast<Render::SurfaceFrameBuffer*>( mRenderObject ), color );
-  }
-}
-
 void FrameBuffer::MarkSurfaceAsInvalid()
 {
   if ( mIsSurfaceBacked )
index 8484948..e30c285 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_FRAME_BUFFER_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
@@ -23,6 +23,7 @@
 #include <dali/public-api/common/intrusive-ptr.h> // Dali::IntrusivePtr
 #include <dali/public-api/object/base-object.h>
 #include <dali/public-api/rendering/frame-buffer.h>
+#include <dali/devel-api/rendering/frame-buffer-devel.h>
 #include <dali/internal/event/common/event-thread-services.h>
 #include <dali/internal/event/rendering/texture-impl.h>
 
@@ -89,7 +90,7 @@ public:
   /**
    * @copydoc Dali::FrameBuffer::GetColorTexture()
    */
-  Texture* GetColorTexture();
+  Texture* GetColorTexture(uint8_t index) const;
 
   /**
    * @brief Sets the frame buffer size.
@@ -99,12 +100,6 @@ public:
   void SetSize( uint32_t width, uint32_t height );
 
   /**
-   * @brief Sets the background color
-   * @param[in] color The new background color
-   */
-  void SetBackgroundColor( const Vector4& color );
-
-  /**
    * @brief Mark the render surface as invalid
    *
    * The render surface is maked as invalid when it is deleted.
@@ -142,10 +137,11 @@ private: // data
   Internal::EventThreadServices& mEventThreadServices; ///< Used to send messages to the render thread via update thread
   Internal::Render::FrameBuffer* mRenderObject;        ///< The Render::Texture associated to this texture
 
-  TexturePtr mColor;
+  TexturePtr mColor[ Dali::DevelFrameBuffer::MAX_COLOR_ATTACHMENTS ];
   uint32_t mWidth;
   uint32_t mHeight;
   Mask mAttachments;                           ///< Bit-mask of type FrameBuffer::Attachment::Mask
+  uint8_t mColorAttachmentCount;
 
   bool mIsSurfaceBacked:1;
 
diff --git a/dali/internal/file-unix.list b/dali/internal/file-unix.list
new file mode 100644 (file)
index 0000000..23fe533
--- /dev/null
@@ -0,0 +1,11 @@
+# Set the source directory
+SET( internal_src_dir ${ROOT_SRC_DIR}/dali/internal )
+
+# Add internal unix source files here
+SET( internal_unix_src_files
+  ${internal_src_dir}/event/common/demangler-unix.cpp
+)
+
+SET( SOURCES ${SOURCES}
+  ${internal_unix_src_files}
+)
\ No newline at end of file
diff --git a/dali/internal/file-windows.list b/dali/internal/file-windows.list
new file mode 100644 (file)
index 0000000..c636840
--- /dev/null
@@ -0,0 +1,11 @@
+# Set the source directory
+SET( internal_src_dir ${ROOT_SRC_DIR}/dali/internal )
+
+# Add internal windows source files here
+SET( internal_windows_src_files
+  ${internal_src_dir}/event/common/demangler-windows.cpp
+)
+
+SET( SOURCES ${SOURCES}
+  ${internal_windows_src_files}
+)
\ No newline at end of file
index 9bb1751..969d49a 100644 (file)
@@ -26,7 +26,6 @@ SET( internal_src_files
   ${internal_src_dir}/event/animation/linear-constrainer-impl.cpp
   ${internal_src_dir}/event/animation/path-impl.cpp
   ${internal_src_dir}/event/animation/path-constrainer-impl.cpp
-  ${internal_src_dir}/event/common/demangler.cpp
   ${internal_src_dir}/event/common/event-thread-services.cpp
   ${internal_src_dir}/event/common/notification-manager.cpp
   ${internal_src_dir}/event/common/object-impl.cpp
@@ -160,7 +159,6 @@ SET( internal_src_files
   ${internal_src_dir}/update/rendering/scene-graph-renderer.cpp
 )
 
-
 SET( SOURCES ${SOURCES}
   ${internal_src_files}
 )
index a3e6db9..35167ed 100644 (file)
@@ -80,7 +80,6 @@ struct RenderManager::Impl
     renderQueue(),
     instructions(),
     renderAlgorithms(),
-    backgroundColor( Dali::Stage::DEFAULT_BACKGROUND_COLOR ),
     frameCount( 0u ),
     renderBufferIndex( SceneGraphBuffers::INITIAL_UPDATE_BUFFER_INDEX ),
     defaultSurfaceRect(),
@@ -148,8 +147,6 @@ struct RenderManager::Impl
   RenderInstructionContainer                instructions;
   Render::RenderAlgorithms                  renderAlgorithms;        ///< The RenderAlgorithms object is used to action the renders required by a RenderInstruction
 
-  Vector4                                   backgroundColor;         ///< The glClear color used at the beginning of each frame.
-
   uint32_t                                  frameCount;              ///< The current frame count
   BufferIndex                               renderBufferIndex;       ///< The index of the buffer to read from; this is opposite of the "update" buffer
 
@@ -249,11 +246,6 @@ RenderInstructionContainer& RenderManager::GetRenderInstructionContainer()
   return mImpl->instructions;
 }
 
-void RenderManager::SetBackgroundColor( const Vector4& color )
-{
-  mImpl->backgroundColor = color;
-}
-
 void RenderManager::SetDefaultSurfaceRect(const Rect<int32_t>& rect)
 {
   mImpl->defaultSurfaceRect = rect;
@@ -605,7 +597,6 @@ void RenderManager::DoRender( RenderInstruction& instruction )
   }
 
   Rect<int32_t> surfaceRect = mImpl->defaultSurfaceRect;
-  Vector4 backgroundColor = mImpl->backgroundColor;
   Integration::DepthBufferAvailable depthBufferAvailable = mImpl->depthBufferAvailable;
   Integration::StencilBufferAvailable stencilBufferAvailable = mImpl->stencilBufferAvailable;
 
@@ -637,7 +628,6 @@ void RenderManager::DoRender( RenderInstruction& instruction )
       }
 
       surfaceRect = Rect<int32_t>( 0, 0, static_cast<int32_t>( surfaceFrameBuffer->GetWidth() ), static_cast<int32_t>( surfaceFrameBuffer->GetHeight() ) );
-      backgroundColor = surfaceFrameBuffer->GetBackgroundColor();
     }
     else
     {
@@ -665,7 +655,10 @@ void RenderManager::DoRender( RenderInstruction& instruction )
     {
       // For each offscreen buffer, update the dependency list with the new texture id used by this frame buffer.
       Render::TextureFrameBuffer* textureFrameBuffer = static_cast<Render::TextureFrameBuffer*>( instruction.mFrameBuffer );
-      mImpl->textureDependencyList.PushBack( textureFrameBuffer->GetTextureId() );
+      for (unsigned int i0 = 0, i1 = textureFrameBuffer->GetColorAttachmentCount(); i0 < i1; ++i0)
+      {
+        mImpl->textureDependencyList.PushBack( textureFrameBuffer->GetTextureId(i0) );
+      }
     }
   }
   else
@@ -679,20 +672,12 @@ void RenderManager::DoRender( RenderInstruction& instruction )
                               surfaceRect.y,
                               surfaceRect.width,
                               surfaceRect.height );
-
-    mImpl->currentContext->ClearColor( backgroundColor.r,
-                                backgroundColor.g,
-                                backgroundColor.b,
-                                backgroundColor.a );
   }
 
   // Clear the entire color, depth and stencil buffers for the default framebuffer, if required.
   // It is important to clear all 3 buffers when they are being used, for performance on deferred renderers
   // e.g. previously when the depth & stencil buffers were NOT cleared, it caused the DDK to exceed a "vertex count limit",
   // and then stall. That problem is only noticeable when rendering a large number of vertices per frame.
-
-  mImpl->currentContext->SetScissorTest( false );
-
   GLbitfield clearMask = GL_COLOR_BUFFER_BIT;
 
   mImpl->currentContext->ColorMask( true );
@@ -710,8 +695,6 @@ void RenderManager::DoRender( RenderInstruction& instruction )
     clearMask |= GL_STENCIL_BUFFER_BIT;
   }
 
-  mImpl->currentContext->Clear( clearMask, Context::FORCE_CLEAR );
-
   if( !instruction.mIgnoreRenderToFbo && ( instruction.mFrameBuffer != 0 ) )
   {
     if ( instruction.mFrameBuffer->IsSurfaceBacked() ) // Surface rendering
@@ -764,21 +747,34 @@ void RenderManager::DoRender( RenderInstruction& instruction )
     }
   }
 
+  bool clearFullFrameRect = true;
+  if( instruction.mFrameBuffer != 0 )
+  {
+    Viewport frameRect( 0, 0, instruction.mFrameBuffer->GetWidth(), instruction.mFrameBuffer->GetHeight() );
+    clearFullFrameRect = ( frameRect == viewportRect );
+  }
+  else
+  {
+    clearFullFrameRect = ( surfaceRect == viewportRect );
+  }
+
   mImpl->currentContext->Viewport(viewportRect.x, viewportRect.y, viewportRect.width, viewportRect.height);
+  mImpl->currentContext->ClearColor( clearColor.r,
+                                     clearColor.g,
+                                     clearColor.b,
+                                     clearColor.a );
 
-  if ( instruction.mIsClearColorSet )
+  if( instruction.mIsClearColorSet && !clearFullFrameRect )
   {
-    mImpl->currentContext->ClearColor( clearColor.r,
-                                       clearColor.g,
-                                       clearColor.b,
-                                       clearColor.a );
-
-    // Clear the viewport area only
     mImpl->currentContext->SetScissorTest( true );
     mImpl->currentContext->Scissor( viewportRect.x, viewportRect.y, viewportRect.width, viewportRect.height );
-    mImpl->currentContext->ColorMask( true );
-    mImpl->currentContext->Clear( GL_COLOR_BUFFER_BIT , Context::CHECK_CACHED_VALUES );
+    mImpl->currentContext->Clear( clearMask, Context::FORCE_CLEAR );
+    mImpl->currentContext->SetScissorTest( false );
+  }
+  else
+  {
     mImpl->currentContext->SetScissorTest( false );
+    mImpl->currentContext->Clear( clearMask, Context::FORCE_CLEAR );
   }
 
   // Clear the list of bound textures
index cc70287..5aa90d8 100644 (file)
@@ -122,12 +122,6 @@ public:
 
   // The following methods should be called via RenderQueue messages
 
-  /**
-   * Set the background color i.e. the glClear color used at the beginning of each frame.
-   * @param[in] color The new background color.
-   */
-  void SetBackgroundColor( const Vector4& color );
-
   /*
    * Set the frame time delta (time elapsed since the last frame.
    * @param[in] deltaTime the delta time
index 7154ff6..396af00 100644 (file)
@@ -33,7 +33,6 @@ SurfaceFrameBuffer::SurfaceFrameBuffer( Integration::RenderSurface* surface )
   mContext( nullptr ),
   mWidth( mSurface->GetPositionSize().width ),
   mHeight( mSurface->GetPositionSize().height ),
-  mBackgroundColor( 0.f, 0.f, 0.f, 1.f ),
   mSizeChanged( false ),
   mIsSurfaceInvalid( false )
 {
@@ -119,11 +118,6 @@ void SurfaceFrameBuffer::MakeContextCurrent()
   }
 }
 
-Vector4 SurfaceFrameBuffer::GetBackgroundColor()
-{
-  return mBackgroundColor;
-}
-
 void SurfaceFrameBuffer::SetSize( uint32_t width, uint32_t height )
 {
   mWidth = width;
@@ -131,11 +125,6 @@ void SurfaceFrameBuffer::SetSize( uint32_t width, uint32_t height )
   mSizeChanged = true;
 }
 
-void SurfaceFrameBuffer::SetBackgroundColor( const Vector4& color )
-{
-  mBackgroundColor = color;
-}
-
 bool SurfaceFrameBuffer::IsSurfaceValid() const
 {
   return mSurface && !mIsSurfaceInvalid;
index edd667d..e08666c 100644 (file)
@@ -94,12 +94,6 @@ public:
   void SetSize( uint32_t width, uint32_t height );
 
   /**
-   * @brief Sets the background color.
-   * @param[in] color The new background color
-   */
-  void SetBackgroundColor( const Vector4& color );
-
-  /**
    * @copydoc Dali::Internal::FrameBuffer::MarkSurfaceAsInvalid()
    */
   void MarkSurfaceAsInvalid() { mIsSurfaceInvalid = true; };
@@ -129,12 +123,6 @@ public:
    */
   void MakeContextCurrent();
 
-  /**
-   * @brief Gets the background color of the surface.
-   * @return The background color
-   */
-  Vector4 GetBackgroundColor();
-
 private:
 
   Integration::RenderSurface* mSurface;   ///< The render surface
@@ -142,7 +130,6 @@ private:
 
   uint32_t                    mWidth;
   uint32_t                    mHeight;
-  Vector4                     mBackgroundColor;
   bool                        mSizeChanged;
   std::atomic<bool>           mIsSurfaceInvalid; ///< This is set only from the event thread and read only from the render thread
 };
@@ -159,17 +146,6 @@ inline void SetFrameBufferSizeMessage( SceneGraph::UpdateManager& updateManager,
   new (slot) LocalType( surfaceFrameBuffer, &SurfaceFrameBuffer::SetSize, width, height );
 }
 
-inline void SetFrameBufferBackgroundColorMessage( SceneGraph::UpdateManager& updateManager, SurfaceFrameBuffer* surfaceFrameBuffer, const Vector4& color )
-{
-  typedef MessageValue1< SurfaceFrameBuffer, Vector4 > LocalType;
-
-  // Reserve some memory inside the message queue
-  uint32_t* slot = updateManager.ReserveMessageSlot( sizeof( LocalType ) );
-
-  // Construct message in the message queue memory; note that delete should not be called on the return value
-  new (slot) LocalType( surfaceFrameBuffer, &SurfaceFrameBuffer::SetBackgroundColor, color );
-}
-
 } // namespace Render
 
 } // namespace Internal
index fb718fb..24a17f4 100644 (file)
@@ -26,15 +26,30 @@ namespace Internal
 {
 namespace Render
 {
+namespace
+{
+const GLenum COLOR_ATTACHMENTS[] =
+{
+    GL_COLOR_ATTACHMENT0,
+    GL_COLOR_ATTACHMENT1,
+    GL_COLOR_ATTACHMENT2,
+    GL_COLOR_ATTACHMENT3,
+    GL_COLOR_ATTACHMENT4,
+    GL_COLOR_ATTACHMENT5,
+    GL_COLOR_ATTACHMENT6,
+    GL_COLOR_ATTACHMENT7,
+};
+}
 
 TextureFrameBuffer::TextureFrameBuffer( uint32_t width, uint32_t height, Mask attachments )
 : FrameBuffer(),
   mId( 0u ),
-  mTextureId( 0u ),
+  mTextureId{ 0u },
   mDepthBuffer( attachments & Dali::FrameBuffer::Attachment::DEPTH ),
   mStencilBuffer( attachments & Dali::FrameBuffer::Attachment::STENCIL ),
   mWidth( width ),
-  mHeight( height )
+  mHeight( height ),
+  mColorAttachmentCount( 0u )
 {
 }
 
@@ -84,18 +99,24 @@ void TextureFrameBuffer::AttachColorTexture( Context& context, Render::Texture*
 {
   context.BindFramebuffer( GL_FRAMEBUFFER, mId );
 
-  mTextureId = texture->GetId();
+  const GLuint textureId = texture->GetId();
+  mTextureId[mColorAttachmentCount] = textureId;
 
   // Create a color attachment.
+  const GLenum iAttachment = COLOR_ATTACHMENTS[mColorAttachmentCount];
   if( texture->GetType() == TextureType::TEXTURE_2D )
   {
-    context.FramebufferTexture2D( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, texture->GetTarget(), mTextureId, mipmapLevel );
+    context.FramebufferTexture2D( GL_FRAMEBUFFER, iAttachment, texture->GetTarget(), textureId, mipmapLevel );
   }
   else
   {
-    context.FramebufferTexture2D( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_CUBE_MAP_POSITIVE_X + layer, mTextureId, mipmapLevel );
+    context.FramebufferTexture2D( GL_FRAMEBUFFER, iAttachment, GL_TEXTURE_CUBE_MAP_POSITIVE_X + layer, textureId, mipmapLevel );
   }
 
+  ++mColorAttachmentCount;
+  context.DrawBuffers(mColorAttachmentCount, COLOR_ATTACHMENTS);
+  DALI_ASSERT_DEBUG(context.CheckFramebufferStatus(GL_FRAMEBUFFER) == GL_FRAMEBUFFER_COMPLETE);
+
   context.BindFramebuffer( GL_FRAMEBUFFER, 0 );
 }
 
index 7eecced..5c297d9 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_RENDER_TEXTURE_FRAME_BUFFER_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
@@ -18,6 +18,7 @@
  */
 
 // INTERNAL INCLUDES
+#include <dali/devel-api/rendering/frame-buffer-devel.h>
 #include <dali/internal/render/renderers/render-frame-buffer.h>
 
 namespace Dali
@@ -84,27 +85,35 @@ public:
 
   /**
    * @brief Attach a texture for color rendering. Valid only for Framebuffers with COLOR attachments.
-   * param[in] context The GL context
+   * @param[in] context The GL context
    * @param[in] texture The texture that will be used as output when rendering
    * @param[in] mipmapLevel The mipmap of the texture to be attached
    * @param[in] layer Indicates which layer of a cube map or array texture to attach. Unused for 2D textures
+   * @note A maximum of Dali::FrameBuffer::MAX_COLOR_ATTACHMENTS are supported.
    */
   void AttachColorTexture( Context& context, Render::Texture* texture, uint32_t mipmapLevel, uint32_t layer );
 
   /**
-   * @brief Get the id of the texture binded to this frame buffer
-   * @return The texture id
+   * @brief Get the number of textures bound to this frame buffer as color attachments.
+   * @return The number of color attachments.
    */
-  GLuint GetTextureId() { return mTextureId; };
+  uint8_t GetColorAttachmentCount() const { return mColorAttachmentCount; }
+
+  /**
+   * @brief Get the id (OpenGL handle) of the texture bound to this frame buffer as color attachment @a index.
+   * @return The texture id.
+   */
+  GLuint GetTextureId(uint8_t index) { return mTextureId[index]; };
 
 private:
 
   GLuint mId;
-  GLuint mTextureId;
+  GLuint mTextureId[ Dali::DevelFrameBuffer::MAX_COLOR_ATTACHMENTS ];
   GLuint mDepthBuffer;
   GLuint mStencilBuffer;
   uint32_t mWidth;
   uint32_t mHeight;
+  uint8_t mColorAttachmentCount;
 };
 
 
index 9f07b69..9b1eae0 100644 (file)
@@ -1089,17 +1089,6 @@ uint32_t UpdateManager::KeepUpdatingCheck( float elapsedSeconds ) const
   return keepUpdatingRequest;
 }
 
-void UpdateManager::SetBackgroundColor( const Vector4& color )
-{
-  typedef MessageValue1< RenderManager, Vector4 > DerivedType;
-
-  // Reserve some memory inside the render queue
-  uint32_t* slot = mImpl->renderQueue.ReserveMessageSlot( mSceneGraphBuffers.GetUpdateBufferIndex(), sizeof( DerivedType ) );
-
-  // Construct message in the render queue memory; note that delete should not be called on the return value
-  new (slot) DerivedType( &mImpl->renderManager, &RenderManager::SetBackgroundColor, color );
-}
-
 void UpdateManager::SetDefaultSurfaceRect( const Rect<int32_t>& rect )
 {
   mImpl->surfaceRectChanged = true;
index 039e054..a11fc40 100644 (file)
@@ -594,12 +594,6 @@ public:
                    bool isRenderingToFbo );
 
   /**
-   * Set the background color i.e. the glClear color used at the beginning of each frame.
-   * @param[in] color The new background color.
-   */
-  void SetBackgroundColor(const Vector4& color);
-
-  /**
    * Set the default surface rect.
    * @param[in] rect The rect value representing the surface.
    */
@@ -1008,17 +1002,6 @@ inline void SetShaderProgramMessage( UpdateManager& manager,
   new (slot) LocalType( &manager, &UpdateManager::SetShaderProgram, const_cast<Shader*>( &shader ), shaderData, modifiesGeometry );
 }
 
-inline void SetBackgroundColorMessage( UpdateManager& manager, const Vector4& color )
-{
-  typedef MessageValue1< UpdateManager, Vector4 > LocalType;
-
-  // Reserve some memory inside the message queue
-  uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
-
-  // Construct message in the message queue memory; note that delete should not be called on the return value
-  new (slot) LocalType( &manager, &UpdateManager::SetBackgroundColor, color );
-}
-
 inline void SetDefaultSurfaceRectMessage( UpdateManager& manager, const Rect<int32_t>& rect  )
 {
   typedef MessageValue1< UpdateManager, Rect<int32_t> > LocalType;
index c7e3215..d5424f8 100755 (executable)
@@ -169,7 +169,11 @@ public:
  * @SINCE_1_0.0
  */
 #if defined(DEBUG_ENABLED)
+#if defined(WIN32)
+#define ASSERT_LOCATION __FUNCSIG__
+#else
 #define ASSERT_LOCATION __PRETTY_FUNCTION__
+#endif
 #else
 #define ASSERT_LOCATION NULL
 #endif
index 7a152d2..cfb03df 100644 (file)
@@ -28,7 +28,7 @@ namespace Dali
 
 const uint32_t CORE_MAJOR_VERSION = 1;
 const uint32_t CORE_MINOR_VERSION = 4;
-const uint32_t CORE_MICRO_VERSION = 54;
+const uint32_t CORE_MICRO_VERSION = 55;
 const char * const CORE_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index 89b0a53..2ddd912 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
@@ -110,7 +110,7 @@ void FrameBuffer::AttachColorTexture( Texture& texture, uint32_t mipmapLevel, ui
 
 Texture FrameBuffer::GetColorTexture()
 {
-  Internal::Texture* texturePtr = GetImplementation(*this).GetColorTexture();
+  Internal::Texture* texturePtr = GetImplementation(*this).GetColorTexture(0);
   return Dali::Texture( texturePtr );
 }
 
index 91143d9..78143a1 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_FRAMEBUFFER_H
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
@@ -149,6 +149,8 @@ public:
   /**
    * @brief Attach the base LOD of a 2D texture to the framebuffer for color rendering.
    * @note This causes a color attachment to be added.
+   * @note Repeated calls to this method add textures as subsequent color attachments.
+   * @note A maximum of 8 color attachments are supported.
    *
    * @SINCE_1_1.43
    * @param[in] texture The texture that will be used as output when rendering
@@ -160,6 +162,8 @@ public:
   /**
    * @brief Attach a texture to the framebuffer for color rendering.
    * @note This causes a color attachment to be added.
+   * @note Repeated calls to this method add textures as subsequent color attachments.
+   * @note A maximum of 8 color attachments are supported.
    *
    * @SINCE_1_1.43
    * @param[in] texture The texture that will be used as output when rendering
@@ -171,7 +175,7 @@ public:
   void AttachColorTexture( Texture& texture, uint32_t mipmapLevel, uint32_t layer );
 
   /**
-   * @brief Gets the color texture used as output in the FrameBuffer.
+   * @brief Gets the first color texture used as output in the FrameBuffer.
    *
    * @SINCE_1_1.43
    * @returns A handle to the texture used as color output, or an uninitialized handle
index 0fe3e66..49cfcef 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali
 Summary:    DALi 3D Engine
-Version:    1.4.54
+Version:    1.4.55
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-3-Clause and MIT