summaryrefslogtreecommitdiff
path: root/dali/internal
diff options
context:
space:
mode:
authorSeungho Baek <sbsh.baek@samsung.com>2024-06-03 17:18:32 +0900
committerSeungho Baek <sbsh.baek@samsung.com>2024-06-04 11:07:36 +0900
commit85eae80b19c128440761c3fd7a43a2fd20e77b83 (patch)
tree8760272bd6c66db8c90da1c261533edcf85cd105 /dali/internal
parentb2321481540505a395233987b535c0d457d41df7 (diff)
downloaddali-adaptor-85eae80b19c128440761c3fd7a43a2fd20e77b83.tar.gz
dali-adaptor-85eae80b19c128440761c3fd7a43a2fd20e77b83.tar.bz2
dali-adaptor-85eae80b19c128440761c3fd7a43a2fd20e77b83.zip
Apply Premultiplied Alpha for ClearColor of 32bit window.
Change-Id: I06a71c809d61063a353996374093220beda05c2b Signed-off-by: Seungho Baek <sbsh.baek@samsung.com>
Diffstat (limited to 'dali/internal')
-rw-r--r--dali/internal/window-system/common/window-impl.cpp26
-rw-r--r--dali/internal/window-system/common/window-impl.h12
2 files changed, 37 insertions, 1 deletions
diff --git a/dali/internal/window-system/common/window-impl.cpp b/dali/internal/window-system/common/window-impl.cpp
index b67e6475b..c08226f57 100644
--- a/dali/internal/window-system/common/window-impl.cpp
+++ b/dali/internal/window-system/common/window-impl.cpp
@@ -883,9 +883,33 @@ Dali::Layer Window::GetRootLayer() const
return mScene.GetRootLayer();
}
+void Window::SetBackgroundColor(const Vector4& color)
+{
+ mBackgroundColor = color;
+ if(mIsTransparent)
+ {
+ Vector4 backgroundColor = color;
+ backgroundColor.r *= backgroundColor.a;
+ backgroundColor.g *= backgroundColor.a;
+ backgroundColor.b *= backgroundColor.a;
+ SceneHolder::SetBackgroundColor(backgroundColor);
+ }
+ else
+ {
+ SceneHolder::SetBackgroundColor(color);
+ }
+}
+
+Vector4 Window::GetBackgroundColor() const
+{
+ return mBackgroundColor;
+}
+
void Window::SetTransparency(bool transparent)
{
- mWindowSurface->SetTransparency(transparent);
+ mIsTransparent = transparent;
+ mWindowSurface->SetTransparency(mIsTransparent);
+ SceneHolder::SetBackgroundColor(mBackgroundColor);
}
bool Window::GrabKey(Dali::KEY key, KeyGrab::KeyGrabMode grabMode)
diff --git a/dali/internal/window-system/common/window-impl.h b/dali/internal/window-system/common/window-impl.h
index af90626d1..857bd4d3a 100644
--- a/dali/internal/window-system/common/window-impl.h
+++ b/dali/internal/window-system/common/window-impl.h
@@ -359,6 +359,16 @@ public:
Dali::Layer GetRootLayer() const;
/**
+ * @copydoc Dali::Window::SetBackgroundColor
+ */
+ void SetBackgroundColor(const Dali::Vector4& color);
+
+ /**
+ * @copydoc Dali::Window::GetBackgroundColor
+ */
+ Vector4 GetBackgroundColor() const;
+
+ /**
* @copydoc Dali::Window::SetTransparency()
*/
void SetTransparency(bool transparent);
@@ -1005,6 +1015,8 @@ private:
Dali::KeyEvent mLastKeyEvent;
+ Vector4 mBackgroundColor;
+
bool mIsTransparent : 1;
bool mIsFocusAcceptable : 1;
bool mIconified : 1;