evas/line - fixed indentation

SVN revision: 71976
This commit is contained in:
ChunEon Park 2012-06-12 02:47:34 +00:00
parent 06c4fa8cac
commit ea43e9004f
1 changed files with 87 additions and 90 deletions

View File

@ -150,7 +150,7 @@ _evas_draw_simple_line(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, i
pixman_op_t op = PIXMAN_OP_SRC; // _EVAS_RENDER_COPY pixman_op_t op = PIXMAN_OP_SRC; // _EVAS_RENDER_COPY
if (dc->render_op == _EVAS_RENDER_BLEND) if (dc->render_op == _EVAS_RENDER_BLEND)
op = PIXMAN_OP_OVER; op = PIXMAN_OP_OVER;
# endif # endif
#endif #endif
dstw = dst->cache_entry.w; dstw = dst->cache_entry.w;
@ -193,7 +193,7 @@ _evas_draw_simple_line(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, i
p = dst->image.data + (dstw * y0) + x0; p = dst->image.data + (dstw * y0) + x0;
#ifdef HAVE_PIXMAN #ifdef HAVE_PIXMAN
# ifdef PIXMAN_LINE # ifdef PIXMAN_LINE
if ((dst->pixman.im) && (dc->col.pixman_color_image) && if ((dst->pixman.im) && (dc->col.pixman_color_image) &&
(!dc->mask.mask)) (!dc->mask.mask))
pixman_image_composite(op, dc->col.pixman_color_image, pixman_image_composite(op, dc->col.pixman_color_image,
NULL, dst->pixman.im, NULL, dst->pixman.im,
@ -205,7 +205,7 @@ _evas_draw_simple_line(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, i
dst->pixman.im, dst->pixman.im,
x0, y0, 0, 0, x0, y0, len, 1); x0, y0, 0, 0, x0, y0, len, 1);
else else
# endif # endif
#endif #endif
{ {
sfunc = evas_common_gfx_func_composite_color_span_get(color, dst, len, dc->render_op); sfunc = evas_common_gfx_func_composite_color_span_get(color, dst, len, dc->render_op);
@ -221,13 +221,13 @@ _evas_draw_simple_line(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, i
if (dx == 0) if (dx == 0)
{ {
if ((x0 >= lx) && (x0 <= rx)) if ((x0 >= lx) && (x0 <= rx))
{ {
if (y0 < ty) y0 = ty; if (y0 < ty) y0 = ty;
if (y1 > by) y1 = by; if (y1 > by) y1 = by;
len = y1 - y0 + 1; len = y1 - y0 + 1;
p = dst->image.data + (dstw * y0) + x0; p = dst->image.data + (dstw * y0) + x0;
#ifdef HAVE_PIXMAN #ifdef HAVE_PIXMAN
# ifdef PIXMAN_LINE # ifdef PIXMAN_LINE
if ((dst->pixman.im) && (dc->col.pixman_color_image) && if ((dst->pixman.im) && (dc->col.pixman_color_image) &&
@ -241,7 +241,7 @@ _evas_draw_simple_line(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, i
dc->mask.mask->pixman.im, dst->pixman.im, dc->mask.mask->pixman.im, dst->pixman.im,
x0, y0, 0, 0, x0, y0, 1, len); x0, y0, 0, 0, x0, y0, 1, len);
else else
# endif # endif
#endif #endif
{ {
while (len--) while (len--)
@ -251,95 +251,93 @@ _evas_draw_simple_line(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, i
} }
} }
} }
return; return;
} }
if ((dy == dx) || (dy == -dx)) if ((dy == dx) || (dy == -dx))
{ {
int p0_in, p1_in; int p0_in, p1_in;
p0_in = (IN_RECT(x0, y0, clx, cly, clw, clh) ? 1 : 0); p0_in = (IN_RECT(x0, y0, clx, cly, clw, clh) ? 1 : 0);
p1_in = (IN_RECT(x1, y1, clx, cly, clw, clh) ? 1 : 0); p1_in = (IN_RECT(x1, y1, clx, cly, clw, clh) ? 1 : 0);
if (dy > 0) if (dy > 0)
{ {
if (!p0_in) if (!p0_in)
{ {
x0 = x0 + (ty - y0); x0 = x0 + (ty - y0);
y0 = ty; y0 = ty;
if (x0 > rx) return; if (x0 > rx) return;
if (x0 < lx) if (x0 < lx)
{ {
y0 = y0 + (lx - x0); y0 = y0 + (lx - x0);
x0 = lx; x0 = lx;
if ((y0 < ty) || (y0 > by)) return; if ((y0 < ty) || (y0 > by)) return;
} }
} }
if (!p1_in) if (!p1_in)
{ {
x1 = x0 + (by - y0); x1 = x0 + (by - y0);
y1 = by; y1 = by;
if (x1 < lx) return; if (x1 < lx) return;
if (x1 > rx) if (x1 > rx)
{ {
y1 = y0 + (rx - x0); y1 = y0 + (rx - x0);
x1 = rx; x1 = rx;
if ((y1 < ty) || (y1 > by)) return; if ((y1 < ty) || (y1 > by)) return;
} }
} }
} }
else else
{ {
if (!p0_in) if (!p0_in)
{ {
x0 = x0 - (by - y0); x0 = x0 - (by - y0);
y0 = by; y0 = by;
if (x0 > rx) return; if (x0 > rx) return;
if (x0 < lx) if (x0 < lx)
{ {
y0 = y0 - (lx - x0); y0 = y0 - (lx - x0);
x0 = lx; x0 = lx;
if ((y0 < ty) || (y0 > by)) return; if ((y0 < ty) || (y0 > by)) return;
} }
} }
if (!p1_in) if (!p1_in)
{ {
x1 = x0 - (ty - y0); x1 = x0 - (ty - y0);
y1 = ty; y1 = ty;
if (x1 < lx) return; if (x1 < lx) return;
if (x1 > rx) if (x1 > rx)
{ {
y1 = y0 - (rx - x0); y1 = y0 - (rx - x0);
x1 = rx; x1 = rx;
if ((y1 < ty) || (y1 > by)) return; if ((y1 < ty) || (y1 > by)) return;
} }
} }
} }
if (y1 > y0) if (y1 > y0)
{ {
p = dst->image.data + (dstw * y0) + x0; p = dst->image.data + (dstw * y0) + x0;
len = y1 - y0 + 1; len = y1 - y0 + 1;
if (dx > 0) dstw++; if (dx > 0) dstw++;
else dstw--; else dstw--;
} }
else else
{ {
len = y0 - y1 + 1; len = y0 - y1 + 1;
p = dst->image.data + (dstw * y1) + x1; p = dst->image.data + (dstw * y1) + x1;
if (dx > 0) dstw--; if (dx > 0) dstw--;
else dstw++; else dstw++;
} }
#ifdef HAVE_PIXMAN #ifdef HAVE_PIXMAN
# ifdef PIXMAN_LINE # ifdef PIXMAN_LINE
int pixman_x_position = x0; int pixman_x_position = x0;
int pixman_y_position = y0; int pixman_y_position = y0;
int x_unit = dstw - dst->cache_entry.w; int x_unit = dstw - dst->cache_entry.w;
# endif # endif
#endif #endif
while (len--)
{
while (len--)
{
#ifdef HAVE_PIXMAN #ifdef HAVE_PIXMAN
# ifdef PIXMAN_LINE # ifdef PIXMAN_LINE
if ((dst->pixman.im) && (dc->col.pixman_color_image) && if ((dst->pixman.im) && (dc->col.pixman_color_image) &&
@ -360,7 +358,7 @@ _evas_draw_simple_line(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, i
pixman_x_position, pixman_x_position,
pixman_y_position, 1, 1); pixman_y_position, 1, 1);
else else
# endif # endif
#endif #endif
pfunc(0, 255, color, p); pfunc(0, 255, color, p);
} }
@ -368,13 +366,12 @@ _evas_draw_simple_line(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, i
# ifdef PIXMAN_LINE # ifdef PIXMAN_LINE
pixman_x_position += x_unit; pixman_x_position += x_unit;
pixman_y_position += 1; pixman_y_position += 1;
# endif # endif
#endif #endif
p += dstw; p += dstw;
} }
} }
#define SETUP_LINE_SHALLOW \ #define SETUP_LINE_SHALLOW \
if (x0 > x1) \ if (x0 > x1) \
{ \ { \