Merge "Discard fragments out of corner radius" into devel/master
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Fri, 18 Jun 2021 14:33:35 +0000 (14:33 +0000)
committerGerrit Code Review <gerrit@review>
Fri, 18 Jun 2021 14:33:35 +0000 (14:33 +0000)
dali-toolkit/devel-api/visuals/visual-properties-devel.h
dali-toolkit/internal/graphics/shaders/color-visual-shader.frag
dali-toolkit/internal/graphics/shaders/gradient-visual-shader.frag
dali-toolkit/internal/graphics/shaders/image-visual-shader.frag

index ddb02d5..5d620bb 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_DEVEL_API_VISUALS_VISUAL_PROPERTIES_DEVEL_H
 
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -76,6 +76,8 @@ enum Type
    * @details Name "cornerRadius", type Property::FLOAT or Prooperty::VECTOR4, animatable
    * @note By default, it is Vector::ZERO.
    * @note Only Property::Vector4 can be animated.
+   * @note Each radius will clamp internally to the half of smaller of the visual width and visual height.
+   * @note Their may exist some alias when you use it as ClippingMode::CLIP_CHILDREN
    * @note Radius value are used in clockwise order from top-left-corner to bottom-left-corner.
    *       When radius is Vector4(x, y, z, w)
    *       x    y
@@ -113,7 +115,7 @@ enum Type
    * @brief The offset from the visual borderline (recommend [-1.0f to 1.0f]).
    * @details Name "borderlineOffset", type Property::FLOAT, animatable
    * @note Default value is 0.0f.
-   * @note This value will be clipped by [-1.0f to 1.0f].
+   * @note This value will clamp internally to [-1.0f to 1.0f].
    */
   BORDERLINE_OFFSET = OPACITY + 6,
 };
index bf93629..92b29a6 100644 (file)
@@ -156,8 +156,8 @@ mediump float calculateCornerOpacity()
   // calculate borderline opacity by potential
   if(potential > gMaxOutlinePotential)
   {
-    // potential is out of borderline range
-    opacity = 0.0;
+    // potential is out of borderline range. just discard here
+    discard;
   }
   else if(potential > gMinOutlinePotential)
   {
index 305ff92..9c897b4 100644 (file)
@@ -155,8 +155,8 @@ mediump float calculateCornerOpacity()
   // calculate borderline opacity by potential
   if(potential > gMaxOutlinePotential)
   {
-    // potential is out of borderline range
-    opacity = 0.0;
+    // potential is out of borderline range. just discard here
+    discard;
   }
   else if(potential > gMinOutlinePotential)
   {
index e83d463..b0dcfec 100644 (file)
@@ -177,8 +177,8 @@ mediump float calculateCornerOpacity()
   // calculate borderline opacity by potential
   if(potential > gMaxOutlinePotential)
   {
-    // potential is out of borderline range
-    opacity = 0.0;
+    // potential is out of borderline range. just discard here
+    discard;
   }
   else if(potential > gMinOutlinePotential)
   {