diff options
author | Carsten Haitzler <raster@rasterman.com> | 2009-12-30 11:35:40 +0000 |
---|---|---|
committer | Carsten Haitzler <raster@rasterman.com> | 2009-12-30 11:35:40 +0000 |
commit | fa435074e0c78c50d49434f10707715af63521f1 (patch) | |
tree | 26d07082312d1b8a4530de8551a6746e03ad7d5d /legacy/evas/src/modules/engines/gl_x11/evas_engine.c | |
parent | 65c4336b0b6f436300c83c345ac999a6c3dc22f9 (diff) |
1. line support in gl engine - as if anyone uses lines
2. fix clipping for gl maps - was setting them when it shouldnt.
SVN revision: 44782
Diffstat (limited to '')
-rw-r--r-- | legacy/evas/src/modules/engines/gl_x11/evas_engine.c | 206 |
1 files changed, 164 insertions, 42 deletions
diff --git a/legacy/evas/src/modules/engines/gl_x11/evas_engine.c b/legacy/evas/src/modules/engines/gl_x11/evas_engine.c index f8630c0622..f989aac2d9 100644 --- a/legacy/evas/src/modules/engines/gl_x11/evas_engine.c +++ b/legacy/evas/src/modules/engines/gl_x11/evas_engine.c | |||
@@ -354,7 +354,7 @@ eng_line_draw(void *data, void *context, void *surface, int x1, int y1, int x2, | |||
354 | eng_window_use(re->win); | 354 | eng_window_use(re->win); |
355 | evas_gl_common_context_target_surface_set(re->win->gl_context, surface); | 355 | evas_gl_common_context_target_surface_set(re->win->gl_context, surface); |
356 | re->win->gl_context->dc = context; | 356 | re->win->gl_context->dc = context; |
357 | //-// evas_gl_common_line_draw(re->win->gl_context, x1, y1, x2, y2); | 357 | evas_gl_common_line_draw(re->win->gl_context, x1, y1, x2, y2); |
358 | } | 358 | } |
359 | 359 | ||
360 | static void * | 360 | static void * |
@@ -390,55 +390,76 @@ eng_polygon_draw(void *data, void *context, void *surface, void *polygon) | |||
390 | static void | 390 | static void |
391 | eng_gradient2_color_np_stop_insert(void *data __UNUSED__, void *gradient __UNUSED__, int r __UNUSED__, int g __UNUSED__, int b __UNUSED__, int a __UNUSED__, float pos __UNUSED__) | 391 | eng_gradient2_color_np_stop_insert(void *data __UNUSED__, void *gradient __UNUSED__, int r __UNUSED__, int g __UNUSED__, int b __UNUSED__, int a __UNUSED__, float pos __UNUSED__) |
392 | { | 392 | { |
393 | evas_common_gradient2_color_np_stop_insert(gradient, r, g, b, a, pos); | ||
393 | } | 394 | } |
394 | 395 | ||
395 | static void | 396 | static void |
396 | eng_gradient2_clear(void *data __UNUSED__, void *gradient __UNUSED__) | 397 | eng_gradient2_clear(void *data __UNUSED__, void *gradient __UNUSED__) |
397 | { | 398 | { |
399 | evas_common_gradient2_clear(gradient); | ||
398 | } | 400 | } |
399 | 401 | ||
400 | static void | 402 | static void |
401 | eng_gradient2_fill_transform_set(void *data __UNUSED__, void *gradient __UNUSED__, void *transform __UNUSED__) | 403 | eng_gradient2_fill_transform_set(void *data __UNUSED__, void *gradient __UNUSED__, void *transform __UNUSED__) |
402 | { | 404 | { |
405 | evas_common_gradient2_fill_transform_set(gradient, transform); | ||
403 | } | 406 | } |
404 | 407 | ||
405 | static void | 408 | static void |
406 | eng_gradient2_fill_spread_set | 409 | eng_gradient2_fill_spread_set(void *data __UNUSED__, void *gradient __UNUSED__, int spread __UNUSED__) |
407 | (void *data __UNUSED__, void *gradient __UNUSED__, int spread __UNUSED__) | ||
408 | { | 410 | { |
411 | evas_common_gradient2_fill_spread_set(gradient, spread); | ||
409 | } | 412 | } |
410 | 413 | ||
411 | static void * | 414 | static void * |
412 | eng_gradient2_linear_new(void *data __UNUSED__) | 415 | eng_gradient2_linear_new(void *data __UNUSED__) |
413 | { | 416 | { |
414 | return NULL; | 417 | return evas_common_gradient2_linear_new(); |
415 | } | 418 | } |
416 | 419 | ||
417 | static void | 420 | static void |
418 | eng_gradient2_linear_free(void *data __UNUSED__, void *linear_gradient __UNUSED__) | 421 | eng_gradient2_linear_free(void *data __UNUSED__, void *linear_gradient __UNUSED__) |
419 | { | 422 | { |
423 | evas_common_gradient2_free(linear_gradient); | ||
420 | } | 424 | } |
421 | 425 | ||
422 | static void | 426 | static void |
423 | eng_gradient2_linear_fill_set(void *data __UNUSED__, void *linear_gradient __UNUSED__, float x0 __UNUSED__, float y0 __UNUSED__, float x1 __UNUSED__, float y1 __UNUSED__) | 427 | eng_gradient2_linear_fill_set(void *data __UNUSED__, void *linear_gradient __UNUSED__, float x0 __UNUSED__, float y0 __UNUSED__, float x1 __UNUSED__, float y1 __UNUSED__) |
424 | { | 428 | { |
429 | evas_common_gradient2_linear_fill_set(linear_gradient, x0, y0, x1, y1); | ||
425 | } | 430 | } |
426 | 431 | ||
427 | static int | 432 | static int |
428 | eng_gradient2_linear_is_opaque(void *data __UNUSED__, void *context __UNUSED__, void *linear_gradient __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__) | 433 | eng_gradient2_linear_is_opaque(void *data __UNUSED__, void *context __UNUSED__, void *linear_gradient __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__) |
429 | { | 434 | { |
430 | return 1; | 435 | RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context; |
436 | RGBA_Gradient2 *gr = (RGBA_Gradient2 *)linear_gradient; | ||
437 | |||
438 | if (!dc || !gr || !gr->type.geometer) return 0; | ||
439 | return !(gr->type.geometer->has_alpha(gr, dc->render_op) | | ||
440 | gr->type.geometer->has_mask(gr, dc->render_op)); | ||
431 | } | 441 | } |
432 | 442 | ||
433 | static int | 443 | static int |
434 | eng_gradient2_linear_is_visible(void *data __UNUSED__, void *context __UNUSED__, void *linear_gradient __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__) | 444 | eng_gradient2_linear_is_visible(void *data __UNUSED__, void *context __UNUSED__, void *linear_gradient __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__) |
435 | { | 445 | { |
446 | RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context; | ||
447 | |||
448 | if (!dc || !linear_gradient) return 0; | ||
436 | return 1; | 449 | return 1; |
437 | } | 450 | } |
438 | 451 | ||
439 | static void | 452 | static void |
440 | eng_gradient2_linear_render_pre(void *data __UNUSED__, void *context __UNUSED__, void *linear_gradient __UNUSED__) | 453 | eng_gradient2_linear_render_pre(void *data __UNUSED__, void *context __UNUSED__, void *linear_gradient __UNUSED__) |
441 | { | 454 | { |
455 | RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context; | ||
456 | RGBA_Gradient2 *gr = (RGBA_Gradient2 *)linear_gradient; | ||
457 | int len; | ||
458 | |||
459 | if (!dc || !gr || !gr->type.geometer) return; | ||
460 | gr->type.geometer->geom_update(gr); | ||
461 | len = gr->type.geometer->get_map_len(gr); | ||
462 | evas_common_gradient2_map(dc, gr, len); | ||
442 | } | 463 | } |
443 | 464 | ||
444 | static void | 465 | static void |
@@ -449,39 +470,86 @@ eng_gradient2_linear_render_post(void *data __UNUSED__, void *linear_gradient __ | |||
449 | static void | 470 | static void |
450 | eng_gradient2_linear_draw(void *data __UNUSED__, void *context __UNUSED__, void *surface __UNUSED__, void *linear_gradient __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__) | 471 | eng_gradient2_linear_draw(void *data __UNUSED__, void *context __UNUSED__, void *surface __UNUSED__, void *linear_gradient __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__) |
451 | { | 472 | { |
473 | Render_Engine *re; | ||
474 | |||
475 | re = (Render_Engine *)data; | ||
476 | eng_window_use(re->win); | ||
477 | re->win->gl_context->dc = context; | ||
478 | { | ||
479 | Evas_GL_Image *gim; | ||
480 | RGBA_Image *im; | ||
481 | RGBA_Draw_Context *dc = context; | ||
482 | int op = dc->render_op, cuse = dc->clip.use; | ||
483 | |||
484 | im = (RGBA_Image *)evas_cache_image_empty(evas_common_image_cache_get()); | ||
485 | im = (RGBA_Image *)evas_cache_image_size_set(&im->cache_entry, w, h); | ||
486 | |||
487 | dc->render_op = _EVAS_RENDER_FILL; | ||
488 | dc->clip.use = 0; | ||
489 | |||
490 | // draw to buf, copy to tex, draw tex | ||
491 | evas_common_gradient2_draw(im, dc, 0, 0, w, h, linear_gradient); | ||
492 | |||
493 | gim = evas_gl_common_image_new_from_data(re->win->gl_context, w, h, | ||
494 | im->image.data, 1, | ||
495 | EVAS_COLORSPACE_ARGB8888); | ||
496 | dc->render_op = op; | ||
497 | dc->clip.use = cuse; | ||
498 | evas_gl_common_image_draw(re->win->gl_context, gim, 0, 0, w, h, x, y, w, h, 0); | ||
499 | evas_cache_image_drop(&im->cache_entry); | ||
500 | evas_gl_common_image_free(gim); | ||
501 | } | ||
452 | } | 502 | } |
453 | 503 | ||
454 | static void * | 504 | static void * |
455 | eng_gradient2_radial_new(void *data __UNUSED__) | 505 | eng_gradient2_radial_new(void *data __UNUSED__) |
456 | { | 506 | { |
457 | return NULL; | 507 | return evas_common_gradient2_radial_new(); |
458 | } | 508 | } |
459 | 509 | ||
460 | static void | 510 | static void |
461 | eng_gradient2_radial_free(void *data __UNUSED__, void *radial_gradient __UNUSED__) | 511 | eng_gradient2_radial_free(void *data __UNUSED__, void *radial_gradient __UNUSED__) |
462 | { | 512 | { |
513 | evas_common_gradient2_free(radial_gradient); | ||
463 | } | 514 | } |
464 | 515 | ||
465 | static void | 516 | static void |
466 | eng_gradient2_radial_fill_set(void *data __UNUSED__, void *radial_gradient __UNUSED__, float cx __UNUSED__, float cy __UNUSED__, float rx __UNUSED__, float ry __UNUSED__) | 517 | eng_gradient2_radial_fill_set(void *data __UNUSED__, void *radial_gradient __UNUSED__, float cx __UNUSED__, float cy __UNUSED__, float rx __UNUSED__, float ry __UNUSED__) |
467 | { | 518 | { |
519 | evas_common_gradient2_radial_fill_set(radial_gradient, cx, cy, rx, ry); | ||
468 | } | 520 | } |
469 | 521 | ||
470 | static int | 522 | static int |
471 | eng_gradient2_radial_is_opaque(void *data __UNUSED__, void *context __UNUSED__, void *radial_gradient __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__) | 523 | eng_gradient2_radial_is_opaque(void *data __UNUSED__, void *context __UNUSED__, void *radial_gradient __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__) |
472 | { | 524 | { |
473 | return 1; | 525 | RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context; |
526 | RGBA_Gradient2 *gr = (RGBA_Gradient2 *)radial_gradient; | ||
527 | |||
528 | if (!dc || !gr || !gr->type.geometer) return 0; | ||
529 | return !(gr->type.geometer->has_alpha(gr, dc->render_op) | | ||
530 | gr->type.geometer->has_mask(gr, dc->render_op)); | ||
474 | } | 531 | } |
475 | 532 | ||
476 | static int | 533 | static int |
477 | eng_gradient2_radial_is_visible(void *data __UNUSED__, void *context __UNUSED__, void *radial_gradient __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__) | 534 | eng_gradient2_radial_is_visible(void *data __UNUSED__, void *context __UNUSED__, void *radial_gradient __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__) |
478 | { | 535 | { |
536 | RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context; | ||
537 | |||
538 | if (!dc || !radial_gradient) return 0; | ||
479 | return 1; | 539 | return 1; |
480 | } | 540 | } |
481 | 541 | ||
482 | static void | 542 | static void |
483 | eng_gradient2_radial_render_pre(void *data __UNUSED__, void *context __UNUSED__, void *radial_gradient __UNUSED__) | 543 | eng_gradient2_radial_render_pre(void *data __UNUSED__, void *context __UNUSED__, void *radial_gradient __UNUSED__) |
484 | { | 544 | { |
545 | RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context; | ||
546 | RGBA_Gradient2 *gr = (RGBA_Gradient2 *)radial_gradient; | ||
547 | int len; | ||
548 | |||
549 | if (!dc || !gr || !gr->type.geometer) return; | ||
550 | gr->type.geometer->geom_update(gr); | ||
551 | len = gr->type.geometer->get_map_len(gr); | ||
552 | evas_common_gradient2_map(dc, gr, len); | ||
485 | } | 553 | } |
486 | 554 | ||
487 | static void | 555 | static void |
@@ -492,126 +560,157 @@ eng_gradient2_radial_render_post(void *data __UNUSED__, void *radial_gradient __ | |||
492 | static void | 560 | static void |
493 | eng_gradient2_radial_draw(void *data __UNUSED__, void *context __UNUSED__, void *surface __UNUSED__, void *radial_gradient __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__) | 561 | eng_gradient2_radial_draw(void *data __UNUSED__, void *context __UNUSED__, void *surface __UNUSED__, void *radial_gradient __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__) |
494 | { | 562 | { |
563 | Render_Engine *re; | ||
564 | |||
565 | re = (Render_Engine *)data; | ||
566 | eng_window_use(re->win); | ||
567 | re->win->gl_context->dc = context; | ||
568 | { | ||
569 | Evas_GL_Image *gim; | ||
570 | RGBA_Image *im; | ||
571 | RGBA_Draw_Context *dc = context; | ||
572 | int op = dc->render_op, cuse = dc->clip.use; | ||
573 | |||
574 | im = (RGBA_Image *)evas_cache_image_empty(evas_common_image_cache_get()); | ||
575 | im = (RGBA_Image *)evas_cache_image_size_set(&im->cache_entry, w, h); | ||
576 | |||
577 | dc->render_op = _EVAS_RENDER_FILL; | ||
578 | dc->clip.use = 0; | ||
579 | |||
580 | // draw to buf, copy to tex, draw tex | ||
581 | evas_common_gradient2_draw(im, dc, 0, 0, w, h, radial_gradient); | ||
582 | |||
583 | gim = evas_gl_common_image_new_from_data(re->win->gl_context, w, h, | ||
584 | im->image.data, 1, | ||
585 | EVAS_COLORSPACE_ARGB8888); | ||
586 | dc->render_op = op; | ||
587 | dc->clip.use = cuse; | ||
588 | evas_gl_common_image_draw(re->win->gl_context, gim, 0, 0, w, h, x, y, w, h, 0); | ||
589 | evas_cache_image_drop(&im->cache_entry); | ||
590 | evas_gl_common_image_free(gim); | ||
591 | } | ||
495 | } | 592 | } |
496 | 593 | ||
497 | static void * | 594 | static void * |
498 | eng_gradient_new(void *data __UNUSED__) | 595 | eng_gradient_new(void *data __UNUSED__) |
499 | { | 596 | { |
500 | //--// return evas_gl_common_gradient_new(); | 597 | return evas_common_gradient_new(); |
501 | return NULL; | ||
502 | } | 598 | } |
503 | 599 | ||
504 | static void | 600 | static void |
505 | eng_gradient_color_stop_add(void *data __UNUSED__, void *gradient, int r, int g, int b, int a, int delta) | 601 | eng_gradient_free(void *data __UNUSED__, void *gradient) |
506 | { | 602 | { |
507 | //--// evas_gl_common_gradient_color_stop_add(gradient, r, g, b, a, delta); | 603 | evas_common_gradient_free(gradient); |
508 | } | 604 | } |
509 | 605 | ||
510 | static void | 606 | static void |
511 | eng_gradient_alpha_stop_add(void *data __UNUSED__, void *gradient, int a, int delta) | 607 | eng_gradient_color_stop_add(void *data __UNUSED__, void *gradient, int r, int g, int b, int a, int delta) |
512 | { | 608 | { |
513 | //--// evas_gl_common_gradient_alpha_stop_add(gradient, a, delta); | 609 | evas_common_gradient_color_stop_add(gradient, r, g, b, a, delta); |
514 | } | 610 | } |
515 | 611 | ||
516 | static void | 612 | static void |
517 | eng_gradient_clear(void *data __UNUSED__, void *gradient) | 613 | eng_gradient_alpha_stop_add(void *data __UNUSED__, void *gradient, int a, int delta) |
518 | { | 614 | { |
519 | //--// evas_gl_common_gradient_clear(gradient); | 615 | evas_common_gradient_alpha_stop_add(gradient, a, delta); |
520 | } | 616 | } |
521 | 617 | ||
522 | static void | 618 | static void |
523 | eng_gradient_color_data_set(void *data __UNUSED__, void *gradient, void *map, int len, int has_alpha) | 619 | eng_gradient_color_data_set(void *data __UNUSED__, void *gradient, void *map, int len, int has_alpha) |
524 | { | 620 | { |
525 | //--// evas_gl_common_gradient_color_data_set(gradient, map, len, has_alpha); | 621 | evas_common_gradient_color_data_set(gradient, map, len, has_alpha); |
526 | } | 622 | } |
527 | 623 | ||
528 | static void | 624 | static void |
529 | eng_gradient_alpha_data_set(void *data __UNUSED__, void *gradient, void *alpha_map, int len) | 625 | eng_gradient_alpha_data_set(void *data __UNUSED__, void *gradient, void *alpha_map, int len) |
530 | { | 626 | { |
531 | //--// evas_gl_common_gradient_alpha_data_set(gradient, alpha_map, len); | 627 | evas_common_gradient_alpha_data_set(gradient, alpha_map, len); |
532 | } | 628 | } |
533 | 629 | ||
534 | static void | 630 | static void |
535 | eng_gradient_free(void *data __UNUSED__, void *gradient) | 631 | eng_gradient_clear(void *data __UNUSED__, void *gradient) |
536 | { | 632 | { |
537 | //--// evas_gl_common_gradient_free(gradient); | 633 | evas_common_gradient_clear(gradient); |
538 | } | 634 | } |
539 | 635 | ||
540 | static void | 636 | static void |
541 | eng_gradient_fill_set(void *data __UNUSED__, void *gradient, int x, int y, int w, int h) | 637 | eng_gradient_fill_set(void *data __UNUSED__, void *gradient, int x, int y, int w, int h) |
542 | { | 638 | { |
543 | //--// evas_gl_common_gradient_fill_set(gradient, x, y, w, h); | 639 | evas_common_gradient_fill_set(gradient, x, y, w, h); |
544 | } | 640 | } |
545 | 641 | ||
546 | static void | 642 | static void |
547 | eng_gradient_fill_angle_set(void *data __UNUSED__, void *gradient, double angle) | 643 | eng_gradient_fill_angle_set(void *data __UNUSED__, void *gradient, double angle) |
548 | { | 644 | { |
549 | //--// evas_gl_common_gradient_fill_angle_set(gradient, angle); | 645 | evas_common_gradient_fill_angle_set(gradient, angle); |
550 | } | 646 | } |
551 | 647 | ||
552 | static void | 648 | static void |
553 | eng_gradient_fill_spread_set(void *data __UNUSED__, void *gradient, int spread) | 649 | eng_gradient_fill_spread_set(void *data __UNUSED__, void *gradient, int spread) |
554 | { | 650 | { |
555 | //--// evas_gl_common_gradient_fill_spread_set(gradient, spread); | 651 | evas_common_gradient_fill_spread_set(gradient, spread); |
556 | } | 652 | } |
557 | 653 | ||
558 | static void | 654 | static void |
559 | eng_gradient_angle_set(void *data __UNUSED__, void *gradient, double angle) | 655 | eng_gradient_angle_set(void *data __UNUSED__, void *gradient, double angle) |
560 | { | 656 | { |
561 | //--// evas_gl_common_gradient_map_angle_set(gradient, angle); | 657 | evas_common_gradient_map_angle_set(gradient, angle); |
562 | } | 658 | } |
563 | 659 | ||
564 | static void | 660 | static void |
565 | eng_gradient_offset_set(void *data __UNUSED__, void *gradient, float offset) | 661 | eng_gradient_offset_set(void *data __UNUSED__, void *gradient, float offset) |
566 | { | 662 | { |
567 | //--// evas_gl_common_gradient_map_offset_set(gradient, offset); | 663 | evas_common_gradient_map_offset_set(gradient, offset); |
568 | } | 664 | } |
569 | 665 | ||
570 | static void | 666 | static void |
571 | eng_gradient_direction_set(void *data __UNUSED__, void *gradient, int direction) | 667 | eng_gradient_direction_set(void *data __UNUSED__, void *gradient, int direction) |
572 | { | 668 | { |
573 | //--// evas_gl_common_gradient_map_direction_set(gradient, direction); | 669 | evas_common_gradient_map_direction_set(gradient, direction); |
574 | } | 670 | } |
575 | 671 | ||
576 | static void | 672 | static void |
577 | eng_gradient_type_set(void *data __UNUSED__, void *gradient, char *name, char *params) | 673 | eng_gradient_type_set(void *data __UNUSED__, void *gradient, char *name, char *params) |
578 | { | 674 | { |
579 | //--// evas_gl_common_gradient_type_set(gradient, name, params); | 675 | evas_common_gradient_type_set(gradient, name, params); |
580 | } | 676 | } |
581 | 677 | ||
582 | static int | 678 | static int |
583 | eng_gradient_is_opaque(void *data, void *context, void *gradient, int x, int y, int w, int h) | 679 | eng_gradient_is_opaque(void *data, void *context, void *gradient, int x, int y, int w, int h) |
584 | { | 680 | { |
585 | Render_Engine *re = (Render_Engine *)data; | 681 | RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context; |
586 | 682 | RGBA_Gradient *gr = (RGBA_Gradient *)gradient; | |
587 | re->win->gl_context->dc = context; | 683 | |
588 | //--// return evas_gl_common_gradient_is_opaque(re->win->gl_context, gradient, x, y, w, h); | 684 | if (!dc || !gr || !gr->type.geometer) return 0; |
589 | return 0; | 685 | return !(gr->type.geometer->has_alpha(gr, dc->render_op) | |
686 | gr->type.geometer->has_mask(gr, dc->render_op)); | ||
590 | } | 687 | } |
591 | 688 | ||
592 | static int | 689 | static int |
593 | eng_gradient_is_visible(void *data, void *context, void *gradient, int x, int y, int w, int h) | 690 | eng_gradient_is_visible(void *data, void *context, void *gradient, int x, int y, int w, int h) |
594 | { | 691 | { |
595 | Render_Engine *re = (Render_Engine *)data; | 692 | RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context; |
596 | 693 | ||
597 | re->win->gl_context->dc = context; | 694 | if (!dc || !gradient) return 0; |
598 | //--// return evas_gl_common_gradient_is_visible(re->win->gl_context, gradient, x, y, w, h); | 695 | return 1; |
599 | return 0; | ||
600 | } | 696 | } |
601 | 697 | ||
602 | static void | 698 | static void |
603 | eng_gradient_render_pre(void *data, void *context, void *gradient) | 699 | eng_gradient_render_pre(void *data, void *context, void *gradient) |
604 | { | 700 | { |
605 | Render_Engine *re = (Render_Engine *)data; | 701 | RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context; |
606 | 702 | RGBA_Gradient *gr = (RGBA_Gradient *)gradient; | |
607 | re->win->gl_context->dc = context; | 703 | int len; |
608 | //--// evas_gl_common_gradient_render_pre(re->win->gl_context, gradient); | 704 | |
705 | if (!dc || !gr || !gr->type.geometer) return; | ||
706 | gr->type.geometer->geom_set(gr); | ||
707 | len = gr->type.geometer->get_map_len(gr); | ||
708 | evas_common_gradient_map(dc, gr, len); | ||
609 | } | 709 | } |
610 | 710 | ||
611 | static void | 711 | static void |
612 | eng_gradient_render_post(void *data __UNUSED__, void *gradient) | 712 | eng_gradient_render_post(void *data __UNUSED__, void *gradient) |
613 | { | 713 | { |
614 | //--// evas_gl_common_gradient_render_post(gradient); | ||
615 | } | 714 | } |
616 | 715 | ||
617 | static void | 716 | static void |
@@ -622,7 +721,30 @@ eng_gradient_draw(void *data, void *context, void *surface __UNUSED__, void *gra | |||
622 | re = (Render_Engine *)data; | 721 | re = (Render_Engine *)data; |
623 | eng_window_use(re->win); | 722 | eng_window_use(re->win); |
624 | re->win->gl_context->dc = context; | 723 | re->win->gl_context->dc = context; |
625 | //--// evas_gl_common_gradient_draw(re->win->gl_context, gradient, x, y, w, h); | 724 | { |
725 | Evas_GL_Image *gim; | ||
726 | RGBA_Image *im; | ||
727 | RGBA_Draw_Context *dc = context; | ||
728 | int op = dc->render_op, cuse = dc->clip.use; | ||
729 | |||
730 | im = (RGBA_Image *)evas_cache_image_empty(evas_common_image_cache_get()); | ||
731 | im = (RGBA_Image *)evas_cache_image_size_set(&im->cache_entry, w, h); | ||
732 | |||
733 | dc->render_op = _EVAS_RENDER_FILL; | ||
734 | dc->clip.use = 0; | ||
735 | |||
736 | // draw to buf, copy to tex, draw tex | ||
737 | evas_common_gradient_draw(im, dc, 0, 0, w, h, gradient); | ||
738 | |||
739 | gim = evas_gl_common_image_new_from_data(re->win->gl_context, w, h, | ||
740 | im->image.data, 1, | ||
741 | EVAS_COLORSPACE_ARGB8888); | ||
742 | dc->render_op = op; | ||
743 | dc->clip.use = cuse; | ||
744 | evas_gl_common_image_draw(re->win->gl_context, gim, 0, 0, w, h, x, y, w, h, 0); | ||
745 | evas_cache_image_drop(&im->cache_entry); | ||
746 | evas_gl_common_image_free(gim); | ||
747 | } | ||
626 | } | 748 | } |
627 | 749 | ||
628 | static int | 750 | static int |