summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorChristopher Michael <cpmichael1@comcast.net>2012-08-16 07:29:37 +0000
committerChristopher Michael <cpmichael1@comcast.net>2012-08-16 07:29:37 +0000
commitfb2819c4fd24529a1b21d60116173596c99770ba (patch)
tree0fcbb1542ca3fa43d158364651b2406dfb960010 /legacy
parent1e3e3a39855966d342679134cd10b1524cfa7ca8 (diff)
Ecore_Evas (wayland_shm): Fix toggling alpha and transparent state on and off.
When we are using alpha, we need to create the buffer using ARGB so we will destroy the old buffer and recreate with the new alpha format because currently all windows are created using XRGB8888 by default. SVN revision: 75307
Diffstat (limited to 'legacy')
-rw-r--r--legacy/ecore/src/lib/ecore_evas/ecore_evas_wayland_shm.c47
1 files changed, 45 insertions, 2 deletions
diff --git a/legacy/ecore/src/lib/ecore_evas/ecore_evas_wayland_shm.c b/legacy/ecore/src/lib/ecore_evas/ecore_evas_wayland_shm.c
index 7730d2a989..0b3ade4296 100644
--- a/legacy/ecore/src/lib/ecore_evas/ecore_evas_wayland_shm.c
+++ b/legacy/ecore/src/lib/ecore_evas/ecore_evas_wayland_shm.c
@@ -823,21 +823,46 @@ static void
823_ecore_evas_wl_alpha_set(Ecore_Evas *ee, int alpha) 823_ecore_evas_wl_alpha_set(Ecore_Evas *ee, int alpha)
824{ 824{
825 Evas_Engine_Info_Wayland_Shm *einfo; 825 Evas_Engine_Info_Wayland_Shm *einfo;
826 Ecore_Wl_Window *win;
826 827
827 LOGFN(__FILE__, __LINE__, __FUNCTION__); 828 LOGFN(__FILE__, __LINE__, __FUNCTION__);
828 829
829 if (!ee) return; 830 if (!ee) return;
830 if ((ee->alpha == alpha)) return; 831 if ((ee->alpha == alpha)) return;
831 ee->alpha = alpha; 832 ee->alpha = alpha;
832 if (ee->engine.wl.win) 833
833 ecore_wl_window_transparent_set(ee->engine.wl.win, alpha); 834 /* FIXME: NB: We should really add a ecore_wl_window_alpha_set function
835 * but we are in API freeze, so just hack it in for now and fix when
836 * freeze is over */
837 if ((win = ee->engine.wl.win))
838 win->alpha = alpha;
839
840 /* if (ee->engine.wl.win) */
841 /* ecore_wl_window_transparent_set(ee->engine.wl.win, alpha); */
842
843 if (ee->engine.wl.buffer) wl_buffer_destroy(ee->engine.wl.buffer);
844 ee->engine.wl.buffer = NULL;
845
846 _ecore_evas_wl_ensure_pool_size(ee, ee->w, ee->h);
847
848 if (ee->engine.wl.pool)
849 _ecore_evas_wl_buffer_new(ee, ee->engine.wl.pool);
850
834 if ((einfo = (Evas_Engine_Info_Wayland_Shm *)evas_engine_info_get(ee->evas))) 851 if ((einfo = (Evas_Engine_Info_Wayland_Shm *)evas_engine_info_get(ee->evas)))
835 { 852 {
836 einfo->info.destination_alpha = alpha; 853 einfo->info.destination_alpha = alpha;
854 einfo->info.dest = ee->engine.wl.pool_data;
837 if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo)) 855 if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
838 ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver); 856 ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
839 evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h); 857 evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
840 } 858 }
859
860 if (ee->engine.wl.win)
861 {
862 ecore_wl_window_update_size(ee->engine.wl.win, ee->w, ee->h);
863 ecore_wl_window_buffer_attach(ee->engine.wl.win,
864 ee->engine.wl.buffer, 0, 0);
865 }
841} 866}
842 867
843static void 868static void
@@ -850,15 +875,33 @@ _ecore_evas_wl_transparent_set(Ecore_Evas *ee, int transparent)
850 if (!ee) return; 875 if (!ee) return;
851 if ((ee->transparent == transparent)) return; 876 if ((ee->transparent == transparent)) return;
852 ee->transparent = transparent; 877 ee->transparent = transparent;
878
853 if (ee->engine.wl.win) 879 if (ee->engine.wl.win)
854 ecore_wl_window_transparent_set(ee->engine.wl.win, transparent); 880 ecore_wl_window_transparent_set(ee->engine.wl.win, transparent);
881
882 if (ee->engine.wl.buffer) wl_buffer_destroy(ee->engine.wl.buffer);
883 ee->engine.wl.buffer = NULL;
884
885 _ecore_evas_wl_ensure_pool_size(ee, ee->w, ee->h);
886
887 if (ee->engine.wl.pool)
888 _ecore_evas_wl_buffer_new(ee, ee->engine.wl.pool);
889
855 if ((einfo = (Evas_Engine_Info_Wayland_Shm *)evas_engine_info_get(ee->evas))) 890 if ((einfo = (Evas_Engine_Info_Wayland_Shm *)evas_engine_info_get(ee->evas)))
856 { 891 {
857 einfo->info.destination_alpha = transparent; 892 einfo->info.destination_alpha = transparent;
893 einfo->info.dest = ee->engine.wl.pool_data;
858 if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo)) 894 if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
859 ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver); 895 ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
860 evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h); 896 evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
861 } 897 }
898
899 if (ee->engine.wl.win)
900 {
901 ecore_wl_window_update_size(ee->engine.wl.win, ee->w, ee->h);
902 ecore_wl_window_buffer_attach(ee->engine.wl.win,
903 ee->engine.wl.buffer, 0, 0);
904 }
862} 905}
863 906
864static int 907static int