X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=optional%2Fdali-toolkit%2Fpublic-api%2Fshader-effects%2Fnine-patch-mask-effect.cpp;h=bfaba3d363e8bc7e2ecfe6f5b0de5d0cccb72d8d;hp=fc1740b95e36920b550f66874033091db40ac13b;hb=0cd043d5fe3d330798ea5bdb0711b841535718e0;hpb=30f6ca1e541089b19f2b349a8a12d8a5bcaf2f9e diff --git a/optional/dali-toolkit/public-api/shader-effects/nine-patch-mask-effect.cpp b/optional/dali-toolkit/public-api/shader-effects/nine-patch-mask-effect.cpp index fc1740b..bfaba3d 100644 --- a/optional/dali-toolkit/public-api/shader-effects/nine-patch-mask-effect.cpp +++ b/optional/dali-toolkit/public-api/shader-effects/nine-patch-mask-effect.cpp @@ -1,22 +1,26 @@ -// -// Copyright (c) 2014 Samsung Electronics Co., Ltd. -// -// Licensed under the Flora License, Version 1.0 (the License); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://floralicense.org/license/ -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// +/* + * Copyright (c) 2014 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ // CLASS HEADER #include +// EXTERNAL INCLUDES +#include + namespace Dali { @@ -38,6 +42,7 @@ struct NinePatchMaskEffectSizeConstraint static void DoApply( ImageActor actor, const std::string& maskImage, const Vector2& maskSize, Vector4 maskBorder ) { const char* ALPHA_MASK_VERTEX_SHADER_SOURCE = + "precision mediump float;\n" "uniform vec2 uImageSize; \n" "uniform vec2 uMaskSize; \n" "varying vec2 vMaskTexCoord; \n" @@ -64,7 +69,7 @@ static void DoApply( ImageActor actor, const std::string& maskImage, const Vecto "} \n"; const char* ALPHA_MASK_FRAGMENT_SHADER_SOURCE = - "varying vec2 vMaskTexCoord; \n" + "varying mediump vec2 vMaskTexCoord; \n" " \n" "void main() \n" "{ \n" @@ -72,10 +77,11 @@ static void DoApply( ImageActor actor, const std::string& maskImage, const Vecto " gl_FragColor = texture2D(sTexture, vTexCoord) * uColor * vec4(1,1,1,mask.a); \n" "} \n"; - ShaderEffect maskEffect = ShaderEffect::New( ALPHA_MASK_VERTEX_SHADER_SOURCE, - ALPHA_MASK_FRAGMENT_SHADER_SOURCE, - GeometryType( GEOMETRY_TYPE_IMAGE ), - ShaderEffect::GeometryHints( ShaderEffect::HINT_BLENDING ) ); + ShaderEffect maskEffect = ShaderEffect::New( + ALPHA_MASK_VERTEX_SHADER_SOURCE, + ALPHA_MASK_FRAGMENT_SHADER_SOURCE, + GeometryType( GEOMETRY_TYPE_IMAGE ), + ShaderEffect::GeometryHints( ShaderEffect::HINT_BLENDING ) ); maskEffect.SetEffectImage( Image::New( maskImage ) );