aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/evas/engines/buffer/evas_engine.h
blob: c840ea0916130dc8381e5dfd83624eb3fc9d8c6d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#ifndef EVAS_ENGINE_H
#define EVAS_ENGINE_H
#include "evas_common_private.h"

#include "../software_generic/Evas_Engine_Software_Generic.h"

/*  this thing is for eina_log */
extern int _evas_engine_buffer_log_dom ;

#ifdef ERR
# undef ERR
#endif
#define ERR(...) EINA_LOG_DOM_ERR(_evas_engine_buffer_log_dom, __VA_ARGS__)

#ifdef DBG
# undef DBG
#endif
#define DBG(...) EINA_LOG_DOM_DBG(_evas_engine_buffer_log_dom, __VA_ARGS__)

#ifdef INF
# undef INF
#endif
#define INF(...) EINA_LOG_DOM_INFO(_evas_engine_buffer_log_dom, __VA_ARGS__)

#ifdef WRN
# undef WRN
#endif
#define WRN(...) EINA_LOG_DOM_WARN(_evas_engine_buffer_log_dom, __VA_ARGS__)

#ifdef CRI
# undef CRI
#endif
#define CRI(...) EINA_LOG_DOM_CRIT(_evas_engine_buffer_log_dom, __VA_ARGS__)


struct _Outbuf
{
   int                           w, h;
   Outbuf_Depth                  depth;

   void                         *dest;
   void                         *rdest;
   unsigned int                  dest_row_bytes;
   void                         *switch_data;

   int                           alpha_level;
   DATA32                        color_key;
   int                           rotation;
   Eina_Bool                     use_color_key : 1;
   Eina_Bool                     first_frame : 1;

   struct {
      void * (*new_update_region) (int x, int y, int w, int h, int *row_bytes);
      void   (*free_update_region) (int x, int y, int w, int h, void *data);
      void * (*switch_buffer) (void *data, void *dest_buffer);
   } func;

   struct {
      RGBA_Image                *back_buf; //not actually the back buffer, just a cache entry for the front buffer
      RGBA_Image                *render_buf;
   } priv;
};

/****/

void         evas_buffer_outbuf_buf_init                   (void);
void         evas_buffer_outbuf_buf_free                   (Outbuf *buf);

void         evas_buffer_outbuf_buf_update_fb              (Outbuf *buf,
                                                            int w, int h, int rot,
                                                            Outbuf_Depth depth,
                                                            void *dest,
                                                            void *rdest,
                                                            int dest_row_bytes,
                                                            int use_color_key,
                                                            DATA32 color_key,
                                                            int alpha_level,
                                                            void * (*new_update_region) (int x, int y, int w, int h, int *row_bytes),
                                                            void   (*free_update_region) (int x, int y, int w, int h, void *data),
                                                            void * (*switch_buffer) (void *data, void *dest_buffer),
                                                            void *switch_data);
Outbuf      *evas_buffer_outbuf_buf_setup_fb               (int w, int h, int rot, Outbuf_Depth depth, void *dest, void *rdest, int dest_row_bytes, int use_color_key, DATA32 color_key, int alpha_level,
							    void * (*new_update_region) (int x, int y, int w, int h, int *row_bytes),
							    void   (*free_update_region) (int x, int y, int w, int h, void *data),
                                                            void * (*switch_buffer)(void *switch_data, void *dest),
                                                            void *switch_data);


void         evas_buffer_outbuf_reconfigure                (Outbuf *ob, int w, int h, int rot, Outbuf_Depth depth);
void        *evas_buffer_outbuf_buf_new_region_for_update  (Outbuf *buf, int x, int y, int w, int h, int *cx, int *cy, int *cw, int *ch);
void         evas_buffer_outbuf_buf_free_region_for_update (Outbuf *buf, RGBA_Image *update);
void         evas_buffer_outbuf_buf_push_updated_region    (Outbuf *buf, RGBA_Image *update, int x, int y, int w, int h);
void         evas_buffer_outbuf_buf_switch_buffer          (Outbuf *buf, Tilebuf_Rect *surface_damage, Tilebuf_Rect *buffer_damage, Evas_Render_Mode render_mode);
Render_Engine_Swap_Mode evas_buffer_outbuf_buf_swap_mode_get(Outbuf *buf);
int          evas_buffer_outbuf_buf_rot_get                (Outbuf *buf);

#endif