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=fafd889ab825bb0e95d66d051c0c317feb36b4f6;hb=20e1c73dd9097276d12197f427ec8e00ab9e5650;hpb=e4d638dd0b325673bbd504aef409676fc5593a9d;ds=sidebyside 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 fafd889..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) 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 // INTERNAL INCLUDES -#include +#include 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