forked from enlightenment/enlightenment
Fix most (but not all!) dropshadow bugs reported by clang.
One still remains and I'm not sure if it's using the wrong values today and shw/shh are unused or if shw/shh are really useless. SVN revision: 38557
This commit is contained in:
parent
f3c5819ff3
commit
8dbd947272
|
@ -702,7 +702,7 @@ _ds_shadow_recalc(Shadow *sh)
|
||||||
{
|
{
|
||||||
Eina_List *l, *ll;
|
Eina_List *l, *ll;
|
||||||
Shpix *sp;
|
Shpix *sp;
|
||||||
int shw, shh, bsz, shx, shy;
|
int shw, shh, bsz;
|
||||||
int x1, y1, x2, y2;
|
int x1, y1, x2, y2;
|
||||||
|
|
||||||
if ((!rects) && (sh->toosmall))
|
if ((!rects) && (sh->toosmall))
|
||||||
|
@ -710,8 +710,6 @@ _ds_shadow_recalc(Shadow *sh)
|
||||||
else
|
else
|
||||||
sh->square = 0;
|
sh->square = 0;
|
||||||
|
|
||||||
shx = sh->ds->conf->shadow_x;
|
|
||||||
shy = sh->ds->conf->shadow_y;
|
|
||||||
shw = sh->w;
|
shw = sh->w;
|
||||||
shh = sh->h;
|
shh = sh->h;
|
||||||
bsz = sh->ds->conf->blur_size;
|
bsz = sh->ds->conf->blur_size;
|
||||||
|
@ -1005,17 +1003,13 @@ _ds_config_darkness_set(Dropshadow *ds, double v)
|
||||||
Shadow_Object *so;
|
Shadow_Object *so;
|
||||||
|
|
||||||
so = ll->data;
|
so = ll->data;
|
||||||
evas_object_color_set(so->obj,
|
evas_object_color_set(so->obj, 0, 0, 0, 255 * v);
|
||||||
0, 0, 0,
|
|
||||||
255 * ds->conf->shadow_darkness);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (i = 0; i < 4; i++)
|
for (i = 0; i < 4; i++)
|
||||||
evas_object_color_set(sh->object[i],
|
evas_object_color_set(sh->object[i], 0, 0, 0, 255 * v);
|
||||||
0, 0, 0,
|
|
||||||
255 * ds->conf->shadow_darkness);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1047,10 +1041,10 @@ _ds_config_blur_set(Dropshadow *ds, int blur)
|
||||||
|
|
||||||
if (blur < 0) blur = 0;
|
if (blur < 0) blur = 0;
|
||||||
|
|
||||||
if (ds->conf->shadow_x >= ds->conf->blur_size)
|
if (ds->conf->shadow_x >= blur)
|
||||||
ds->conf->shadow_x = ds->conf->blur_size - 1;
|
ds->conf->shadow_x = blur - 1;
|
||||||
if (ds->conf->shadow_y >= ds->conf->blur_size)
|
if (ds->conf->shadow_y >= blur)
|
||||||
ds->conf->shadow_y = ds->conf->blur_size - 1;
|
ds->conf->shadow_y = blur - 1;
|
||||||
|
|
||||||
_ds_blur_init(ds);
|
_ds_blur_init(ds);
|
||||||
for (l = ds->shadows; l; l = l->next)
|
for (l = ds->shadows; l; l = l->next)
|
||||||
|
@ -1172,7 +1166,6 @@ _ds_gauss_blur_h(unsigned char *pix, unsigned char *pix_dst, int pix_w, int pix_
|
||||||
{
|
{
|
||||||
usefull = 0;
|
usefull = 0;
|
||||||
l2 -= x2 - pix_w + 1;
|
l2 -= x2 - pix_w + 1;
|
||||||
x2 = pix_w - 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pp = pix + x1 + (ry * pix_w);
|
pp = pix + x1 + (ry * pix_w);
|
||||||
|
@ -1212,6 +1205,7 @@ _ds_gauss_blur_h(unsigned char *pix, unsigned char *pix_dst, int pix_w, int pix_
|
||||||
p1++;
|
p1++;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
if (full > 0)
|
||||||
*p2 = sum / full;
|
*p2 = sum / full;
|
||||||
p2 += pix_w;
|
p2 += pix_w;
|
||||||
pp += pix_w;
|
pp += pix_w;
|
||||||
|
@ -1231,6 +1225,7 @@ _ds_gauss_blur_h(unsigned char *pix, unsigned char *pix_dst, int pix_w, int pix_
|
||||||
sum += (int)(*p1) * (int)wt;
|
sum += (int)(*p1) * (int)wt;
|
||||||
p1++;
|
p1++;
|
||||||
}
|
}
|
||||||
|
if (weight > 0)
|
||||||
*p2 = sum / weight;
|
*p2 = sum / weight;
|
||||||
p2 += pix_w;
|
p2 += pix_w;
|
||||||
pp += pix_w;
|
pp += pix_w;
|
||||||
|
@ -1334,7 +1329,6 @@ _ds_gauss_blur_v(unsigned char *pix, unsigned char *pix_dst, int pix_w, int pix_
|
||||||
{
|
{
|
||||||
usefull = 0;
|
usefull = 0;
|
||||||
l2 -= y2 - pix_h + 1;
|
l2 -= y2 - pix_h + 1;
|
||||||
y2 = pix_h - 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pp = pix + (y1 * pix_w) + rx;
|
pp = pix + (y1 * pix_w) + rx;
|
||||||
|
@ -1377,6 +1371,7 @@ _ds_gauss_blur_v(unsigned char *pix, unsigned char *pix_dst, int pix_w, int pix_
|
||||||
p1 += pix_w;
|
p1 += pix_w;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
if (full > 0)
|
||||||
*p2 = sum / full;
|
*p2 = sum / full;
|
||||||
p2++;
|
p2++;
|
||||||
pp++;
|
pp++;
|
||||||
|
@ -1396,6 +1391,7 @@ _ds_gauss_blur_v(unsigned char *pix, unsigned char *pix_dst, int pix_w, int pix_
|
||||||
sum += (int)(*p1) * wt;
|
sum += (int)(*p1) * wt;
|
||||||
p1 += pix_w;
|
p1 += pix_w;
|
||||||
}
|
}
|
||||||
|
if (weight > 0)
|
||||||
*p2 = sum / weight;
|
*p2 = sum / weight;
|
||||||
p2++;
|
p2++;
|
||||||
pp++;
|
pp++;
|
||||||
|
@ -1969,7 +1965,7 @@ _tilebuf_intersect(int tsize, int tlen, int tnum, int x, int w, int *x1, int *x2
|
||||||
*x2 = p2;
|
*x2 = p2;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
tnum = 0;
|
(void)tnum;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in New Issue