forked from enlightenment/efl
fix edge interpolation for images with xrender and a segv for font rendering
if multiple engines dont agree on ext data for fonts SVN revision: 22173
This commit is contained in:
parent
a75ccf9e64
commit
3b3b836125
|
@ -187,7 +187,7 @@ evas_common_font_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Font *fn, int
|
|||
{
|
||||
if ((j > 0) && (chr_x + w > ext_x))
|
||||
{
|
||||
if (fg->ext_dat)
|
||||
if ((fg->ext_dat) && (dc->font_ext.func.gl_draw))
|
||||
{
|
||||
/* ext glyph draw */
|
||||
dc->font_ext.func.gl_draw(dc->font_ext.data,
|
||||
|
|
|
@ -279,7 +279,7 @@ _xre_image_resize(XR_Image *im, int w, int h)
|
|||
ww = w; hh = h;
|
||||
RECTS_CLIP_TO_RECT(x, y, ww, hh, 0, 0, im->w, im->h);
|
||||
old_surface = im->surface;
|
||||
im->surface = _xr_render_surface_new(old_surface->xinf, w, h, old_surface->fmt, old_surface->alpha);
|
||||
im->surface = _xr_render_surface_new(old_surface->xinf, w + 1, h + 1, old_surface->fmt, old_surface->alpha);
|
||||
if (im->surface)
|
||||
_xr_render_surface_copy(old_surface, im->surface, 0, 0, 0, 0, ww, hh);
|
||||
_xr_render_surface_free(old_surface);
|
||||
|
@ -451,11 +451,11 @@ _xre_image_alpha_set(XR_Image *im, int alpha)
|
|||
old_surface = im->surface;
|
||||
im->surface = NULL;
|
||||
if (im->alpha)
|
||||
im->surface = _xr_render_surface_new(im->xinf, im->w, im->h, im->xinf->fmt32, 1);
|
||||
im->surface = _xr_render_surface_new(im->xinf, im->w + 1, im->h + 1, im->xinf->fmt32, 1);
|
||||
else
|
||||
im->surface = _xr_render_surface_new(im->xinf, im->w, im->h, im->xinf->fmt24, 0);
|
||||
im->surface = _xr_render_surface_new(im->xinf, im->w + 1, im->h + 1, im->xinf->fmt24, 0);
|
||||
if (im->surface)
|
||||
_xr_render_surface_copy(old_surface, im->surface, 0, 0, 0, 0, im->w, im->h);
|
||||
_xr_render_surface_copy(old_surface, im->surface, 0, 0, 0, 0, im->w + 1, im->h + 1);
|
||||
_xr_render_surface_free(old_surface);
|
||||
}
|
||||
if (im->updates)
|
||||
|
@ -517,14 +517,27 @@ _xre_image_surface_gen(XR_Image *im)
|
|||
}
|
||||
if (im->alpha)
|
||||
{
|
||||
im->surface = _xr_render_surface_new(im->xinf, im->w, im->h, im->xinf->fmt32, 1);
|
||||
im->surface = _xr_render_surface_new(im->xinf, im->w + 1, im->h + 1, im->xinf->fmt32, 1);
|
||||
_xr_render_surface_argb_pixels_fill(im->surface, im->w, im->h, data, 0, 0, im->w, im->h);
|
||||
}
|
||||
else
|
||||
{
|
||||
im->surface = _xr_render_surface_new(im->xinf, im->w, im->h, im->xinf->fmt24, 0);
|
||||
im->surface = _xr_render_surface_new(im->xinf, im->w + 1, im->h + 1, im->xinf->fmt24, 0);
|
||||
_xr_render_surface_rgb_pixels_fill(im->surface, im->w, im->h, data, 0, 0, im->w, im->h);
|
||||
}
|
||||
/* fill right and bottom pixel so interpolation works right */
|
||||
_xr_render_surface_copy(im->surface, im->surface,
|
||||
im->w - 1, 0,
|
||||
im->w, 0,
|
||||
1, im->h);
|
||||
_xr_render_surface_copy(im->surface, im->surface,
|
||||
0, im->h - 1,
|
||||
0, im->h,
|
||||
im->w, 1);
|
||||
_xr_render_surface_copy(im->surface, im->surface,
|
||||
im->w - 1, im->h - 1,
|
||||
im->w, im->h,
|
||||
1, 1);
|
||||
if ((im->im) && (!im->dirty))
|
||||
{
|
||||
evas_common_image_unref(im->im);
|
||||
|
|
|
@ -360,10 +360,17 @@ _xr_render_surface_composite(Xrender_Surface *srs, Xrender_Surface *drs, RGBA_Dr
|
|||
xf.matrix[2][0] = 0;
|
||||
xf.matrix[2][1] = 0;
|
||||
xf.matrix[2][2] = 1;
|
||||
trs = _xr_render_surface_new(srs->xinf, sw, sh, srs->fmt, srs->alpha);
|
||||
trs = _xr_render_surface_new(srs->xinf, sw + 1, sh + 1, srs->fmt, srs->alpha);
|
||||
XRenderSetPictureTransform(srs->xinf->disp, srs->pic, &xf);
|
||||
XRenderComposite(srs->xinf->disp, PictOpSrc, srs->pic, mask,
|
||||
trs->pic, sx, sy, 0, 0, 0, 0, sw, sh);
|
||||
/* fill right and bottom pixel so interpolation works right */
|
||||
XRenderComposite(srs->xinf->disp, PictOpSrc, srs->pic, mask,
|
||||
trs->pic, sx + sw, sy, 0, 0, sw, 0, 1, sh);
|
||||
XRenderComposite(srs->xinf->disp, PictOpSrc, srs->pic, mask,
|
||||
trs->pic, sx, sy + sh, 0, 0, 0, sh, sw + 1, 1);
|
||||
XRenderComposite(srs->xinf->disp, PictOpSrc, srs->pic, mask,
|
||||
trs->pic, sx + sw, sy, 0, 0, sw, 0, 1, sh);
|
||||
mask = 0;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue