X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Fdevel-api%2Fshader-effects%2Falpha-discard-effect.h;h=e782f78b388fe09c9e71b416ec7578215ec0f70e;hp=ec2fe7825c0836a9016102dae3cb155ebb74b4f3;hb=20e1c73dd9097276d12197f427ec8e00ab9e5650;hpb=acbe10c62c46a30c58e08d8971a736f04e68dbf8 diff --git a/dali-toolkit/devel-api/shader-effects/alpha-discard-effect.h b/dali-toolkit/devel-api/shader-effects/alpha-discard-effect.h index ec2fe78..e782f78 100644 --- a/dali-toolkit/devel-api/shader-effects/alpha-discard-effect.h +++ b/dali-toolkit/devel-api/shader-effects/alpha-discard-effect.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_ALPHA_DISCARD_EFFECT_H /* - * Copyright (c) 2019 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,14 +22,12 @@ #include // INTERNAL INCLUDES -#include +#include namespace Dali { - namespace Toolkit { - /** * @brief Creates a new Alpha discard effect * @@ -44,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