We setup the range of anti-alias as fixed value; 1.0.
It cause we only assume that user will use this visual at pixel-unit.
But if we try to use ImageView / Control in 3D world,
The size of visual can be smaller than 1.0.
In this case, CornerRadius / Borderline break down.
This patch make the range of anti-alias relative with visual size.
So even if we setup the view size smaller than 1.0,
it will show the result like 50x50 size of visual.
Change-Id: I17614783c2ec8c4a38b51330ba166160d7d4db16
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
void setupMinMaxPotential()
{
- gPotentialRange = 1.0;
+ // Set soft anti-alias range at most 2% of visual size
+ gPotentialRange = min(1.0, max(vRectSize.x, vRectSize.y) * 0.02);
gMaxOutlinePotential = gRadius + gPotentialRange;
gMinOutlinePotential = gRadius - gPotentialRange;
borderlineOpacity = smoothstep(gMinInlinePotential, gMaxInlinePotential, potential);
// Muliply borderlineWidth to resolve very thin borderline
- borderlineOpacity *= min(1.0, borderlineWidth);
+ borderlineOpacity *= min(1.0, borderlineWidth / gPotentialRange);
}
lowp vec3 borderlineColorRGB = borderlineColor.rgb * uActorColor.rgb;
void setupMinMaxPotential()
{
- gPotentialRange = 1.0;
+ // Set soft anti-alias range at most 2% of visual size
+ gPotentialRange = min(1.0, max(vRectSize.x, vRectSize.y) * 0.02);
gMaxOutlinePotential = gRadius + gPotentialRange;
gMinOutlinePotential = gRadius - gPotentialRange;
borderlineOpacity = smoothstep(gMinInlinePotential, gMaxInlinePotential, potential);
// Muliply borderlineWidth to resolve very thin borderline
- borderlineOpacity *= min(1.0, borderlineWidth);
+ borderlineOpacity *= min(1.0, borderlineWidth / gPotentialRange);
}
lowp vec3 borderlineColorRGB = borderlineColor.rgb * uActorColor.rgb;
void setupMinMaxPotential()
{
- gPotentialRange = 1.0;
+ // Set soft anti-alias range at most 2% of visual size
+ gPotentialRange = min(1.0, max(vRectSize.x, vRectSize.y) * 0.02);
gMaxOutlinePotential = gRadius + gPotentialRange;
gMinOutlinePotential = gRadius - gPotentialRange;
borderlineOpacity = smoothstep(gMinInlinePotential, gMaxInlinePotential, potential);
// Muliply borderlineWidth to resolve very thin borderline
- borderlineOpacity *= min(1.0, borderlineWidth);
+ borderlineOpacity *= min(1.0, borderlineWidth / gPotentialRange);
}
lowp vec3 borderlineColorRGB = borderlineColor.rgb * uActorColor.rgb;