summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorChristopher Michael <cpmichael1@comcast.net>2012-06-29 12:01:34 +0000
committerChristopher Michael <cpmichael1@comcast.net>2012-06-29 12:01:34 +0000
commit0d1c4661ab4f348f98b4ad5f4e98df2d0a994565 (patch)
tree9a11ea2661b4550d2cf12c1cd2fbb0ffb670094f /legacy
parent725a3ed4db5f9ceae3d852c27cd809063bef9444 (diff)
Evas: Support cserve2 for xcb engine.
SVN revision: 73033
Diffstat (limited to 'legacy')
-rw-r--r--legacy/evas/src/modules/engines/software_x11/Makefile.am1
-rw-r--r--legacy/evas/src/modules/engines/software_x11/evas_xcb_outbuf.c163
2 files changed, 139 insertions, 25 deletions
diff --git a/legacy/evas/src/modules/engines/software_x11/Makefile.am b/legacy/evas/src/modules/engines/software_x11/Makefile.am
index 1d5d17bca9..7c15a270a7 100644
--- a/legacy/evas/src/modules/engines/software_x11/Makefile.am
+++ b/legacy/evas/src/modules/engines/software_x11/Makefile.am
@@ -35,6 +35,7 @@ AM_CPPFLAGS = \
35-I. \ 35-I. \
36-I$(top_srcdir)/src/lib \ 36-I$(top_srcdir)/src/lib \
37-I$(top_srcdir)/src/lib/include \ 37-I$(top_srcdir)/src/lib/include \
38-I$(top_srcdir)/src/lib/cserve2 \
38-I$(top_srcdir)/src/modules/engines \ 39-I$(top_srcdir)/src/modules/engines \
39@FREETYPE_CFLAGS@ \ 40@FREETYPE_CFLAGS@ \
40@PIXMAN_CFLAGS@ \ 41@PIXMAN_CFLAGS@ \
diff --git a/legacy/evas/src/modules/engines/software_x11/evas_xcb_outbuf.c b/legacy/evas/src/modules/engines/software_x11/evas_xcb_outbuf.c
index b02df10bb5..73dd245aaf 100644
--- a/legacy/evas/src/modules/engines/software_x11/evas_xcb_outbuf.c
+++ b/legacy/evas/src/modules/engines/software_x11/evas_xcb_outbuf.c
@@ -1,9 +1,17 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
4
5#include <pixman.h>
6
7#ifdef EVAS_CSERVE2
8# include "evas_cs2_private.h"
9#endif
1#include "evas_common.h" 10#include "evas_common.h"
2#include "evas_macros.h" 11#include "evas_macros.h"
3#include "evas_xcb_outbuf.h" 12#include "evas_xcb_outbuf.h"
4#include "evas_xcb_buffer.h" 13#include "evas_xcb_buffer.h"
5#include "evas_xcb_color.h" 14#include "evas_xcb_color.h"
6#include <pixman.h>
7 15
8/* local structures */ 16/* local structures */
9typedef struct _Outbuf_Region Outbuf_Region; 17typedef struct _Outbuf_Region Outbuf_Region;
@@ -46,7 +54,13 @@ evas_software_xcb_outbuf_free(Outbuf *buf)
46 eina_list_remove_list(buf->priv.pending_writes, 54 eina_list_remove_list(buf->priv.pending_writes,
47 buf->priv.pending_writes); 55 buf->priv.pending_writes);
48 obr = im->extended_info; 56 obr = im->extended_info;
49 evas_cache_image_drop(&im->cache_entry); 57#ifdef EVAS_CSERVE2
58 if (evas_cserve2_use_get())
59 evas_cache2_image_close(&im->cache_entry);
60 else
61#endif
62 evas_cache_image_drop(&im->cache_entry);
63
50 if (obr->xcbob) _unfind_xcbob(obr->xcbob, EINA_FALSE); 64 if (obr->xcbob) _unfind_xcbob(obr->xcbob, EINA_FALSE);
51 if (obr->mask) _unfind_xcbob(obr->mask, EINA_FALSE); 65 if (obr->mask) _unfind_xcbob(obr->mask, EINA_FALSE);
52 free(obr); 66 free(obr);
@@ -281,11 +295,25 @@ evas_software_xcb_outbuf_new_region_for_update(Outbuf *buf, int x, int y, int w,
281 free(obr); 295 free(obr);
282 return NULL; 296 return NULL;
283 } 297 }
284 im = 298#ifdef EVAS_CSERVE2
285 (RGBA_Image *)evas_cache_image_data(evas_common_image_cache_get(), 299 if (evas_cserve2_use_get())
286 buf->w, buf->h, 300 {
287 (DATA32 *)evas_software_xcb_output_buffer_data(obr->xcbob, &bpl), 301 im =
288 alpha, EVAS_COLORSPACE_ARGB8888); 302 (RGBA_Image *)evas_cache2_image_data(evas_common_image_cache2_get(),
303 buf->w, buf->h,
304 (DATA32 *)evas_software_xcb_output_buffer_data(obr->xcbob, &bpl),
305 alpha, EVAS_COLORSPACE_ARGB8888);
306 }
307 else
308#endif
309 {
310 im =
311 (RGBA_Image *)evas_cache_image_data(evas_common_image_cache_get(),
312 buf->w, buf->h,
313 (DATA32 *)evas_software_xcb_output_buffer_data(obr->xcbob, &bpl),
314 alpha, EVAS_COLORSPACE_ARGB8888);
315 }
316
289 if (!im) 317 if (!im)
290 { 318 {
291 evas_software_xcb_output_buffer_free(obr->xcbob, EINA_FALSE); 319 evas_software_xcb_output_buffer_free(obr->xcbob, EINA_FALSE);
@@ -306,15 +334,32 @@ evas_software_xcb_outbuf_new_region_for_update(Outbuf *buf, int x, int y, int w,
306 { 334 {
307 int bw = 0, bh = 0; 335 int bw = 0, bh = 0;
308 336
309 im = 337#ifdef EVAS_CSERVE2
310 (RGBA_Image *)evas_cache_image_empty(evas_common_image_cache_get()); 338 if (evas_cserve2_use_get())
339 {
340 im =
341 (RGBA_Image *)evas_cache2_image_empty(evas_common_image_cache2_get());
342 }
343 else
344#endif
345 {
346 im =
347 (RGBA_Image *)evas_cache_image_empty(evas_common_image_cache_get());
348 }
349
311 if (!im) 350 if (!im)
312 { 351 {
313 free(obr); 352 free(obr);
314 return NULL; 353 return NULL;
315 } 354 }
316 im->cache_entry.flags.alpha |= (alpha ? 1 : 0); 355 im->cache_entry.flags.alpha |= (alpha ? 1 : 0);
317 evas_cache_image_surface_alloc(&im->cache_entry, buf->w, buf->h); 356#ifdef EVAS_CSERVE2
357 if (evas_cserve2_use_get())
358 evas_cache2_image_surface_alloc(&im->cache_entry, buf->w, buf->h);
359 else
360#endif
361 evas_cache_image_surface_alloc(&im->cache_entry, buf->w, buf->h);
362
318 im->extended_info = obr; 363 im->extended_info = obr;
319 if ((buf->rot == 0) || (buf->rot == 180)) 364 if ((buf->rot == 0) || (buf->rot == 180))
320 { 365 {
@@ -333,7 +378,13 @@ evas_software_xcb_outbuf_new_region_for_update(Outbuf *buf, int x, int y, int w,
333 bw, bh, use_shm, NULL); 378 bw, bh, use_shm, NULL);
334 if (!obr->xcbob) 379 if (!obr->xcbob)
335 { 380 {
336 evas_cache_image_drop(&im->cache_entry); 381#ifdef EVAS_CSERVE2
382 if (evas_cserve2_use_get())
383 evas_cache2_image_close(&im->cache_entry);
384 else
385#endif
386 evas_cache_image_drop(&im->cache_entry);
387
337 free(obr); 388 free(obr);
338 return NULL; 389 return NULL;
339 } 390 }
@@ -381,11 +432,25 @@ evas_software_xcb_outbuf_new_region_for_update(Outbuf *buf, int x, int y, int w,
381 free(obr); 432 free(obr);
382 return NULL; 433 return NULL;
383 } 434 }
384 im = 435#ifdef EVAS_CSERVE2
385 (RGBA_Image *)evas_cache_image_data(evas_common_image_cache_get(), 436 if (evas_cserve2_use_get())
386 w, h, 437 {
387 (DATA32 *)evas_software_xcb_output_buffer_data(obr->xcbob, &bpl), 438 im =
388 alpha, EVAS_COLORSPACE_ARGB8888); 439 (RGBA_Image *)evas_cache2_image_data(evas_common_image_cache2_get(),
440 w, h,
441 (DATA32 *)evas_software_xcb_output_buffer_data(obr->xcbob, &bpl),
442 alpha, EVAS_COLORSPACE_ARGB8888);
443 }
444 else
445#endif
446 {
447 im =
448 (RGBA_Image *)evas_cache_image_data(evas_common_image_cache_get(),
449 w, h,
450 (DATA32 *)evas_software_xcb_output_buffer_data(obr->xcbob, &bpl),
451 alpha, EVAS_COLORSPACE_ARGB8888);
452 }
453
389 if (!im) 454 if (!im)
390 { 455 {
391 _unfind_xcbob(obr->xcbob, EINA_FALSE); 456 _unfind_xcbob(obr->xcbob, EINA_FALSE);
@@ -404,15 +469,32 @@ evas_software_xcb_outbuf_new_region_for_update(Outbuf *buf, int x, int y, int w,
404 { 469 {
405 int bw = 0, bh = 0; 470 int bw = 0, bh = 0;
406 471
407 im = 472#ifdef EVAS_CSERVE2
408 (RGBA_Image *)evas_cache_image_empty(evas_common_image_cache_get()); 473 if (evas_cserve2_use_get())
474 {
475 im =
476 (RGBA_Image *)evas_cache2_image_empty(evas_common_image_cache2_get());
477 }
478 else
479#endif
480 {
481 im =
482 (RGBA_Image *)evas_cache_image_empty(evas_common_image_cache_get());
483 }
484
409 if (!im) 485 if (!im)
410 { 486 {
411 free(obr); 487 free(obr);
412 return NULL; 488 return NULL;
413 } 489 }
414 im->cache_entry.flags.alpha |= (alpha ? 1 : 0); 490 im->cache_entry.flags.alpha |= (alpha ? 1 : 0);
415 evas_cache_image_surface_alloc(&im->cache_entry, w, h); 491#ifdef EVAS_CSERVE2
492 if (evas_cserve2_use_get())
493 evas_cache2_image_surface_alloc(&im->cache_entry, w, h);
494 else
495#endif
496 evas_cache_image_surface_alloc(&im->cache_entry, w, h);
497
416 im->extended_info = obr; 498 im->extended_info = obr;
417 if ((buf->rot == 0) || (buf->rot == 180)) 499 if ((buf->rot == 0) || (buf->rot == 180))
418 { 500 {
@@ -429,7 +511,12 @@ evas_software_xcb_outbuf_new_region_for_update(Outbuf *buf, int x, int y, int w,
429 buf->priv.x11.xcb.depth, bw, bh, use_shm, NULL); 511 buf->priv.x11.xcb.depth, bw, bh, use_shm, NULL);
430 if (!obr->xcbob) 512 if (!obr->xcbob)
431 { 513 {
432 evas_cache_image_drop(&im->cache_entry); 514#ifdef EVAS_CSERVE2
515 if (evas_cserve2_use_get())
516 evas_cache2_image_close(&im->cache_entry);
517 else
518#endif
519 evas_cache_image_drop(&im->cache_entry);
433 free(obr); 520 free(obr);
434 return NULL; 521 return NULL;
435 } 522 }
@@ -567,7 +654,13 @@ evas_software_xcb_outbuf_flush(Outbuf *buf)
567 eina_list_remove_list(buf->priv.prev_pending_writes, 654 eina_list_remove_list(buf->priv.prev_pending_writes,
568 buf->priv.prev_pending_writes); 655 buf->priv.prev_pending_writes);
569 obr = im->extended_info; 656 obr = im->extended_info;
570 evas_cache_image_drop(&im->cache_entry); 657# ifdef EVAS_CSERVE2
658 if (evas_cserve2_use_get())
659 evas_cache2_image_close(&im->cache_entry);
660 else
661# endif
662 evas_cache_image_drop(&im->cache_entry);
663
571 if (obr->xcbob) _unfind_xcbob(obr->xcbob, EINA_FALSE); 664 if (obr->xcbob) _unfind_xcbob(obr->xcbob, EINA_FALSE);
572 if (obr->mask) _unfind_xcbob(obr->mask, EINA_FALSE); 665 if (obr->mask) _unfind_xcbob(obr->mask, EINA_FALSE);
573 free(obr); 666 free(obr);
@@ -586,11 +679,21 @@ evas_software_xcb_outbuf_flush(Outbuf *buf)
586 eina_list_remove_list(buf->priv.pending_writes, 679 eina_list_remove_list(buf->priv.pending_writes,
587 buf->priv.pending_writes); 680 buf->priv.pending_writes);
588 obr = im->extended_info; 681 obr = im->extended_info;
589 evas_cache_image_drop(&im->cache_entry); 682# ifdef EVAS_CSERVE2
683 if (evas_cserve2_use_get())
684 evas_cache2_image_close(&im->cache_entry);
685 else
686# endif
687 evas_cache_image_drop(&im->cache_entry);
590 if (obr->xcbob) _unfind_xcbob(obr->xcbob, EINA_FALSE); 688 if (obr->xcbob) _unfind_xcbob(obr->xcbob, EINA_FALSE);
591 if (obr->mask) _unfind_xcbob(obr->mask, EINA_FALSE); 689 if (obr->mask) _unfind_xcbob(obr->mask, EINA_FALSE);
592 free(obr); 690 free(obr);
593 evas_cache_image_drop(&im->cache_entry); 691# ifdef EVAS_CSERVE2
692 if (evas_cserve2_use_get())
693 evas_cache2_image_close(&im->cache_entry);
694 else
695# endif
696 evas_cache_image_drop(&im->cache_entry);
594 } 697 }
595#endif 698#endif
596 } 699 }
@@ -613,7 +716,12 @@ evas_software_xcb_outbuf_idle_flush(Outbuf *buf)
613 if (obr->mask) 716 if (obr->mask)
614 evas_software_xcb_output_buffer_free(obr->mask, EINA_FALSE); 717 evas_software_xcb_output_buffer_free(obr->mask, EINA_FALSE);
615 free(obr); 718 free(obr);
616 evas_cache_image_drop(&im->cache_entry); 719# ifdef EVAS_CSERVE2
720 if (evas_cserve2_use_get())
721 evas_cache2_image_close(&im->cache_entry);
722 else
723# endif
724 evas_cache_image_drop(&im->cache_entry);
617 } 725 }
618 else 726 else
619 { 727 {
@@ -629,7 +737,12 @@ evas_software_xcb_outbuf_idle_flush(Outbuf *buf)
629 eina_list_remove_list(buf->priv.prev_pending_writes, 737 eina_list_remove_list(buf->priv.prev_pending_writes,
630 buf->priv.prev_pending_writes); 738 buf->priv.prev_pending_writes);
631 obr = im->extended_info; 739 obr = im->extended_info;
632 evas_cache_image_drop(&im->cache_entry); 740# ifdef EVAS_CSERVE2
741 if (evas_cserve2_use_get())
742 evas_cache2_image_close(&im->cache_entry);
743 else
744# endif
745 evas_cache_image_drop(&im->cache_entry);
633 if (obr->xcbob) _unfind_xcbob(obr->xcbob, EINA_FALSE); 746 if (obr->xcbob) _unfind_xcbob(obr->xcbob, EINA_FALSE);
634 if (obr->mask) _unfind_xcbob(obr->mask, EINA_FALSE); 747 if (obr->mask) _unfind_xcbob(obr->mask, EINA_FALSE);
635 free(obr); 748 free(obr);