summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2010-11-08 14:34:19 +0000
committerCedric BAIL <cedric.bail@free.fr>2010-11-08 14:34:19 +0000
commit87d707ee2cc1ab1c93bb0182636c4aa33a16ec7c (patch)
treef7d648df999b3d4bfe0cb4970459c25f4c90f5c4 /legacy
parent4e1ea67122f5d12ddd9980451b78a939f09e68ab (diff)
* evas: some style fix.
SVN revision: 54331
Diffstat (limited to 'legacy')
-rw-r--r--legacy/evas/src/lib/engines/common/evas_line_main.c297
1 files changed, 147 insertions, 150 deletions
diff --git a/legacy/evas/src/lib/engines/common/evas_line_main.c b/legacy/evas/src/lib/engines/common/evas_line_main.c
index 7e37d7b13b..04401cbe36 100644
--- a/legacy/evas/src/lib/engines/common/evas_line_main.c
+++ b/legacy/evas/src/lib/engines/common/evas_line_main.c
@@ -296,153 +296,151 @@ _evas_draw_simple_line(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, i
296} 296}
297 297
298 298
299#define SETUP_LINE_SHALLOW \ 299#define SETUP_LINE_SHALLOW \
300 if (x0 > x1) \ 300 if (x0 > x1) \
301 { \ 301 { \
302 EXCHANGE_POINTS(x0, y0, x1, y1) \ 302 EXCHANGE_POINTS(x0, y0, x1, y1); \
303 dx = -dx; \ 303 dx = -dx; \
304 dy = -dy; \ 304 dy = -dy; \
305 } \ 305 } \
306 \ 306 \
307 px = x0; \ 307 px = x0; \
308 py = y0; \ 308 py = y0; \
309 \ 309 \
310 p0_in = (IN_RANGE(x0 , y0 , clw, clh) ? 1 : 0); \ 310 p0_in = (IN_RANGE(x0 , y0 , clw, clh) ? 1 : 0); \
311 p1_in = (IN_RANGE(x1 , y1 , clw, clh) ? 1 : 0); \ 311 p1_in = (IN_RANGE(x1 , y1 , clw, clh) ? 1 : 0); \
312 \ 312 \
313 dely = 1; \ 313 dely = 1; \
314 dh = dstw; \ 314 dh = dstw; \
315 if (dy < 0) \ 315 if (dy < 0) \
316 { \ 316 { \
317 dely = -1; \ 317 dely = -1; \
318 dh = -dstw; \ 318 dh = -dstw; \
319 } \ 319 } \
320 \ 320 \
321 dyy = ((dy) << 16) / (dx); \ 321 dyy = ((dy) << 16) / (dx); \
322 \ 322 \
323 if (!p0_in) \ 323 if (!p0_in) \
324 { \ 324 { \
325 dxx = ((dx) << 16) / (dy); \ 325 dxx = ((dx) << 16) / (dy); \
326 if (px < 0) \ 326 if (px < 0) \
327 { \ 327 { \
328 x = -px; px = 0; \ 328 x = -px; px = 0; \
329 yy = x * dyy; \ 329 yy = x * dyy; \
330 y = yy >> 16; \ 330 y = yy >> 16; \
331 if (!a_a) \ 331 if (!a_a) \
332 y += (yy - (y << 16)) >> 15; \ 332 y += (yy - (y << 16)) >> 15; \
333 py += y; \ 333 py += y; \
334 if ((dely > 0) && (py >= clh)) \ 334 if ((dely > 0) && (py >= clh)) \
335 return; \ 335 return; \
336 else if ((dely < 0) && (py < -1)) \ 336 else if ((dely < 0) && (py < -1)) \
337 return; \ 337 return; \
338 } \ 338 } \
339 \ 339 \
340 y = 0; \ 340 y = 0; \
341 if ((dely > 0) && (py < -1)) \ 341 if ((dely > 0) && (py < 0)) \
342 y = (-1 - py); \ 342 y = (-1 - py); \
343 else if ((dely < 0) && (py >= clh)) \ 343 else if ((dely < 0) && (py >= clh)) \
344 y = (clh - 1 - py); \ 344 y = (clh - 1 - py); \
345 \ 345 \
346 xx = y * dxx; \ 346 xx = y * dxx; \
347 x = xx >> 16; \ 347 x = xx >> 16; \
348 if (!a_a) \ 348 if (!a_a) \
349 x += (xx - (x << 16)) >> 15; \ 349 x += (xx - (x << 16)) >> 15; \
350 px += x; \ 350 px += x; \
351 if (px >= clw) return; \ 351 if (px >= clw) return; \
352 \ 352 \
353 yy = x * dyy; \ 353 yy = x * dyy; \
354 y = yy >> 16; \ 354 y = yy >> 16; \
355 if (!a_a) \ 355 if (!a_a) \
356 y += (yy - (y << 16)) >> 15; \ 356 y += (yy - (y << 16)) >> 15; \
357 py += y; \ 357 py += y; \
358 if ((dely > 0) && (py >= clh)) \ 358 if ((dely > 0) && (py >= clh)) \
359 return; \ 359 return; \
360 else if ((dely < 0) && (py < -1)) \ 360 else if ((dely < 0) && (py < -1)) \
361 return; \ 361 return; \
362 } \ 362 } \
363 \ 363 \
364 p = data + (dstw * py) + px; \ 364 p = data + (dstw * py) + px; \
365 \ 365 \
366 x = px - x0; \ 366 x = px - x0; \
367 yy = x * dyy; \ 367 yy = x * dyy; \
368 prev_y = (yy >> 16); \ 368 prev_y = (yy >> 16); \
369 \ 369 \
370 rx = MIN(x1 + 1, clw); \ 370 rx = MIN(x1 + 1, clw); \
371 by = clh - 1; 371 by = clh - 1;
372 372
373 373
374#define SETUP_LINE_STEEP \ 374#define SETUP_LINE_STEEP \
375 if (y0 > y1) \ 375 if (y0 > y1) \
376 { \ 376 { \
377 EXCHANGE_POINTS(x0, y0, x1, y1) \ 377 EXCHANGE_POINTS(x0, y0, x1, y1); \
378 dx = -dx; \ 378 dx = -dx; \
379 dy = -dy; \ 379 dy = -dy; \
380 } \ 380 } \
381 \ 381 \
382 px = x0; \ 382 px = x0; \
383 py = y0; \ 383 py = y0; \
384 \ 384 \
385 p0_in = (IN_RANGE(x0 , y0 , clw, clh) ? 1 : 0); \ 385 p0_in = (IN_RANGE(x0 , y0 , clw, clh) ? 1 : 0); \
386 p1_in = (IN_RANGE(x1 , y1 , clw, clh) ? 1 : 0); \ 386 p1_in = (IN_RANGE(x1 , y1 , clw, clh) ? 1 : 0); \
387 \ 387 \
388 delx = 1; \ 388 delx = 1; \
389 if (dx < 0) \ 389 if (dx < 0) \
390 delx = -1; \ 390 delx = -1; \
391 \ 391 \
392 dxx = ((dx) << 16) / (dy); \ 392 dxx = ((dx) << 16) / (dy); \
393 \ 393 \
394 if (!p0_in) \ 394 if (!p0_in) \
395 { \ 395 { \
396 dyy = ((dy) << 16) / (dx); \ 396 dyy = ((dy) << 16) / (dx); \
397 \ 397 \
398 if (py < 0) \ 398 if (py < 0) \
399 { \ 399 { \
400 y = -py; py = 0; \ 400 y = -py; py = 0; \
401 xx = y * dxx; \ 401 xx = y * dxx; \
402 x = xx >> 16; \ 402 x = xx >> 16; \
403 if (!a_a) \ 403 if (!a_a) \
404 x += (xx - (x << 16)) >> 15; \ 404 x += (xx - (x << 16)) >> 15; \
405 px += x; \ 405 px += x; \
406 if ((delx > 0) && (px >= clw)) \ 406 if ((delx > 0) && (px >= clw)) \
407 return; \ 407 return; \
408 else if ((delx < 0) && (px < -1)) \ 408 else if ((delx < 0) && (px < -1)) \
409 return; \ 409 return; \
410 } \ 410 } \
411 \ 411 \
412 x = 0; \ 412 x = 0; \
413 if ((delx > 0) && (px < -1)) \ 413 if ((delx > 0) && (px < -1)) \
414 x = (-1 - px); \ 414 x = (-1 - px); \
415 else if ((delx < 0) && (px >= clw)) \ 415 else if ((delx < 0) && (px >= clw)) \
416 x = (clw - 1 - px); \ 416 x = (clw - 1 - px); \
417 \ 417 \
418 yy = x * dyy; \ 418 yy = x * dyy; \
419 y = yy >> 16; \ 419 y = yy >> 16; \
420 if (!a_a) \ 420 if (!a_a) \
421 y += (yy - (y << 16)) >> 15; \ 421 y += (yy - (y << 16)) >> 15; \
422 py += y; \ 422 py += y; \
423 if (py >= clh) return; \ 423 if (py >= clh) return; \
424 \ 424 \
425 xx = y * dxx; \ 425 xx = y * dxx; \
426 x = xx >> 16; \ 426 x = xx >> 16; \
427 if (!a_a) \ 427 if (!a_a) \
428 x += (xx - (x << 16)) >> 15; \ 428 x += (xx - (x << 16)) >> 15; \
429 px += x; \ 429 px += x; \
430 if ((delx > 0) && (px >= clw)) \ 430 if ((delx > 0) && (px >= clw)) \
431 return; \ 431 return; \
432 else if ((delx < 0) && (px < -1)) \ 432 else if ((delx < 0) && (px < -1)) \
433 return; \ 433 return; \
434 } \ 434 } \
435 \ 435 \
436 p = data + (dstw * py) + px; \ 436 p = data + (dstw * py) + px; \
437 \ 437 \
438 y = py - y0; \ 438 y = py - y0; \
439 xx = y * dxx; \ 439 xx = y * dxx; \
440 prev_x = (xx >> 16); \ 440 prev_x = (xx >> 16); \
441 \ 441 \
442 by = MIN(y1 + 1, clh); \ 442 by = MIN(y1 + 1, clh); \
443 rx = clw - 1; 443 rx = clw - 1;
444
445
446 444
447static void 445static void
448_evas_draw_line(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, int x1, int y1) 446_evas_draw_line(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, int x1, int y1)
@@ -485,7 +483,7 @@ _evas_draw_line(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, int x1,
485 /* shallow: x-parametric */ 483 /* shallow: x-parametric */
486 if ((dy < dx) || (dy < -dx)) 484 if ((dy < dx) || (dy < -dx))
487 { 485 {
488 SETUP_LINE_SHALLOW 486 SETUP_LINE_SHALLOW;
489 487
490 while (px < rx) 488 while (px < rx)
491 { 489 {
@@ -523,7 +521,7 @@ _evas_draw_line(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, int x1,
523 521
524 /* steep: y-parametric */ 522 /* steep: y-parametric */
525 523
526 SETUP_LINE_STEEP 524 SETUP_LINE_STEEP;
527 525
528 while (py < by) 526 while (py < by)
529 { 527 {
@@ -571,7 +569,7 @@ _evas_draw_line_aa(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, int x
571 RGBA_Gfx_Pt_Func pfunc; 569 RGBA_Gfx_Pt_Func pfunc;
572 570
573 if (y0 > y1) 571 if (y0 > y1)
574 EXCHANGE_POINTS(x0, y0, x1, y1) 572 EXCHANGE_POINTS(x0, y0, x1, y1);
575 dx = x1 - x0; 573 dx = x1 - x0;
576 dy = y1 - y0; 574 dy = y1 - y0;
577 575
@@ -602,7 +600,7 @@ _evas_draw_line_aa(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, int x
602 /* shallow: x-parametric */ 600 /* shallow: x-parametric */
603 if ((dy < dx) || (dy < -dx)) 601 if ((dy < dx) || (dy < -dx))
604 { 602 {
605 SETUP_LINE_SHALLOW 603 SETUP_LINE_SHALLOW;
606 604
607 while (px < rx) 605 while (px < rx)
608 { 606 {
@@ -642,8 +640,7 @@ _evas_draw_line_aa(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, int x
642 } 640 }
643 641
644 /* steep: y-parametric */ 642 /* steep: y-parametric */
645 643 SETUP_LINE_STEEP;
646 SETUP_LINE_STEEP
647 644
648 while (py < by) 645 while (py < by)
649 { 646 {