e_hwc_window: add e_hwc_window_comp_override_set
[platform/upstream/enlightenment.git] / src / include / e_hwc_window.h
1 #ifndef E_HWC_WINDOW_H
2 #define E_HWC_WINDOW_H
3
4 #include <e_types.h>
5 #include <e_object.h>
6 #include <e_client.h>
7 #include <e_comp_wl.h>
8 #include <e_hwc.h>
9 #include <e_presentation_time.h>
10 #include <e_zone.h>
11 #include <e_egl_sync.h>
12
13 #include <tbm_surface.h>
14 #include <wayland-server.h>
15 #include <Ecore.h>
16
17 typedef enum _E_Hwc_Window_State
18 {
19    E_HWC_WINDOW_STATE_NONE,
20    E_HWC_WINDOW_STATE_CLIENT,
21    E_HWC_WINDOW_STATE_DEVICE,
22    E_HWC_WINDOW_STATE_VIDEO,
23    E_HWC_WINDOW_STATE_CURSOR,
24 } E_Hwc_Window_State;
25
26 typedef enum _E_Hwc_Window_Activation_State
27 {
28    E_HWC_WINDOW_ACTIVATION_STATE_DEACTIVATED = 0,
29    E_HWC_WINDOW_ACTIVATION_STATE_ACTIVATED,
30 } E_Hwc_Window_Activation_State;
31
32 struct _E_Hwc_Window
33 {
34    E_Object                       e_obj_inherit;
35
36    E_Client                      *ec;
37    E_Object_Delfn                *ec_delfn;
38    E_Hwc                         *hwc;
39    tdm_hwc_window                *thwc_window;
40    int                            zpos;
41    Eina_Bool                      is_target;
42    Eina_Bool                      is_root_target;
43    Eina_Bool                      is_video;
44    Eina_Bool                      is_cursor;
45    Eina_Bool                      is_deleted;
46    Eina_Bool                      set_name;
47    Eina_Bool                      device_state_available;
48
49    E_Hwc_Window_Activation_State  activation_state; /* hwc_window has occupied the hw layer or not */
50
51    E_Hwc_Window_State             state;
52    E_Hwc_Window_State             accepted_state;
53
54    E_Hwc_Window_Update_Data       current;
55    Eina_List                     *pending_update_list;
56
57    Eina_List                     *prop_list;
58
59    E_Hwc_Window_Update_Data       commit;
60    Eina_List                     *commit_data_list;
61
62    /* current display information */
63    E_Hwc_Window_Update_Data       display;
64
65    struct
66    {
67       int                         rotation;
68       E_Comp_Wl_Buffer           *buffer;
69       void                       *img_ptr;
70       int                         img_w;
71       int                         img_h;
72       int                         img_stride;
73    } cursor;
74    struct wl_listener             cursor_buffer_destroy_listener;
75
76    struct
77    {
78       /* for fps */
79       double               fps;
80       double               old_fps;
81       double               frametimes[122];
82       double               time;
83       double               lapse;
84       int                  cframes;
85       int                  flapse;
86    } fps;
87
88    int                            constraints;
89
90    E_Hwc_Window_Queue            *queue;
91    struct wl_listener             queue_destroy_listener;
92
93    Eina_Bool                      render_target;
94    Eina_Bool                      on_rendered_target;
95
96    unsigned int                   restriction;
97    Eina_Bool                      obscured_by_target;
98
99    E_Presentation_Time_Container  presentation_container;
100
101    Eina_Bool                      present_sync;
102
103    E_Hwc_Presentation_Callback_List pending_presentation_callbacks;
104    E_Hwc_Presentation_Callback_List presentation_callbacks;
105
106    struct wayland_tbm_client_queue *cqueue;
107
108    E_Zone                        *zone;
109    E_Object_Delfn                *zone_delfn;
110
111    Evas_Object                   *below_transparent_obj;
112
113    Eina_Bool                      queue_unset_waiting;
114
115    Eina_Bool                      comp_override;
116 };
117
118 struct _E_Hwc_Window_Target
119 {
120    E_Hwc_Window        hwc_window; /* don't move this field */
121    E_Hwc              *hwc;
122
123    Ecore_Evas         *ee;
124    Evas               *evas;
125    int                 event_fd;
126    Ecore_Fd_Handler   *event_hdlr;
127
128    /* a surface the rendering is currently performing at */
129    tbm_surface_h       dequeued_tsurface;
130    Eina_List          *rendering_tsurfaces;
131    Eina_List          *rendered_windows;
132    Eina_Bool           is_rendering;
133
134    E_Hwc_Window_Queue *pp_queue;
135    struct wl_listener  pp_queue_destroy_listener;
136
137    E_Egl_Sync         *end_render_sync;
138
139    Eina_List          *present_sync_windows;
140    Eina_List          *pending_presentation_cb_wins;
141 };
142
143 struct _E_Hwc_Window_Commit_Data {
144    E_Hwc_Window                  *hwc_window;
145    E_Comp_Wl_Buffer_Ref           buffer_ref;
146    E_Hwc_Window_Queue_Buffer_Ref  queue_buffer_ref;
147    E_Hwc_Window_Buffer            buffer;
148    tdm_hwc_window_info            info;
149 };
150
151 #endif // E_HWC_WINDOW_H