forked from enlightenment/efl
Evas: Fix more shadow declarations of 'index' variable.
SVN revision: 59714
This commit is contained in:
parent
6379aa55aa
commit
ffc97c3754
|
@ -21,7 +21,7 @@ EAPI void evas_common_draw_context_set_mask (RGBA_D
|
|||
EAPI void evas_common_draw_context_unset_mask (RGBA_Draw_Context *dc);
|
||||
EAPI Cutout_Rects *evas_common_draw_context_cutouts_new (void);
|
||||
EAPI void evas_common_draw_context_cutouts_free (Cutout_Rects* rects);
|
||||
EAPI void evas_common_draw_context_cutouts_del (Cutout_Rects* rects, int index);
|
||||
EAPI void evas_common_draw_context_cutouts_del (Cutout_Rects* rects, int idx);
|
||||
EAPI void evas_common_draw_context_add_cutout (RGBA_Draw_Context *dc, int x, int y, int w, int h);
|
||||
EAPI void evas_common_draw_context_clear_cutouts (RGBA_Draw_Context *dc);
|
||||
EAPI Cutout_Rects *evas_common_draw_context_apply_cutouts (RGBA_Draw_Context *dc);
|
||||
|
|
|
@ -18,16 +18,15 @@ evas_common_draw_context_cutouts_free(Cutout_Rects* rects)
|
|||
}
|
||||
|
||||
EAPI void
|
||||
evas_common_draw_context_cutouts_del(Cutout_Rects* rects,
|
||||
int index)
|
||||
evas_common_draw_context_cutouts_del(Cutout_Rects* rects, int idx)
|
||||
{
|
||||
if ((index >= 0) && (index < rects->active))
|
||||
if ((idx >= 0) && (idx < rects->active))
|
||||
{
|
||||
Cutout_Rect *rect;
|
||||
|
||||
rect = rects->rects + index;
|
||||
rect = rects->rects + idx;
|
||||
memmove(rect, rect + 1,
|
||||
sizeof(Cutout_Rect) * (rects->active - index - 1));
|
||||
sizeof(Cutout_Rect) * (rects->active - idx - 1));
|
||||
rects->active--;
|
||||
}
|
||||
}
|
||||
|
@ -212,10 +211,10 @@ evas_common_draw_context_add_cutout(RGBA_Draw_Context *dc, int x, int y, int w,
|
|||
}
|
||||
|
||||
int
|
||||
evas_common_draw_context_cutout_split(Cutout_Rects* res, int index, Cutout_Rect *split)
|
||||
evas_common_draw_context_cutout_split(Cutout_Rects* res, int idx, Cutout_Rect *split)
|
||||
{
|
||||
/* 1 input rect, multiple out */
|
||||
Cutout_Rect in = res->rects[index];
|
||||
Cutout_Rect in = res->rects[idx];
|
||||
|
||||
/* this is to save me a LOT of typing */
|
||||
#define INX1 (in.x)
|
||||
|
@ -255,8 +254,8 @@ evas_common_draw_context_cutout_split(Cutout_Rects* res, int index, Cutout_Rect
|
|||
R_NEW(res, in.x, SPY1, SPX1 - in.x, SPY2 - SPY1);
|
||||
R_NEW(res, SPX2, SPY1, INX2 - SPX2, SPY2 - SPY1);
|
||||
/* out => (in.x, SPY2, in.w, INY2 - SPY2) */
|
||||
res->rects[index].h = INY2 - SPY2;
|
||||
res->rects[index].y = SPY2;
|
||||
res->rects[idx].h = INY2 - SPY2;
|
||||
res->rects[idx].y = SPY2;
|
||||
return 1;
|
||||
}
|
||||
/* SSSSSSS
|
||||
|
@ -269,7 +268,7 @@ evas_common_draw_context_cutout_split(Cutout_Rects* res, int index, Cutout_Rect
|
|||
*/
|
||||
if (!X1_IN && !X2_IN && !Y1_IN && !Y2_IN)
|
||||
{
|
||||
evas_common_draw_context_cutouts_del(res, index);
|
||||
evas_common_draw_context_cutouts_del(res, idx);
|
||||
return 0;
|
||||
}
|
||||
/* SSS
|
||||
|
@ -283,8 +282,8 @@ evas_common_draw_context_cutout_split(Cutout_Rects* res, int index, Cutout_Rect
|
|||
if (!X1_IN && X2_IN && !Y1_IN && !Y2_IN)
|
||||
{
|
||||
/* in => (SPX2, in.y, INX2 - SPX2, in.h) */
|
||||
res->rects[index].w = INX2 - SPX2;
|
||||
res->rects[index].x = SPX2;
|
||||
res->rects[idx].w = INX2 - SPX2;
|
||||
res->rects[idx].x = SPX2;
|
||||
return 1;
|
||||
}
|
||||
/* S
|
||||
|
@ -299,8 +298,8 @@ evas_common_draw_context_cutout_split(Cutout_Rects* res, int index, Cutout_Rect
|
|||
{
|
||||
R_NEW(res, in.x, in.y, SPX1 - in.x, in.h);
|
||||
/* in => (SPX2, in.y, INX2 - SPX2, in.h) */
|
||||
res->rects[index].w = INX2 - SPX2;
|
||||
res->rects[index].x = SPX2;
|
||||
res->rects[idx].w = INX2 - SPX2;
|
||||
res->rects[idx].x = SPX2;
|
||||
return 1;
|
||||
}
|
||||
/* SSS
|
||||
|
@ -314,7 +313,7 @@ evas_common_draw_context_cutout_split(Cutout_Rects* res, int index, Cutout_Rect
|
|||
if (X1_IN && !X2_IN && !Y1_IN && !Y2_IN)
|
||||
{
|
||||
/* in => (in.x, in.y, SPX1 - in.x, in.h) */
|
||||
res->rects[index].w = SPX1 - in.x;
|
||||
res->rects[idx].w = SPX1 - in.x;
|
||||
return 1;
|
||||
}
|
||||
/* SSSSSSS
|
||||
|
@ -328,8 +327,8 @@ evas_common_draw_context_cutout_split(Cutout_Rects* res, int index, Cutout_Rect
|
|||
if (!X1_IN && !X2_IN && !Y1_IN && Y2_IN)
|
||||
{
|
||||
/* in => (in.x, SPY2, in.w, INY2 - SPY2) */
|
||||
res->rects[index].h = INY2 - SPY2;
|
||||
res->rects[index].y = SPY2;
|
||||
res->rects[idx].h = INY2 - SPY2;
|
||||
res->rects[idx].y = SPY2;
|
||||
return 1;
|
||||
}
|
||||
/*
|
||||
|
@ -344,7 +343,7 @@ evas_common_draw_context_cutout_split(Cutout_Rects* res, int index, Cutout_Rect
|
|||
{
|
||||
R_NEW(res, in.x, SPY2, in.w, INY2 - SPY2);
|
||||
/* in => (in.x, in.y, in.w, SPY1 - in.y) */
|
||||
res->rects[index].h = SPY1 - in.y;
|
||||
res->rects[idx].h = SPY1 - in.y;
|
||||
return 1;
|
||||
}
|
||||
/*
|
||||
|
@ -358,7 +357,7 @@ evas_common_draw_context_cutout_split(Cutout_Rects* res, int index, Cutout_Rect
|
|||
if (!X1_IN && !X2_IN && Y1_IN && !Y2_IN)
|
||||
{
|
||||
/* in => (in.x, in.y, in.w, SPY1 - in.y) */
|
||||
res->rects[index].h = SPY1 - in.y;
|
||||
res->rects[idx].h = SPY1 - in.y;
|
||||
return 1;
|
||||
}
|
||||
/* SSS
|
||||
|
@ -373,8 +372,8 @@ evas_common_draw_context_cutout_split(Cutout_Rects* res, int index, Cutout_Rect
|
|||
{
|
||||
R_NEW(res, SPX2, in.y, INX2 - SPX2, SPY2 - in.y);
|
||||
/* in => (in.x, SPY2, in.w, INY2 - SPY2) */
|
||||
res->rects[index].h = INY2 - SPY2;
|
||||
res->rects[index].y = SPY2;
|
||||
res->rects[idx].h = INY2 - SPY2;
|
||||
res->rects[idx].y = SPY2;
|
||||
return 1;
|
||||
}
|
||||
/* S
|
||||
|
@ -390,8 +389,8 @@ evas_common_draw_context_cutout_split(Cutout_Rects* res, int index, Cutout_Rect
|
|||
R_NEW(res, in.x, in.y, SPX1 - in.x, SPY2 - in.y);
|
||||
R_NEW(res, SPX2, in.y, INX2 - SPX2, SPY2 - in.y);
|
||||
/* in => (in.x, SPY2, in.w, INY2 - SPY2) */
|
||||
res->rects[index].h = INY2 - SPY2;
|
||||
res->rects[index].y = SPY2;
|
||||
res->rects[idx].h = INY2 - SPY2;
|
||||
res->rects[idx].y = SPY2;
|
||||
return 1;
|
||||
}
|
||||
/* SSS
|
||||
|
@ -406,8 +405,8 @@ evas_common_draw_context_cutout_split(Cutout_Rects* res, int index, Cutout_Rect
|
|||
{
|
||||
R_NEW(res, in.x, in.y, SPX1 - in.x, SPY2 - in.y);
|
||||
/* in => (in.x, SPY2, in.w, INY2 - SPY2) */
|
||||
res->rects[index].h = INY2 - SPY2;
|
||||
res->rects[index].y = SPY2;
|
||||
res->rects[idx].h = INY2 - SPY2;
|
||||
res->rects[idx].y = SPY2;
|
||||
return 1;
|
||||
}
|
||||
/*
|
||||
|
@ -423,7 +422,7 @@ evas_common_draw_context_cutout_split(Cutout_Rects* res, int index, Cutout_Rect
|
|||
R_NEW(res, in.x, SPY2, in.w, INY2 - SPY2);
|
||||
R_NEW(res, SPX2, SPY1, INX2 - SPX2, SPY2 - SPY1);
|
||||
/* in => (in.x, SPY2, in.w, INY2 - SPY2) */
|
||||
res->rects[index].h = SPY1 - in.y;
|
||||
res->rects[idx].h = SPY1 - in.y;
|
||||
return 1;
|
||||
}
|
||||
/*
|
||||
|
@ -439,7 +438,7 @@ evas_common_draw_context_cutout_split(Cutout_Rects* res, int index, Cutout_Rect
|
|||
R_NEW(res, in.x, SPY2, in.w, INY2 - SPY2);
|
||||
R_NEW(res, in.x, SPY1, SPX1 - in.x, SPY2 - SPY1);
|
||||
/* in => (in.x, in.y, in.w, SPY1 - in.y) */
|
||||
res->rects[index].h = SPY1 - in.y;
|
||||
res->rects[idx].h = SPY1 - in.y;
|
||||
return 1;
|
||||
}
|
||||
/*
|
||||
|
@ -454,7 +453,7 @@ evas_common_draw_context_cutout_split(Cutout_Rects* res, int index, Cutout_Rect
|
|||
{
|
||||
R_NEW(res, SPX2, SPY1, INX2 - SPX2, INY2 - SPY1);
|
||||
/* in => (in.x, in.y, in.w, SPY1 - in.y) */
|
||||
res->rects[index].h = SPY1 - in.y;
|
||||
res->rects[idx].h = SPY1 - in.y;
|
||||
return 1;
|
||||
}
|
||||
/*
|
||||
|
@ -470,7 +469,7 @@ evas_common_draw_context_cutout_split(Cutout_Rects* res, int index, Cutout_Rect
|
|||
R_NEW(res, in.x, SPY1, SPX1 - in.x, INY2 - SPY1);
|
||||
R_NEW(res, SPX2, SPY1, INX2 - SPX2, INY2 - SPY1);
|
||||
/* in => (in.x, in.y, in.w, SPY1 - in.y) */
|
||||
res->rects[index].h = SPY1 - in.y;
|
||||
res->rects[idx].h = SPY1 - in.y;
|
||||
return 1;
|
||||
}
|
||||
/*
|
||||
|
@ -485,10 +484,10 @@ evas_common_draw_context_cutout_split(Cutout_Rects* res, int index, Cutout_Rect
|
|||
{
|
||||
R_NEW(res, in.x, SPY1, SPX1 - in.x, INY2 - SPY1);
|
||||
/* in => (in.x, in.y, in.w, SPY1 - in.y) */
|
||||
res->rects[index].h = SPY1 - in.y;
|
||||
res->rects[idx].h = SPY1 - in.y;
|
||||
return 1;
|
||||
}
|
||||
evas_common_draw_context_cutouts_del(res, index);
|
||||
evas_common_draw_context_cutouts_del(res, idx);
|
||||
return 0;
|
||||
#undef INX1
|
||||
#undef INX2
|
||||
|
|
|
@ -195,15 +195,16 @@ evas_common_font_draw_internal(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Font
|
|||
|
||||
EVAS_FONT_WALK_TEXT_START()
|
||||
{
|
||||
FT_UInt index;
|
||||
FT_UInt idx;
|
||||
RGBA_Font_Glyph *fg;
|
||||
int chr_x, chr_y, chr_w;
|
||||
|
||||
if (!EVAS_FONT_WALK_IS_VISIBLE) continue;
|
||||
|
||||
index = EVAS_FONT_WALK_INDEX;
|
||||
idx = EVAS_FONT_WALK_INDEX;
|
||||
|
||||
LKL(fi->ft_mutex);
|
||||
fg = evas_common_font_int_cache_glyph_get(fi, index);
|
||||
fg = evas_common_font_int_cache_glyph_get(fi, idx);
|
||||
if (!fg)
|
||||
{
|
||||
LKU(fi->ft_mutex);
|
||||
|
|
|
@ -254,7 +254,7 @@ _fash_int_find(Fash_Int *fash, int item)
|
|||
}
|
||||
|
||||
static void
|
||||
_fash_int_add(Fash_Int *fash, int item, RGBA_Font_Int *fint, int index)
|
||||
_fash_int_add(Fash_Int *fash, int item, RGBA_Font_Int *fint, int idx)
|
||||
{
|
||||
int grp, maj, min;
|
||||
|
||||
|
@ -269,7 +269,7 @@ _fash_int_add(Fash_Int *fash, int item, RGBA_Font_Int *fint, int index)
|
|||
fash->bucket[grp]->bucket[maj] = calloc(1, sizeof(Fash_Int_Map));
|
||||
EINA_SAFETY_ON_NULL_RETURN(fash->bucket[grp]->bucket[maj]);
|
||||
fash->bucket[grp]->bucket[maj]->item[min].fint = fint;
|
||||
fash->bucket[grp]->bucket[maj]->item[min].index = index;
|
||||
fash->bucket[grp]->bucket[maj]->item[min].index = idx;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -331,7 +331,7 @@ _fash_gl_add(Fash_Glyph *fash, int item, RGBA_Font_Glyph *glyph)
|
|||
}
|
||||
|
||||
EAPI RGBA_Font_Glyph *
|
||||
evas_common_font_int_cache_glyph_get(RGBA_Font_Int *fi, FT_UInt index)
|
||||
evas_common_font_int_cache_glyph_get(RGBA_Font_Int *fi, FT_UInt idx)
|
||||
{
|
||||
RGBA_Font_Glyph *fg;
|
||||
FT_UInt hindex;
|
||||
|
@ -344,26 +344,26 @@ evas_common_font_int_cache_glyph_get(RGBA_Font_Int *fi, FT_UInt index)
|
|||
evas_common_font_int_promote(fi);
|
||||
if (fi->fash)
|
||||
{
|
||||
fg = _fash_gl_find(fi->fash, index);
|
||||
fg = _fash_gl_find(fi->fash, idx);
|
||||
if (fg == (void *)(-1)) return NULL;
|
||||
else if (fg) return fg;
|
||||
}
|
||||
|
||||
hindex = index + (fi->hinting * 500000000);
|
||||
hindex = idx + (fi->hinting * 500000000);
|
||||
|
||||
// fg = eina_hash_find(fi->glyphs, &hindex);
|
||||
// if (fg) return fg;
|
||||
|
||||
evas_common_font_int_reload(fi);
|
||||
FTLOCK();
|
||||
error = FT_Load_Glyph(fi->src->ft.face, index,
|
||||
error = FT_Load_Glyph(fi->src->ft.face, idx,
|
||||
FT_LOAD_DEFAULT | FT_LOAD_NO_BITMAP |
|
||||
hintflags[fi->hinting]);
|
||||
FTUNLOCK();
|
||||
if (error)
|
||||
{
|
||||
if (!fi->fash) fi->fash = _fash_gl_new();
|
||||
if (fi->fash) _fash_gl_add(fi->fash, index, (void *)(-1));
|
||||
if (fi->fash) _fash_gl_add(fi->fash, idx, (void *)(-1));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -386,7 +386,7 @@ evas_common_font_int_cache_glyph_get(RGBA_Font_Int *fi, FT_UInt index)
|
|||
{
|
||||
free(fg);
|
||||
if (!fi->fash) fi->fash = _fash_gl_new();
|
||||
if (fi->fash) _fash_gl_add(fi->fash, index, (void *)(-1));
|
||||
if (fi->fash) _fash_gl_add(fi->fash, idx, (void *)(-1));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -398,7 +398,7 @@ evas_common_font_int_cache_glyph_get(RGBA_Font_Int *fi, FT_UInt index)
|
|||
FTUNLOCK();
|
||||
free(fg);
|
||||
if (!fi->fash) fi->fash = _fash_gl_new();
|
||||
if (fi->fash) _fash_gl_add(fi->fash, index, (void *)(-1));
|
||||
if (fi->fash) _fash_gl_add(fi->fash, idx, (void *)(-1));
|
||||
return NULL;
|
||||
}
|
||||
FTUNLOCK();
|
||||
|
@ -408,7 +408,7 @@ evas_common_font_int_cache_glyph_get(RGBA_Font_Int *fi, FT_UInt index)
|
|||
fg->fi = fi;
|
||||
|
||||
if (!fi->fash) fi->fash = _fash_gl_new();
|
||||
if (fi->fash) _fash_gl_add(fi->fash, index, fg);
|
||||
if (fi->fash) _fash_gl_add(fi->fash, idx, fg);
|
||||
/* This '+ 200' is just an estimation of how much memory freetype will use
|
||||
* on it's size. This value is not really used anywhere in code - it's
|
||||
* only for statistics. */
|
||||
|
@ -487,7 +487,7 @@ evas_common_font_glyph_search(RGBA_Font *fn, RGBA_Font_Int **fi_ret, Eina_Unicod
|
|||
for (l = fn->fonts; l; l = l->next)
|
||||
{
|
||||
RGBA_Font_Int *fi;
|
||||
int index;
|
||||
int idx;
|
||||
|
||||
fi = l->data;
|
||||
|
||||
|
@ -495,8 +495,8 @@ evas_common_font_glyph_search(RGBA_Font *fn, RGBA_Font_Int **fi_ret, Eina_Unicod
|
|||
/*
|
||||
if (fi->src->charmap) // Charmap loaded, FI/FS blank
|
||||
{
|
||||
index = evas_array_hash_search(fi->src->charmap, gl);
|
||||
if (index != 0)
|
||||
idx = evas_array_hash_search(fi->src->charmap, gl);
|
||||
if (idx != 0)
|
||||
{
|
||||
evas_common_font_source_load_complete(fi->src);
|
||||
evas_common_font_int_load_complete(fi);
|
||||
|
@ -505,7 +505,7 @@ evas_common_font_glyph_search(RGBA_Font *fn, RGBA_Font_Int **fi_ret, Eina_Unicod
|
|||
fi->src->charmap = NULL;
|
||||
|
||||
*fi_ret = fi;
|
||||
return index;
|
||||
return idx;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -517,15 +517,15 @@ evas_common_font_glyph_search(RGBA_Font *fn, RGBA_Font_Int **fi_ret, Eina_Unicod
|
|||
}
|
||||
if (fi->src->ft.face)
|
||||
{
|
||||
index = evas_common_get_char_index(fi, gl);
|
||||
if (index != 0)
|
||||
idx = evas_common_get_char_index(fi, gl);
|
||||
if (idx != 0)
|
||||
{
|
||||
if (!fi->ft.size)
|
||||
evas_common_font_int_load_complete(fi);
|
||||
if (!fn->fash) fn->fash = _fash_int_new();
|
||||
if (fn->fash) _fash_int_add(fn->fash, gl, fi, index);
|
||||
if (fn->fash) _fash_int_add(fn->fash, gl, fi, idx);
|
||||
*fi_ret = fi;
|
||||
return index;
|
||||
return idx;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -536,4 +536,3 @@ evas_common_font_glyph_search(RGBA_Font *fn, RGBA_Font_Int **fi_ret, Eina_Unicod
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue