[dali_2.3.19] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / devel-api / shader-effects / alpha-discard-effect.h
index fafd889..e782f78 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_ALPHA_DISCARD_EFFECT_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.
@@ -22,7 +22,7 @@
 #include <dali/public-api/object/property-map.h>
 
 // INTERNAL INCLUDES
-#include <dali-toolkit/public-api/visuals/visual-properties.h>
+#include <dali-toolkit/public-api/dali-toolkit-common.h>
 
 namespace Dali
 {
@@ -42,31 +42,7 @@ namespace Toolkit
  *
  * @return A property map of the required shaders.
  */
-inline Property::Map CreateAlphaDiscardEffect()
-{
-  const char* ALPHA_DISCARD_FRAGMENT_SHADER_SOURCE =
-    "varying mediump vec2 vTexCoord;                                \n"
-    "                                                               \n"
-    "uniform sampler2D sTexture;                                    \n"
-    "uniform lowp vec4 uColor;                                      \n"
-    "void main()                                                    \n"
-    "{                                                              \n"
-    "  mediump vec4 color = texture2D( sTexture, vTexCoord );       \n"
-    "  if(color.a <= 0.0001)                                        \n"
-    "  {                                                            \n"
-    "    discard;                                                   \n"
-    "  }                                                            \n"
-    "  gl_FragColor = color * uColor;                               \n"
-    "}                                                              \n";
-
-  Property::Map map;
-
-  Property::Map customShader;
-  customShader[Visual::Shader::Property::FRAGMENT_SHADER] = ALPHA_DISCARD_FRAGMENT_SHADER_SOURCE;
-
-  map[Toolkit::Visual::Property::SHADER] = customShader;
-  return map;
-}
+DALI_TOOLKIT_API Property::Map CreateAlphaDiscardEffect();
 
 } // namespace Toolkit