ewwwwwwwwwwwwps! scaling blending buggy! fix fix fix fix :) GOTCHA!

SVN revision: 3434
This commit is contained in:
Carsten Haitzler 2000-09-13 04:18:39 +00:00
parent 064b8e2e81
commit 542cc394f8
6 changed files with 11 additions and 47 deletions

View File

@ -1017,11 +1017,6 @@ __imlib_BlendRGBAToData(DATA32 *src, int src_w, int src_h, DATA32 *dst,
}
#define LINESIZE 16
#define CLIP(x, y, w, h, xx, yy, ww, hh) \
if (x < (xx)) {w += (x - (xx)); x = (xx);} \
if (y < (yy)) {h += (y - (yy)); y = (yy);} \
if ((x + w) > ((xx) + (ww))) {w = (ww) - x;} \
if ((y + h) > ((yy) + (hh))) {h = (hh) - y;}
void
__imlib_BlendImageToImage(ImlibImage *im_src, ImlibImage *im_dst,
@ -1133,29 +1128,8 @@ __imlib_BlendImageToImage(ImlibImage *im_src, ImlibImage *im_dst,
{
return;
}
/* if we are scaling the image at all make a scaling buffer */
if (!((sw == dw) && (sh == dh) && (ddw > 0) && (ddh > 0)))
{
scaleinfo = __imlib_CalcScaleInfo(im_src, ssw, ssh, ddw, ddh, aa);
if (!scaleinfo) return;
}
else
{
if (!IMAGE_HAS_ALPHA(im_dst))
merge_alpha = 0;
if (!IMAGE_HAS_ALPHA(im_src))
{
rgb_src = 1;
if (merge_alpha)
blend = 1;
}
__imlib_BlendRGBAToData(im_src->data, im_src->w, im_src->h,
im_dst->data, im_dst->w, im_dst->h,
ssx, ssy,
ddx, ddy,
ssw, ssh, blend, merge_alpha, cm, op, rgb_src);
return;
}
scaleinfo = __imlib_CalcScaleInfo(im_src, ssw, ssh, ddw, ddh, aa);
if (!scaleinfo) return;
/* if we are scaling the image at all make a scaling buffer */
/* allocate a buffer to render scaled RGBA data into */
buf = malloc(dw * LINESIZE * sizeof(DATA32));

View File

@ -24,4 +24,12 @@ int __imlib_get_cpuid(void);
#define CPUID_XMM (1 << 25)
#endif
#define CLIP(x, y, w, h, xx, yy, ww, hh) \
if (x < (xx)) {w += (x - (xx)); x = (xx);} \
if (y < (yy)) {h += (y - (yy)); y = (yy);} \
if ((x + w) > ((xx) + (ww))) {w = (ww) - (x - xx);} \
if ((y + h) > ((yy) + (hh))) {h = (hh) - (y - yy);}
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
#endif

View File

@ -15,13 +15,6 @@
/* size of the lines per segment we scale / render at a time */
#define LINESIZE 16
/* useful macro */
#define CLIP(x, y, w, h, xx, yy, ww, hh) \
if (x < (xx)) {w += (x - (xx)); x = (xx);} \
if (y < (yy)) {h += (y - (yy)); y = (yy);} \
if ((x + w) > ((xx) + (ww))) {w = (ww) - x;} \
if ((y + h) > ((yy) + (hh))) {h = (hh) - y;}
void
__imlib_generic_render(DATA32 *src, int jump, int w, int h, int dx, int dy,
XImage *xim, Visual *v)

View File

@ -13,9 +13,6 @@
#define XY_IN_RECT(x, y, rx, ry, rw, rh) \
(((x) >= (rx)) && ((y) >= (ry)) && ((x) <= ((rx) + (rw))) && ((y) <= ((ry) + (rh))))
#define MAX(a,b) (((a) > (b)) ? (a) : (b))
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
#define round(a) floor(a+0.5)
void

View File

@ -272,8 +272,7 @@ __imlib_RotateAA(DATA32 *src, DATA32 *dest, int sow, int sw, int sh,
/*\ Should this be in blend.c ?? \*/
#define LINESIZE 16
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
void
__imlib_BlendImageToImageSkewed(ImlibImage *im_src, ImlibImage *im_dst,
char aa, char blend, char merge_alpha,

View File

@ -18,13 +18,6 @@ struct _tile
#define TS (1 << TBITS)
#define T(x, y) t[((y) * tw) + (x)]
#define CLIP(x, y, w, h, xx, yy, ww, hh) \
if (x < (xx)) {w += (x - (xx)); x = (xx);} \
if (y < (yy)) {h += (y - (yy)); y = (yy);} \
if ((x + w) > ((xx) + (ww))) {w = (ww) - x;} \
if ((y + h) > ((yy) + (hh))) {h = (hh) - y;}
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
ImlibUpdate *
__imlib_MergeUpdate(ImlibUpdate *u, int w, int h, int hgapmax)