summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeandro Pereira <leandro@profusion.mobi>2012-12-18 16:27:26 +0000
committerLeandro Pereira <leandro@profusion.mobi>2012-12-18 16:27:26 +0000
commit613659b1d8c398da3fe6e54b4f7c41840520e894 (patch)
tree55017822574ec1c7287d0481fba55acac32dc531
parenta7b4a3c12d737462b09a71f25c5624f1489dd659 (diff)
ecore-evas: Async render
SVN revision: 81283
-rw-r--r--src/lib/ecore_evas/ecore_evas_private.h16
-rw-r--r--src/modules/ecore_evas/engines/x/ecore_evas_x.c645
2 files changed, 417 insertions, 244 deletions
diff --git a/src/lib/ecore_evas/ecore_evas_private.h b/src/lib/ecore_evas/ecore_evas_private.h
index c563f47..18d4ce2 100644
--- a/src/lib/ecore_evas/ecore_evas_private.h
+++ b/src/lib/ecore_evas/ecore_evas_private.h
@@ -312,6 +312,20 @@ struct _Ecore_Evas
312 Ecore_Evas_Engine engine; 312 Ecore_Evas_Engine engine;
313 Eina_List *sub_ecore_evas; 313 Eina_List *sub_ecore_evas;
314 314
315 struct {
316 unsigned char avoid_damage;
317 unsigned char resize_shape : 1;
318 unsigned char shaped : 1;
319 unsigned char shaped_changed : 1;
320 unsigned char alpha : 1;
321 unsigned char alpha_changed : 1;
322 unsigned char transparent : 1;
323 unsigned char transparent_changed : 1;
324 int rotation;
325 int rotation_resize;
326 unsigned char rotation_changed : 1;
327 } delayed;
328
315 int refcount; 329 int refcount;
316 330
317 unsigned char ignore_events : 1; 331 unsigned char ignore_events : 1;
@@ -322,6 +336,8 @@ struct _Ecore_Evas
322 unsigned char deleted : 1; 336 unsigned char deleted : 1;
323 int gl_sync_draw_done; // added by gl77.lee 337 int gl_sync_draw_done; // added by gl77.lee
324 unsigned char profile_supported : 1; 338 unsigned char profile_supported : 1;
339 unsigned char in_async_render : 1;
340 unsigned char can_async_render : 1;
325}; 341};
326 342
327EAPI void _ecore_evas_ref(Ecore_Evas *ee); 343EAPI void _ecore_evas_ref(Ecore_Evas *ee);
diff --git a/src/modules/ecore_evas/engines/x/ecore_evas_x.c b/src/modules/ecore_evas/engines/x/ecore_evas_x.c
index 5e44413..fa7e49a 100644
--- a/src/modules/ecore_evas/engines/x/ecore_evas_x.c
+++ b/src/modules/ecore_evas/engines/x/ecore_evas_x.c
@@ -99,6 +99,13 @@ static Ecore_Evas_Interface_Software_X11 *_ecore_evas_x_interface_software_x11_n
99static Ecore_Evas_Interface_Gl_X11 *_ecore_evas_x_interface_gl_x11_new(void); 99static Ecore_Evas_Interface_Gl_X11 *_ecore_evas_x_interface_gl_x11_new(void);
100#endif 100#endif
101 101
102static void _resize_shape_do(Ecore_Evas *);
103static void _shaped_do(Ecore_Evas *, int);
104static void _alpha_do(Ecore_Evas *, int);
105static void _transparent_do(Ecore_Evas *, int);
106static void _avoid_damage_do(Ecore_Evas *, int);
107static void _rotation_do(Ecore_Evas *, int, int);
108
102static void 109static void
103_ecore_evas_x_hints_update(Ecore_Evas *ee) 110_ecore_evas_x_hints_update(Ecore_Evas *ee)
104{ 111{
@@ -422,29 +429,11 @@ _ecore_evas_x_gl_window_new(Ecore_Evas *ee, Ecore_X_Window parent, int x, int y,
422#endif 429#endif
423 430
424static int 431static int
425_ecore_evas_x_render(Ecore_Evas *ee) 432_render_updates_process(Ecore_Evas *ee, Eina_List *updates)
426{ 433{
427 int rend = 0; 434 int rend = 0;
428 Eina_List *updates = NULL;
429 Eina_List *ll;
430 Ecore_Evas *ee2;
431 Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data; 435 Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
432 436
433 if ((!ee->no_comp_sync) && (_ecore_evas_app_comp_sync) &&
434 (edata->sync_counter) && (!edata->sync_began) &&
435 (!edata->sync_cancel))
436 return 0;
437
438 EINA_LIST_FOREACH(ee->sub_ecore_evas, ll, ee2)
439 {
440 if (ee2->func.fn_pre_render) ee2->func.fn_pre_render(ee2);
441 if (ee2->engine.func->fn_render)
442 rend |= ee2->engine.func->fn_render(ee2);
443 if (ee2->func.fn_post_render) ee2->func.fn_post_render(ee2);
444 }
445
446 if (ee->func.fn_pre_render) ee->func.fn_pre_render(ee);
447 updates = evas_render_updates(ee->evas);
448 if (ee->prop.avoid_damage) 437 if (ee->prop.avoid_damage)
449 { 438 {
450 if (edata->using_bg_pixmap) 439 if (edata->using_bg_pixmap)
@@ -567,6 +556,7 @@ _ecore_evas_x_render(Ecore_Evas *ee)
567 evas_render_updates_free(updates); 556 evas_render_updates_free(updates);
568 557
569 if (ee->func.fn_post_render) ee->func.fn_post_render(ee); 558 if (ee->func.fn_post_render) ee->func.fn_post_render(ee);
559
570/* 560/*
571 if (rend) 561 if (rend)
572 { 562 {
@@ -585,43 +575,129 @@ _ecore_evas_x_render(Ecore_Evas *ee)
585 } 575 }
586 } 576 }
587 */ 577 */
588
589 return rend; 578 return rend;
590} 579}
591 580
592static void 581static void
593_ecore_evas_x_resize_shape(Ecore_Evas *ee) 582_ecore_evas_x_render_updates(void *data, Evas *e EINA_UNUSED, void *event_info)
594{ 583{
584 Ecore_Evas *ee = data;
585 Eina_List *updates = event_info;
586
587 _render_updates_process(ee, updates);
588
589 ee->in_async_render = EINA_FALSE;
590
591 if (ee->delayed.resize_shape)
592 {
593 _resize_shape_do(ee);
594 ee->delayed.resize_shape = EINA_FALSE;
595 }
596 if (ee->delayed.shaped_changed)
597 {
598 _shaped_do(ee, ee->delayed.shaped);
599 ee->delayed.shaped_changed = EINA_FALSE;
600 }
601 if (ee->delayed.alpha_changed)
602 {
603 _alpha_do(ee, ee->delayed.alpha);
604 ee->delayed.alpha_changed = EINA_FALSE;
605 }
606 if (ee->delayed.transparent_changed)
607 {
608 _transparent_do(ee, ee->delayed.transparent);
609 ee->delayed.transparent_changed = EINA_FALSE;
610 }
611 if (ee->delayed.avoid_damage != ee->prop.avoid_damage)
612 _avoid_damage_do(ee, ee->delayed.avoid_damage);
613 if (ee->delayed.rotation_changed)
614 {
615 _rotation_do(ee, ee->delayed.rotation, ee->delayed.rotation_resize);
616 ee->delayed.rotation_changed = EINA_FALSE;
617 }
618}
619
620static int
621_ecore_evas_x_render(Ecore_Evas *ee)
622{
623 int rend = 0;
624 Eina_List *ll;
625 Ecore_Evas *ee2;
595 Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data; 626 Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
596 627
597 if (!strcmp(ee->driver, "software_x11")) 628 if ((!ee->no_comp_sync) && (_ecore_evas_app_comp_sync) &&
629 (edata->sync_counter) && (!edata->sync_began) &&
630 (!edata->sync_cancel))
631 return 0;
632
633 EINA_LIST_FOREACH(ee->sub_ecore_evas, ll, ee2)
598 { 634 {
635 if (ee2->func.fn_pre_render) ee2->func.fn_pre_render(ee2);
636 if (ee2->engine.func->fn_render)
637 rend |= ee2->engine.func->fn_render(ee2);
638 if (ee2->func.fn_post_render) ee2->func.fn_post_render(ee2);
639 }
640
641 if (ee->func.fn_pre_render) ee->func.fn_pre_render(ee);
642 if (ee->can_async_render)
643 {
644 ee->in_async_render |= evas_render_async(ee->evas,
645 _ecore_evas_x_render_updates,
646 ee);
647 rend |= ee->in_async_render;
648 }
649 else
650 {
651 Eina_List *updates;
652 updates = evas_render_updates(ee->evas);
653 rend = _render_updates_process(ee, updates);
654 }
655 return rend;
656}
657
658static void
659_resize_shape_do(Ecore_Evas *ee)
660{
599#ifdef BUILD_ECORE_EVAS_SOFTWARE_X11 661#ifdef BUILD_ECORE_EVAS_SOFTWARE_X11
600 Evas_Engine_Info_Software_X11 *einfo; 662 Evas_Engine_Info_Software_X11 *einfo;
663 Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
601 664
602 einfo = (Evas_Engine_Info_Software_X11 *)evas_engine_info_get(ee->evas); 665 einfo = (Evas_Engine_Info_Software_X11 *)evas_engine_info_get(ee->evas);
603 if (einfo) 666 if (einfo)
667 {
668 unsigned int foreground;
669 Ecore_X_GC gc;
670
671 if (edata->mask) ecore_x_pixmap_free(edata->mask);
672 edata->mask = ecore_x_pixmap_new(ee->prop.window, ee->w, ee->h, 1);
673 foreground = 0;
674 gc = ecore_x_gc_new(edata->mask,
675 ECORE_X_GC_VALUE_MASK_FOREGROUND,
676 &foreground);
677 ecore_x_drawable_rectangle_fill(edata->mask, gc,
678 0, 0, ee->w, ee->h);
679 ecore_x_gc_free(gc);
680 einfo->info.mask = edata->mask;
681 if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
604 { 682 {
605 unsigned int foreground; 683 ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
606 Ecore_X_GC gc;
607
608 if (edata->mask) ecore_x_pixmap_free(edata->mask);
609 edata->mask = ecore_x_pixmap_new(ee->prop.window, ee->w, ee->h, 1);
610 foreground = 0;
611 gc = ecore_x_gc_new(edata->mask,
612 ECORE_X_GC_VALUE_MASK_FOREGROUND,
613 &foreground);
614 ecore_x_drawable_rectangle_fill(edata->mask, gc,
615 0, 0, ee->w, ee->h);
616 ecore_x_gc_free(gc);
617 einfo->info.mask = edata->mask;
618 if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
619 {
620 ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
621 }
622 evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
623 } 684 }
685 evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
686 }
624#endif /* BUILD_ECORE_EVAS_SOFTWARE_X11 */ 687#endif /* BUILD_ECORE_EVAS_SOFTWARE_X11 */
688}
689
690static void
691_ecore_evas_x_resize_shape(Ecore_Evas *ee)
692{
693 if (!strcmp(ee->driver, "software_x11"))
694 {
695 if (ee->in_async_render)
696 {
697 ee->delayed.resize_shape = EINA_TRUE;
698 return;
699 }
700 _resize_shape_do(ee);
625 } 701 }
626} 702}
627 703
@@ -1871,6 +1947,45 @@ _ecore_evas_x_rotation_effect_setup(void)
1871#endif /* end of _USE_WIN_ROT_EFFECT */ 1947#endif /* end of _USE_WIN_ROT_EFFECT */
1872 1948
1873static void 1949static void
1950_rotation_do(Ecore_Evas *ee, int rotation, int resize)
1951{
1952#ifdef BUILD_ECORE_EVAS_SOFTWARE_X11
1953#if _USE_WIN_ROT_EFFECT
1954 int angles[2];
1955 angles[0] = rotation;
1956 angles[1] = ee->rotation;
1957#endif /* end of _USE_WIN_ROT_EFFECT */
1958 Evas_Engine_Info_Software_X11 *einfo;
1959 Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
1960
1961 einfo = (Evas_Engine_Info_Software_X11 *)evas_engine_info_get(ee->evas);
1962 if (!einfo) return;
1963 einfo->info.rotation = rotation;
1964 _ecore_evas_x_rotation_set_internal(ee, rotation, resize,
1965 (Evas_Engine_Info *)einfo);
1966# if _USE_WIN_ROT_EFFECT
1967 ecore_x_window_prop_property_set(ee->prop.window,
1968 ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE,
1969 ECORE_X_ATOM_CARDINAL, 32, &angles, 2);
1970
1971 if ((ee->visible) &&
1972 ((ecore_x_e_comp_sync_supported_get(edata->win_root)) &&
1973 (!ee->no_comp_sync) && (_ecore_evas_app_comp_sync)) &&
1974 (edata->sync_counter) &&
1975 (edata->sync_val > 0))
1976 {
1977 _ecore_evas_x_rotation_effect_setup();
1978 _ecore_evas_x_flush_pre(ee, NULL, NULL);
1979 }
1980# else
1981 ecore_x_window_prop_property_set(ee->prop.window,
1982 ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE,
1983 ECORE_X_ATOM_CARDINAL, 32, &rotation, 1);
1984# endif
1985#endif /* BUILD_ECORE_EVAS_SOFTWARE_X11 */
1986}
1987
1988static void
1874_ecore_evas_x_rotation_set(Ecore_Evas *ee, int rotation, int resize) 1989_ecore_evas_x_rotation_set(Ecore_Evas *ee, int rotation, int resize)
1875{ 1990{
1876 Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data; 1991 Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
@@ -1906,24 +2021,15 @@ _ecore_evas_x_rotation_set(Ecore_Evas *ee, int rotation, int resize)
1906 } 2021 }
1907 else if (!strcmp(ee->driver, "software_x11")) 2022 else if (!strcmp(ee->driver, "software_x11"))
1908 { 2023 {
1909#ifdef BUILD_ECORE_EVAS_SOFTWARE_X11 2024 if (ee->in_async_render)
1910 Evas_Engine_Info_Software_X11 *einfo; 2025 {
1911 2026 ee->delayed.rotation = rotation;
1912 einfo = (Evas_Engine_Info_Software_X11 *)evas_engine_info_get(ee->evas); 2027 ee->delayed.rotation_resize = resize;
1913 if (!einfo) return; 2028 ee->delayed.rotation_changed = EINA_TRUE;
1914 einfo->info.rotation = rotation; 2029 return;
1915 _ecore_evas_x_rotation_set_internal(ee, rotation, resize, 2030 }
1916 (Evas_Engine_Info *)einfo); 2031 _rotation_do(ee, rotation, resize);
1917# if _USE_WIN_ROT_EFFECT 2032 return;
1918 ecore_x_window_prop_property_set(ee->prop.window,
1919 ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE,
1920 ECORE_X_ATOM_CARDINAL, 32, &angles, 2);
1921# else
1922 ecore_x_window_prop_property_set(ee->prop.window,
1923 ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE,
1924 ECORE_X_ATOM_CARDINAL, 32, &rotation, 1);
1925# endif
1926#endif /* BUILD_ECORE_EVAS_SOFTWARE_X11 */
1927 } 2033 }
1928 2034
1929#if _USE_WIN_ROT_EFFECT 2035#if _USE_WIN_ROT_EFFECT
@@ -1940,159 +2046,187 @@ _ecore_evas_x_rotation_set(Ecore_Evas *ee, int rotation, int resize)
1940} 2046}
1941 2047
1942static void 2048static void
1943_ecore_evas_x_shaped_set(Ecore_Evas *ee, int shaped) 2049_shaped_do(Ecore_Evas *ee, int shaped)
1944{ 2050{
2051#ifdef BUILD_ECORE_EVAS_SOFTWARE_X11
1945 Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data; 2052 Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
2053 Evas_Engine_Info_Software_X11 *einfo;
1946 2054
1947 if ((ee->shaped == shaped)) return; 2055 if ((ee->shaped == shaped)) return;
1948 if (!strcmp(ee->driver, "opengl_x11")) return; 2056 einfo = (Evas_Engine_Info_Software_X11 *)evas_engine_info_get(ee->evas);
1949 if (!strcmp(ee->driver, "software_x11")) 2057 ee->shaped = shaped;
2058 if (einfo)
1950 { 2059 {
1951#ifdef BUILD_ECORE_EVAS_SOFTWARE_X11 2060 if (ee->shaped)
1952 Evas_Engine_Info_Software_X11 *einfo;
1953
1954 einfo = (Evas_Engine_Info_Software_X11 *)evas_engine_info_get(ee->evas);
1955 ee->shaped = shaped;
1956 if (einfo)
1957 { 2061 {
1958 if (ee->shaped) 2062 unsigned int foreground;
2063 Ecore_X_GC gc;
2064
2065 if (!edata->mask)
2066 edata->mask = ecore_x_pixmap_new(ee->prop.window, ee->w, ee->h, 1);
2067 foreground = 0;
2068 gc = ecore_x_gc_new(edata->mask,
2069 ECORE_X_GC_VALUE_MASK_FOREGROUND,
2070 &foreground);
2071 ecore_x_drawable_rectangle_fill(edata->mask, gc,
2072 0, 0, ee->w, ee->h);
2073 ecore_x_gc_free(gc);
2074 einfo->info.mask = edata->mask;
2075 if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
1959 { 2076 {
1960 unsigned int foreground; 2077 ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
1961 Ecore_X_GC gc;
1962
1963 if (!edata->mask)
1964 edata->mask = ecore_x_pixmap_new(ee->prop.window, ee->w, ee->h, 1);
1965 foreground = 0;
1966 gc = ecore_x_gc_new(edata->mask,
1967 ECORE_X_GC_VALUE_MASK_FOREGROUND,
1968 &foreground);
1969 ecore_x_drawable_rectangle_fill(edata->mask, gc,
1970 0, 0, ee->w, ee->h);
1971 ecore_x_gc_free(gc);
1972 einfo->info.mask = edata->mask;
1973 if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
1974 {
1975 ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
1976 }
1977 evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
1978 ecore_x_window_shape_input_mask_set(ee->prop.window, 0);
1979 } 2078 }
1980 else 2079 evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
2080 ecore_x_window_shape_input_mask_set(ee->prop.window, 0);
2081 }
2082 else
2083 {
2084 if (edata->mask) ecore_x_pixmap_free(edata->mask);
2085 edata->mask = 0;
2086 einfo->info.mask = 0;
2087 if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
1981 { 2088 {
1982 if (edata->mask) ecore_x_pixmap_free(edata->mask); 2089 ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
1983 edata->mask = 0;
1984 einfo->info.mask = 0;
1985 if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
1986 {
1987 ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
1988 }
1989 ecore_x_window_shape_mask_set(ee->prop.window, 0);
1990 ecore_x_window_shape_input_mask_set(ee->prop.window, 0);
1991 } 2090 }
2091 ecore_x_window_shape_mask_set(ee->prop.window, 0);
2092 ecore_x_window_shape_input_mask_set(ee->prop.window, 0);
1992 } 2093 }
2094 }
1993#endif /* BUILD_ECORE_EVAS_SOFTWARE_X11 */ 2095#endif /* BUILD_ECORE_EVAS_SOFTWARE_X11 */
2096}
2097
2098static void
2099_ecore_evas_x_shaped_set(Ecore_Evas *ee, int shaped)
2100{
2101 if (!strcmp(ee->driver, "opengl_x11")) return;
2102 if (!strcmp(ee->driver, "software_x11"))
2103 {
2104 if (ee->in_async_render)
2105 {
2106 ee->delayed.shaped = shaped;
2107 ee->delayed.shaped_changed = EINA_TRUE;
2108 return;
2109 }
2110 _shaped_do(ee, shaped);
1994 } 2111 }
1995} 2112}
1996 2113
1997/* FIXME, round trip */
1998static void 2114static void
1999_ecore_evas_x_alpha_set(Ecore_Evas *ee, int alpha) 2115_alpha_do(Ecore_Evas *ee, int alpha)
2000{ 2116{
2001 Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
2002 Ecore_X_Window_Attributes att;
2003 char *id = NULL; 2117 char *id = NULL;
2118#ifdef BUILD_ECORE_EVAS_SOFTWARE_X11
2119 Ecore_X_Window_Attributes att;
2120 Evas_Engine_Info_Software_X11 *einfo;
2121 Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
2004 2122
2005 if ((ee->alpha == alpha)) return; 2123 if ((ee->alpha == alpha)) return;
2006 2124
2007 if (!strcmp(ee->driver, "software_x11")) 2125 einfo = (Evas_Engine_Info_Software_X11 *)evas_engine_info_get(ee->evas);
2008 { 2126 if (!einfo) return;
2009#ifdef BUILD_ECORE_EVAS_SOFTWARE_X11
2010 Evas_Engine_Info_Software_X11 *einfo;
2011
2012 einfo = (Evas_Engine_Info_Software_X11 *)evas_engine_info_get(ee->evas);
2013 if (!einfo) return;
2014 2127
2015 if (!ecore_x_composite_query()) return; 2128 if (!ecore_x_composite_query()) return;
2016 2129
2017 ee->shaped = 0; 2130 ee->shaped = 0;
2018 ee->alpha = alpha; 2131 ee->alpha = alpha;
2019 ecore_x_window_free(ee->prop.window); 2132 ecore_x_window_free(ee->prop.window);
2020 ecore_event_window_unregister(ee->prop.window); 2133 ecore_event_window_unregister(ee->prop.window);
2021 if (ee->alpha) 2134 if (ee->alpha)
2022 { 2135 {
2023 if (ee->prop.override) 2136 if (ee->prop.override)
2024 ee->prop.window = ecore_x_window_override_argb_new(edata->win_root, ee->req.x, ee->req.y, ee->req.w, ee->req.h); 2137 ee->prop.window = ecore_x_window_override_argb_new(edata->win_root, ee->req.x, ee->req.y, ee->req.w, ee->req.h);
2025 else
2026 ee->prop.window = ecore_x_window_argb_new(edata->win_root, ee->req.x, ee->req.y, ee->req.w, ee->req.h);
2027// if (!edata->mask)
2028// edata->mask = ecore_x_pixmap_new(ee->prop.window, ee->req.w, ee->req.h, 1);
2029 }
2030 else 2138 else
2031 { 2139 ee->prop.window = ecore_x_window_argb_new(edata->win_root, ee->req.x, ee->req.y, ee->req.w, ee->req.h);
2032 if (ee->prop.override) 2140 // if (!edata->mask)
2033 ee->prop.window = ecore_x_window_override_new(edata->win_root, ee->req.x, ee->req.y, ee->req.w, ee->req.h); 2141 // edata->mask = ecore_x_pixmap_new(ee->prop.window, ee->req.w, ee->req.h, 1);
2034 else 2142 }
2035 ee->prop.window = ecore_x_window_new(edata->win_root, ee->req.x, ee->req.y, ee->req.w, ee->req.h); 2143 else
2036 if (edata->mask) ecore_x_pixmap_free(edata->mask); 2144 {
2037 edata->mask = 0; 2145 if (ee->prop.override)
2038 ecore_x_window_shape_input_mask_set(ee->prop.window, 0); 2146 ee->prop.window = ecore_x_window_override_new(edata->win_root, ee->req.x, ee->req.y, ee->req.w, ee->req.h);
2039 } 2147 else
2148 ee->prop.window = ecore_x_window_new(edata->win_root, ee->req.x, ee->req.y, ee->req.w, ee->req.h);
2149 if (edata->mask) ecore_x_pixmap_free(edata->mask);
2150 edata->mask = 0;
2151 ecore_x_window_shape_input_mask_set(ee->prop.window, 0);
2152 }
2040 2153
2041 einfo->info.destination_alpha = alpha; 2154 einfo->info.destination_alpha = alpha;
2042 2155
2043 ecore_x_window_attributes_get(ee->prop.window, &att); 2156 ecore_x_window_attributes_get(ee->prop.window, &att);
2044 einfo->info.visual = att.visual; 2157 einfo->info.visual = att.visual;
2045 einfo->info.colormap = att.colormap; 2158 einfo->info.colormap = att.colormap;
2046 einfo->info.depth = att.depth; 2159 einfo->info.depth = att.depth;
2047 2160
2048// if (edata->mask) ecore_x_pixmap_free(edata->mask); 2161 // if (edata->mask) ecore_x_pixmap_free(edata->mask);
2049// edata->mask = 0; 2162 // edata->mask = 0;
2050 einfo->info.mask = edata->mask; 2163 einfo->info.mask = edata->mask;
2051 einfo->info.drawable = ee->prop.window; 2164 einfo->info.drawable = ee->prop.window;
2052 if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo)) 2165 if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
2053 { 2166 {
2054 ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver); 2167 ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
2055 } 2168 }
2056 evas_damage_rectangle_add(ee->evas, 0, 0, ee->req.w, ee->req.h); 2169 evas_damage_rectangle_add(ee->evas, 0, 0, ee->req.w, ee->req.h);
2057 ecore_x_window_shape_mask_set(ee->prop.window, 0); 2170 ecore_x_window_shape_mask_set(ee->prop.window, 0);
2058 ecore_x_input_multi_select(ee->prop.window); 2171 ecore_x_input_multi_select(ee->prop.window);
2059 ecore_event_window_register(ee->prop.window, ee, ee->evas, 2172 ecore_event_window_register(ee->prop.window, ee, ee->evas,
2060 (Ecore_Event_Mouse_Move_Cb)_ecore_evas_mouse_move_process, 2173 (Ecore_Event_Mouse_Move_Cb)_ecore_evas_mouse_move_process,
2061 (Ecore_Event_Multi_Move_Cb)_ecore_evas_mouse_multi_move_process, 2174 (Ecore_Event_Multi_Move_Cb)_ecore_evas_mouse_multi_move_process,
2062 (Ecore_Event_Multi_Down_Cb)_ecore_evas_mouse_multi_down_process, 2175 (Ecore_Event_Multi_Down_Cb)_ecore_evas_mouse_multi_down_process,
2063 (Ecore_Event_Multi_Up_Cb)_ecore_evas_mouse_multi_up_process); 2176 (Ecore_Event_Multi_Up_Cb)_ecore_evas_mouse_multi_up_process);
2064 if (ee->prop.borderless) 2177 if (ee->prop.borderless)
2065 ecore_x_mwm_borderless_set(ee->prop.window, ee->prop.borderless); 2178 ecore_x_mwm_borderless_set(ee->prop.window, ee->prop.borderless);
2066 if (ee->visible) ecore_x_window_show(ee->prop.window); 2179 if (ee->visible) ecore_x_window_show(ee->prop.window);
2067 if (ee->prop.focused) ecore_x_window_focus(ee->prop.window); 2180 if (ee->prop.focused) ecore_x_window_focus(ee->prop.window);
2068 if (ee->prop.title) 2181 if (ee->prop.title)
2069 { 2182 {
2070 ecore_x_icccm_title_set(ee->prop.window, ee->prop.title); 2183 ecore_x_icccm_title_set(ee->prop.window, ee->prop.title);
2071 ecore_x_netwm_name_set(ee->prop.window, ee->prop.title); 2184 ecore_x_netwm_name_set(ee->prop.window, ee->prop.title);
2072 } 2185 }
2073 if (ee->prop.name) 2186 if (ee->prop.name)
2074 ecore_x_icccm_name_class_set(ee->prop.window, 2187 ecore_x_icccm_name_class_set(ee->prop.window,
2075 ee->prop.name, ee->prop.clas); 2188 ee->prop.name, ee->prop.clas);
2076 _ecore_evas_x_hints_update(ee); 2189 _ecore_evas_x_hints_update(ee);
2077 _ecore_evas_x_group_leader_update(ee); 2190 _ecore_evas_x_group_leader_update(ee);
2078 ecore_x_window_defaults_set(ee->prop.window); 2191 ecore_x_window_defaults_set(ee->prop.window);
2079 _ecore_evas_x_protocols_set(ee); 2192 _ecore_evas_x_protocols_set(ee);
2080 _ecore_evas_x_window_profile_protocol_set(ee); 2193 _ecore_evas_x_window_profile_protocol_set(ee);
2081 _ecore_evas_x_sync_set(ee); 2194 _ecore_evas_x_sync_set(ee);
2082 _ecore_evas_x_size_pos_hints_update(ee); 2195 _ecore_evas_x_size_pos_hints_update(ee);
2083#endif /* BUILD_ECORE_EVAS_SOFTWARE_X11 */ 2196#endif /* BUILD_ECORE_EVAS_SOFTWARE_X11 */
2084 if ((id = getenv("DESKTOP_STARTUP_ID"))) 2197 if ((id = getenv("DESKTOP_STARTUP_ID")))
2198 {
2199 ecore_x_netwm_startup_id_set(ee->prop.window, id);
2200 /* NB: on linux this may simply empty the env as opposed to completely
2201 * unset it to being empty - unsure as solartis libc crashes looking
2202 * for the '=' char */
2203 // putenv((char*)"DESKTOP_STARTUP_ID=");
2204 }
2205}
2206
2207/* FIXME, round trip */
2208static void
2209_ecore_evas_x_alpha_set(Ecore_Evas *ee, int alpha)
2210{
2211 Ecore_X_Window_Attributes att;
2212 Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
2213 char *id = NULL;
2214
2215 if (!strcmp(ee->driver, "software_x11"))
2216 {
2217 if (ee->in_async_render)
2085 { 2218 {
2086 ecore_x_netwm_startup_id_set(ee->prop.window, id); 2219 ee->delayed.alpha = alpha;
2087 /* NB: on linux this may simply empty the env as opposed to completely 2220 ee->delayed.alpha_changed = EINA_TRUE;
2088 * unset it to being empty - unsure as solartis libc crashes looking 2221 return;
2089 * for the '=' char */
2090 // putenv((char*)"DESKTOP_STARTUP_ID=");
2091 } 2222 }
2223 _alpha_do(ee, alpha);
2092 } 2224 }
2093 else if (!strcmp(ee->driver, "opengl_x11")) 2225 else if (!strcmp(ee->driver, "opengl_x11"))
2094 { 2226 {
2095#ifdef BUILD_ECORE_EVAS_OPENGL_X11 2227#ifdef BUILD_ECORE_EVAS_OPENGL_X11
2228 if ((ee->alpha == alpha)) return;
2229
2096 Evas_Engine_Info_GL_X11 *einfo; 2230 Evas_Engine_Info_GL_X11 *einfo;
2097 2231
2098 einfo = (Evas_Engine_Info_GL_X11 *)evas_engine_info_get(ee->evas); 2232 einfo = (Evas_Engine_Info_GL_X11 *)evas_engine_info_get(ee->evas);
@@ -2214,26 +2348,38 @@ _ecore_evas_x_alpha_set(Ecore_Evas *ee, int alpha)
2214} 2348}
2215 2349
2216static void 2350static void
2217_ecore_evas_x_transparent_set(Ecore_Evas *ee, int transparent) 2351_transparent_do(Ecore_Evas *ee, int transparent)
2218{ 2352{
2353#ifdef BUILD_ECORE_EVAS_SOFTWARE_X11
2219 if ((ee->transparent == transparent)) return; 2354 if ((ee->transparent == transparent)) return;
2220 2355
2221 if (!strcmp(ee->driver, "software_x11")) 2356 Evas_Engine_Info_Software_X11 *einfo;
2222 {
2223#ifdef BUILD_ECORE_EVAS_SOFTWARE_X11
2224 Evas_Engine_Info_Software_X11 *einfo;
2225 2357
2226 einfo = (Evas_Engine_Info_Software_X11 *)evas_engine_info_get(ee->evas); 2358 einfo = (Evas_Engine_Info_Software_X11 *)evas_engine_info_get(ee->evas);
2227 if (!einfo) return; 2359 if (!einfo) return;
2228 2360
2229 ee->transparent = transparent; 2361 ee->transparent = transparent;
2230 einfo->info.destination_alpha = transparent; 2362 einfo->info.destination_alpha = transparent;
2231 if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo)) 2363 if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
2364 {
2365 ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
2366 }
2367 evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
2368#endif
2369}
2370
2371static void
2372_ecore_evas_x_transparent_set(Ecore_Evas *ee, int transparent)
2373{
2374 if (!strcmp(ee->driver, "software_x11"))
2375 {
2376 if (ee->in_async_render)
2232 { 2377 {
2233 ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver); 2378 ee->delayed.transparent = transparent;
2379 ee->delayed.transparent_changed = EINA_TRUE;
2380 return;
2234 } 2381 }
2235 evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h); 2382 _transparent_do(ee, transparent);
2236#endif
2237 } 2383 }
2238} 2384}
2239 2385
@@ -2687,69 +2833,79 @@ _ecore_evas_x_profiles_set(Ecore_Evas *ee, const char **plist, int n)
2687} 2833}
2688 2834
2689static void 2835static void
2690_ecore_evas_x_avoid_damage_set(Ecore_Evas *ee, int on) 2836_avoid_damage_do(Ecore_Evas *ee, int on)
2691{ 2837{
2838#ifdef BUILD_ECORE_EVAS_SOFTWARE_X11
2839 Evas_Engine_Info_Software_X11 *einfo;
2692 Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data; 2840 Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
2693 2841
2694 if (ee->prop.avoid_damage == on) return; 2842 ee->prop.avoid_damage = on;
2695 if (!strcmp(ee->driver, "opengl_x11")) return; 2843 einfo = (Evas_Engine_Info_Software_X11 *)evas_engine_info_get(ee->evas);
2696 2844 if (einfo)
2697 if (!strcmp(ee->driver, "software_x11"))
2698 { 2845 {
2699#ifdef BUILD_ECORE_EVAS_SOFTWARE_X11 2846 if (ee->prop.avoid_damage)
2700 Evas_Engine_Info_Software_X11 *einfo;
2701
2702 ee->prop.avoid_damage = on;
2703 einfo = (Evas_Engine_Info_Software_X11 *)evas_engine_info_get(ee->evas);
2704 if (einfo)
2705 { 2847 {
2706 if (ee->prop.avoid_damage) 2848 edata->pmap = ecore_x_pixmap_new(ee->prop.window, ee->w, ee->h, einfo->info.depth);
2849 edata->gc = ecore_x_gc_new(edata->pmap, 0, NULL);
2850 einfo->info.drawable = edata->pmap;
2851 if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
2707 { 2852 {
2708 edata->pmap = ecore_x_pixmap_new(ee->prop.window, ee->w, ee->h, einfo->info.depth); 2853 ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
2709 edata->gc = ecore_x_gc_new(edata->pmap, 0, NULL);
2710 einfo->info.drawable = edata->pmap;
2711 if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
2712 {
2713 ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
2714 }
2715 if ((ee->rotation == 90) || (ee->rotation == 270))
2716 evas_damage_rectangle_add(ee->evas, 0, 0, ee->h, ee->w);
2717 else
2718 evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
2719 if (ee->prop.avoid_damage == ECORE_EVAS_AVOID_DAMAGE_BUILT_IN)
2720 {
2721 edata->using_bg_pixmap = 1;
2722 ecore_x_window_pixmap_set(ee->prop.window, edata->pmap);
2723 ecore_x_window_area_expose(ee->prop.window, 0, 0, ee->w, ee->h);
2724 }
2725 if (edata->direct_resize)
2726 {
2727 /* Turn this off for now
2728 edata->using_bg_pixmap = 1;
2729 ecore_x_window_pixmap_set(ee->prop.window, edata->pmap);
2730 */
2731 }
2732 } 2854 }
2855 if ((ee->rotation == 90) || (ee->rotation == 270))
2856 evas_damage_rectangle_add(ee->evas, 0, 0, ee->h, ee->w);
2733 else 2857 else
2858 evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
2859 if (ee->prop.avoid_damage == ECORE_EVAS_AVOID_DAMAGE_BUILT_IN)
2734 { 2860 {
2735 if (edata->pmap) ecore_x_pixmap_free(edata->pmap); 2861 edata->using_bg_pixmap = 1;
2736 if (edata->gc) ecore_x_gc_free(edata->gc); 2862 ecore_x_window_pixmap_set(ee->prop.window, edata->pmap);
2737 if (edata->using_bg_pixmap) 2863 ecore_x_window_area_expose(ee->prop.window, 0, 0, ee->w, ee->h);
2738 { 2864 }
2739 ecore_x_window_pixmap_set(ee->prop.window, 0); 2865 if (edata->direct_resize)
2740 edata->using_bg_pixmap = 0; 2866 {
2741 ecore_x_window_area_expose(ee->prop.window, 0, 0, ee->w, ee->h); 2867 /* Turn this off for now
2742 } 2868 edata->using_bg_pixmap = 1;
2743 edata->pmap = 0; 2869 ecore_x_window_pixmap_set(ee->prop.window, edata->pmap);
2744 edata->gc = 0; 2870 */
2745 einfo->info.drawable = ee->prop.window; 2871 }
2746 if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo)) 2872 }
2747 { 2873 else
2748 ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver); 2874 {
2749 } 2875 if (edata->pmap) ecore_x_pixmap_free(edata->pmap);
2876 if (edata->gc) ecore_x_gc_free(edata->gc);
2877 if (edata->using_bg_pixmap)
2878 {
2879 ecore_x_window_pixmap_set(ee->prop.window, 0);
2880 edata->using_bg_pixmap = 0;
2881 ecore_x_window_area_expose(ee->prop.window, 0, 0, ee->w, ee->h);
2882 }
2883 edata->pmap = 0;
2884 edata->gc = 0;
2885 einfo->info.drawable = ee->prop.window;
2886 if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
2887 {
2888 ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
2750 } 2889 }
2751 } 2890 }
2891 }
2752#endif /* BUILD_ECORE_EVAS_SOFTWARE_X11 */ 2892#endif /* BUILD_ECORE_EVAS_SOFTWARE_X11 */
2893}
2894
2895static void
2896_ecore_evas_x_avoid_damage_set(Ecore_Evas *ee, int on)
2897{
2898 if (ee->prop.avoid_damage == on) return;
2899 if (!strcmp(ee->driver, "opengl_x11")) return;
2900
2901 if (!strcmp(ee->driver, "software_x11"))
2902 {
2903 if (ee->in_async_render)
2904 {
2905 ee->delayed.avoid_damage = on;
2906 return;
2907 }
2908 _avoid_damage_do(ee, on);
2753 } 2909 }
2754} 2910}
2755 2911
@@ -3014,6 +3170,7 @@ ecore_evas_software_x11_new_internal(const char *disp_name, Ecore_X_Window paren
3014 ee->prop.request_pos = 0; 3170 ee->prop.request_pos = 0;
3015 ee->prop.sticky = 0; 3171 ee->prop.sticky = 0;
3016 edata->state.sticky = 0; 3172 edata->state.sticky = 0;
3173 ee->can_async_render = 1;
3017 3174
3018 /* init evas here */ 3175 /* init evas here */
3019 ee->evas = evas_new(); 3176 ee->evas = evas_new();