Make able to use CornerRadius clip children.
Note : It use stencil buffer. So Edge of rounded corner
will show some alias.
Change-Id: Id077a6a4226547e8ead3b953a8d8650ec5a4e733
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
/**
* @brief The radius for the rounded corners of the visual
* @details Name "cornerRadius", type Property::FLOAT.
+ * @note Their may exist some alias when you use it as ClippingMode::CLIP_CHILDREN.
* @note Optional.
*/
CORNER_RADIUS = OPACITY + 2,
\n
void main()\n
{\n
- mediump float dist = length( max( abs( vPosition ), vRectSize ) - vRectSize ) - vCornerRadius;\n
+ mediump float dist = length( max( abs( vPosition ), vRectSize ) - vRectSize ) - vCornerRadius;\n
+ if(dist > 1.0)\n
+ {\n
+ discard;\n
+ }\n
+ else\n
+ {\n
gl_FragColor = uColor * vec4( mixColor, 1.0 );\n
gl_FragColor.a *= 1.0 - smoothstep( -1.0, 1.0, dist );\n
+ }\n
}\n
);
void main()\n
{\n
mediump float dist = length( max( abs( vPosition ), vRectSize ) - vRectSize ) - vCornerRadius;\n
- gl_FragColor = texture2D( sTexture, vec2( vTexCoord.y, 0.5 ) ) * vec4(mixColor, 1.0) * uColor;\n
- gl_FragColor *= 1.0 - smoothstep( -1.0, 1.0, dist );\n
+ if(dist > 1.0)\n
+ {\n
+ discard;\n
+ }\n
+ else\n
+ {\n
+ gl_FragColor = texture2D( sTexture, vec2( vTexCoord.y, 0.5 ) ) * vec4(mixColor, 1.0) * uColor;\n
+ gl_FragColor *= 1.0 - smoothstep( -1.0, 1.0, dist );\n
+ }\n
}\n
),
void main()\n
{\n
mediump float dist = length( max( abs( vPosition ), vRectSize ) - vRectSize ) - vCornerRadius;\n
- gl_FragColor = texture2D( sTexture, vec2( length(vTexCoord), 0.5 ) ) * vec4(mixColor, 1.0) * uColor;\n
- gl_FragColor *= 1.0 - smoothstep( -1.0, 1.0, dist );\n
+ if(dist > 1.0)\n
+ {\n
+ discard;\n
+ }\n
+ else\n
+ {\n
+ gl_FragColor = texture2D( sTexture, vec2( length(vTexCoord), 0.5 ) ) * vec4(mixColor, 1.0) * uColor;\n
+ gl_FragColor *= 1.0 - smoothstep( -1.0, 1.0, dist );\n
+ }\n
}\n
)
};
void main()\n
{\n
mediump float dist = length( max( abs( vPosition ), vRectSize ) - vRectSize ) - vCornerRadius;\n
- mediump float opacity = 1.0 - smoothstep( -1.0, 1.0, dist );\n
- gl_FragColor = texture2D( sTexture, vTexCoord ) * uColor * vec4( mixColor, 1.0 );\n
- gl_FragColor.a *= opacity;\n
- gl_FragColor.rgb *= mix( 1.0, opacity, preMultipliedAlpha );\n
+ if(dist > 1.0)\n
+ {\n
+ discard;\n
+ }\n
+ else\n
+ {\n
+ mediump float opacity = 1.0 - smoothstep( -1.0, 1.0, dist );\n
+ gl_FragColor = texture2D( sTexture, vTexCoord ) * uColor * vec4( mixColor, 1.0 );\n
+ gl_FragColor.a *= opacity;\n
+ gl_FragColor.rgb *= mix( 1.0, opacity, preMultipliedAlpha );\n
+ }\n
}\n
);