aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/lib/ecore_evas/ecore_evas_buffer.c82
-rw-r--r--src/lib/ecore_evas/ecore_evas_buffer.h1
-rw-r--r--src/modules/evas/engines/buffer/Evas_Engine_Buffer.h2
-rw-r--r--src/modules/evas/engines/buffer/evas_engine.c7
-rw-r--r--src/modules/evas/engines/buffer/evas_engine.h10
-rw-r--r--src/modules/evas/engines/buffer/evas_outbuf.c217
6 files changed, 266 insertions, 53 deletions
diff --git a/src/lib/ecore_evas/ecore_evas_buffer.c b/src/lib/ecore_evas/ecore_evas_buffer.c
index dcb9fa13f1..e3a75c2577 100644
--- a/src/lib/ecore_evas/ecore_evas_buffer.c
+++ b/src/lib/ecore_evas/ecore_evas_buffer.c
@@ -30,8 +30,9 @@ _ecore_evas_buffer_free(Ecore_Evas *ee)
}
else
{
- bdata->free_func(bdata->data,
- bdata->pixels);
+ bdata->free_func(bdata->data, bdata->pixels);
+ if (bdata->swap)
+ bdata->free_func(bdata->data, bdata->swap);
}
free(bdata);
@@ -51,9 +52,18 @@ _ecore_evas_resize(Ecore_Evas *ee, int w, int h)
if ((w == ee->w) && (h == ee->h)) return;
ee->w = w;
ee->h = h;
- evas_output_size_set(ee->evas, ee->w, ee->h);
- evas_output_viewport_set(ee->evas, 0, 0, ee->w, ee->h);
- evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
+ if (PORTRAIT_CHECK(ee->rotation))
+ {
+ evas_output_size_set(ee->evas, ee->w, ee->h);
+ evas_output_viewport_set(ee->evas, 0, 0, ee->w, ee->h);
+ evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
+ }
+ else
+ {
+ evas_output_size_set(ee->evas, ee->h, ee->w);
+ evas_output_viewport_set(ee->evas, 0, 0, ee->h, ee->w);
+ evas_damage_rectangle_add(ee->evas, 0, 0, ee->h, ee->w);
+ }
if (bdata->image)
{
@@ -63,11 +73,18 @@ _ecore_evas_resize(Ecore_Evas *ee, int w, int h)
else
{
if (bdata->pixels)
- bdata->free_func(bdata->data,
- bdata->pixels);
- bdata->pixels = bdata->alloc_func(bdata->data,
- ee->w * ee->h * sizeof(int));
- stride = ee->w * sizeof(int);
+ bdata->free_func(bdata->data, bdata->pixels);
+ if (bdata->swap)
+ bdata->free_func(bdata->data, bdata->swap);
+ bdata->pixels = bdata->alloc_func(bdata->data, ee->w * ee->h * sizeof(int));
+ bdata->swap = NULL;
+ if (ee->rotation)
+ bdata->swap = bdata->alloc_func(bdata->data, ee->w * ee->h * sizeof(int));
+ if (PORTRAIT_CHECK(ee->rotation))
+ stride = ee->w;
+ else
+ stride = ee->h;
+ stride *= sizeof(int);
}
einfo = (Evas_Engine_Info_Buffer *)evas_engine_info_get(ee->evas);
@@ -83,6 +100,7 @@ _ecore_evas_resize(Ecore_Evas *ee, int w, int h)
einfo->info.alpha_threshold = 0;
einfo->info.func.new_update_region = NULL;
einfo->info.func.free_update_region = NULL;
+ einfo->info.render_buffer = bdata->swap;
if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
{
ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
@@ -100,6 +118,47 @@ _ecore_evas_move_resize(Ecore_Evas *ee, int x EINA_UNUSED, int y EINA_UNUSED, in
}
static void
+_ecore_evas_buffer_rotation_set(Ecore_Evas *ee, int rotation, int resize)
+{
+ Evas_Engine_Info_Buffer *einfo;
+ const Evas_Device *pointer;
+ Ecore_Evas_Cursor *cursor = NULL;
+ Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data;
+
+ if (rotation == ee->rotation) return;
+ if (bdata->image) return; //parent canvas should rotate?
+ pointer = evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_TYPE_SEAT);
+ if (pointer) cursor = eina_hash_find(ee->prop.cursors, &pointer);
+ einfo = (Evas_Engine_Info_Buffer *)evas_engine_info_get(ee->evas);
+ einfo->info.rotation = rotation;
+ if (!resize)
+ {
+ if ((!rotation) && bdata->swap)
+ {
+ bdata->free_func(bdata->data, bdata->swap);
+ bdata->swap = NULL;
+ }
+ if (rotation && (!bdata->swap))
+ bdata->swap = bdata->alloc_func(bdata->data, ee->w * ee->h * sizeof(int));
+ }
+ einfo->info.render_buffer = bdata->swap;
+ if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info*)einfo))
+ {
+ ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
+ }
+ ee->rotation = rotation;
+ if (resize)
+ {
+ int w = ee->w, h = ee->h;
+ ee->w = 0, ee->h = 0;
+ _ecore_evas_resize(ee, w, h);
+ }
+ if (!cursor) return;
+ _ecore_evas_mouse_move_process(ee, cursor->pos_x, cursor->pos_y,
+ (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff));
+}
+
+static void
_ecore_evas_show(Ecore_Evas *ee)
{
Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data;
@@ -641,7 +700,7 @@ static Ecore_Evas_Engine_Func _ecore_buffer_engine_func =
NULL,
_ecore_evas_resize,
_ecore_evas_move_resize,
- NULL,
+ _ecore_evas_buffer_rotation_set,
NULL,
_ecore_evas_show,
NULL,
@@ -801,6 +860,7 @@ ecore_evas_buffer_allocfunc_new(int w, int h,
einfo->info.alpha_threshold = 0;
einfo->info.func.new_update_region = NULL;
einfo->info.func.free_update_region = NULL;
+ einfo->info.switch_data = ee;
if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
{
ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
diff --git a/src/lib/ecore_evas/ecore_evas_buffer.h b/src/lib/ecore_evas/ecore_evas_buffer.h
index e29dee335b..234fde3ed1 100644
--- a/src/lib/ecore_evas/ecore_evas_buffer.h
+++ b/src/lib/ecore_evas/ecore_evas_buffer.h
@@ -5,6 +5,7 @@ typedef struct _Ecore_Evas_Engine_Buffer_Data Ecore_Evas_Engine_Buffer_Data;
struct _Ecore_Evas_Engine_Buffer_Data {
void *pixels;
+ void *swap;
Evas_Object *image;
void (*free_func) (void *data, void *pix);
void *(*alloc_func) (void *data, int size);
diff --git a/src/modules/evas/engines/buffer/Evas_Engine_Buffer.h b/src/modules/evas/engines/buffer/Evas_Engine_Buffer.h
index 0f23758079..933ab7b446 100644
--- a/src/modules/evas/engines/buffer/Evas_Engine_Buffer.h
+++ b/src/modules/evas/engines/buffer/Evas_Engine_Buffer.h
@@ -19,6 +19,7 @@ struct _Evas_Engine_Info_Buffer
int depth_type;
void *dest_buffer;
+ void *render_buffer;
int dest_buffer_row_bytes;
Eina_Bool use_color_key : 1;
@@ -33,6 +34,7 @@ struct _Evas_Engine_Info_Buffer
} func;
void *switch_data;
+ int rotation;
} info;
/* non-blocking or blocking mode */
diff --git a/src/modules/evas/engines/buffer/evas_engine.c b/src/modules/evas/engines/buffer/evas_engine.c
index bd6543bc74..e7334b4670 100644
--- a/src/modules/evas/engines/buffer/evas_engine.c
+++ b/src/modules/evas/engines/buffer/evas_engine.c
@@ -19,7 +19,6 @@ static Evas_Func func, pfunc;
typedef Render_Engine_Software_Generic Render_Engine;
/* prototypes we will use here */
-static void *_output_setup(int w, int h, void *dest_buffer, int dest_buffer_row_bytes, int depth_type, int use_color_key, int alpha_threshold, int color_key_r, int color_key_g, int color_key_b, 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);
static void *eng_info(Evas *eo_e EINA_UNUSED);
static void eng_info_free(Evas *eo_e EINA_UNUSED, void *info);
@@ -29,7 +28,9 @@ static void eng_output_free(void *engine EINA_UNUSED, void *data);
static void *
_output_setup(int w,
int h,
+ int rot,
void *dest_buffer,
+ void *render_buffer,
int dest_buffer_row_bytes,
int depth_type,
int use_color_key,
@@ -70,8 +71,10 @@ _output_setup(int w,
A_VAL(&color_key) = 0;
ob = evas_buffer_outbuf_buf_setup_fb(w,
h,
+ rot,
dep,
dest_buffer,
+ render_buffer,
dest_buffer_row_bytes,
use_color_key,
color_key,
@@ -132,7 +135,9 @@ eng_setup(void *engine EINA_UNUSED, void *in, unsigned int w, unsigned int h)
return _output_setup(w,
h,
+ info->info.rotation,
info->info.dest_buffer,
+ info->info.render_buffer,
info->info.dest_buffer_row_bytes,
info->info.depth_type,
info->info.use_color_key,
diff --git a/src/modules/evas/engines/buffer/evas_engine.h b/src/modules/evas/engines/buffer/evas_engine.h
index 4fcf2e451f..c840ea0916 100644
--- a/src/modules/evas/engines/buffer/evas_engine.h
+++ b/src/modules/evas/engines/buffer/evas_engine.h
@@ -39,11 +39,13 @@ struct _Outbuf
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;
@@ -54,7 +56,8 @@ struct _Outbuf
} func;
struct {
- RGBA_Image *back_buf;
+ RGBA_Image *back_buf; //not actually the back buffer, just a cache entry for the front buffer
+ RGBA_Image *render_buf;
} priv;
};
@@ -64,9 +67,10 @@ 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 w, int h, int rot,
Outbuf_Depth depth,
void *dest,
+ void *rdest,
int dest_row_bytes,
int use_color_key,
DATA32 color_key,
@@ -75,7 +79,7 @@ void evas_buffer_outbuf_buf_update_fb (Outbuf *buf,
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, Outbuf_Depth depth, void *dest, int dest_row_bytes, int use_color_key, DATA32 color_key, int alpha_level,
+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),
diff --git a/src/modules/evas/engines/buffer/evas_outbuf.c b/src/modules/evas/engines/buffer/evas_outbuf.c
index a6c7152e68..968adb81ac 100644
--- a/src/modules/evas/engines/buffer/evas_outbuf.c
+++ b/src/modules/evas/engines/buffer/evas_outbuf.c
@@ -17,6 +17,15 @@ evas_buffer_outbuf_buf_init(void)
void
evas_buffer_outbuf_buf_free(Outbuf *buf)
{
+ if (buf->priv.render_buf)
+ {
+#ifdef EVAS_CSERVE2
+ if (evas_cserve2_use_get())
+ evas_cache2_image_close(&buf->priv.render_buf->cache_entry);
+ else
+#endif
+ evas_cache_image_drop(&buf->priv.render_buf->cache_entry);
+ }
if (buf->priv.back_buf)
{
#ifdef EVAS_CSERVE2
@@ -30,7 +39,7 @@ evas_buffer_outbuf_buf_free(Outbuf *buf)
}
void
-evas_buffer_outbuf_buf_update_fb(Outbuf *buf, int w, int h, Outbuf_Depth depth, void *dest, int dest_row_bytes, int use_color_key, DATA32 color_key, int alpha_level,
+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),
@@ -38,9 +47,11 @@ evas_buffer_outbuf_buf_update_fb(Outbuf *buf, int w, int h, Outbuf_Depth depth,
{
buf->w = w;
buf->h = h;
+ buf->rotation = rot;
buf->depth = depth;
buf->dest = dest;
+ buf->rdest = rdest;
buf->dest_row_bytes = dest_row_bytes;
buf->alpha_level = alpha_level;
@@ -59,37 +70,67 @@ evas_buffer_outbuf_buf_update_fb(Outbuf *buf, int w, int h, Outbuf_Depth depth,
memset(buf->dest, 0, h * buf->dest_row_bytes);
#ifdef EVAS_CSERVE2
if (evas_cserve2_use_get())
- buf->priv.back_buf = (RGBA_Image *)evas_cache2_image_data(evas_common_image_cache2_get(),
- w, h,
- buf->dest,
- 1, EVAS_COLORSPACE_ARGB8888);
+ {
+ buf->priv.back_buf = (RGBA_Image *)evas_cache2_image_data(evas_common_image_cache2_get(),
+ w, h,
+ buf->dest,
+ 1, EVAS_COLORSPACE_ARGB8888);
+ if (buf->rdest)
+ buf->priv.render_buf = (RGBA_Image *)evas_cache2_image_data(evas_common_image_cache2_get(),
+ w, h,
+ buf->rdest,
+ 1, EVAS_COLORSPACE_ARGB8888);
+
+ }
else
#endif
- buf->priv.back_buf = (RGBA_Image *)evas_cache_image_data(evas_common_image_cache_get(),
- w, h,
- buf->dest,
- 1, EVAS_COLORSPACE_ARGB8888);
+ {
+ buf->priv.back_buf = (RGBA_Image *)evas_cache_image_data(evas_common_image_cache_get(),
+ w, h,
+ buf->dest,
+ 1, EVAS_COLORSPACE_ARGB8888);
+ if (buf->rdest)
+ buf->priv.render_buf = (RGBA_Image *)evas_cache_image_data(evas_common_image_cache_get(),
+ w, h,
+ buf->rdest,
+ 1, EVAS_COLORSPACE_ARGB8888);
+ }
}
else if ((buf->depth == OUTBUF_DEPTH_RGB_32BPP_888_8888) &&
(buf->dest) && (buf->dest_row_bytes == (buf->w * sizeof(DATA32))))
{
#ifdef EVAS_CSERVE2
if (evas_cserve2_use_get())
- buf->priv.back_buf = (RGBA_Image *)evas_cache2_image_data(evas_common_image_cache2_get(),
- w, h,
- buf->dest,
- 0, EVAS_COLORSPACE_ARGB8888);
+ {
+ buf->priv.back_buf = (RGBA_Image *)evas_cache2_image_data(evas_common_image_cache2_get(),
+ w, h,
+ buf->dest,
+ 0, EVAS_COLORSPACE_ARGB8888);
+ if (buf->rdest)
+ buf->priv.render_buf = (RGBA_Image *)evas_cache2_image_data(evas_common_image_cache2_get(),
+ w, h,
+ buf->rdest,
+ 0, EVAS_COLORSPACE_ARGB8888);
+
+ }
else
#endif
- buf->priv.back_buf = (RGBA_Image *)evas_cache_image_data(evas_common_image_cache_get(),
- w, h,
- buf->dest,
- 0, EVAS_COLORSPACE_ARGB8888);
+ {
+ buf->priv.back_buf = (RGBA_Image *)evas_cache_image_data(evas_common_image_cache_get(),
+ w, h,
+ buf->dest,
+ 0, EVAS_COLORSPACE_ARGB8888);
+ if (buf->rdest)
+ buf->priv.render_buf = (RGBA_Image *)evas_cache_image_data(evas_common_image_cache_get(),
+ w, h,
+ buf->rdest,
+ 0, EVAS_COLORSPACE_ARGB8888);
+ }
}
}
Outbuf *
-evas_buffer_outbuf_buf_setup_fb(int w, int h, Outbuf_Depth depth, void *dest, int dest_row_bytes, int use_color_key, DATA32 color_key, int alpha_level,
+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 *data, void *dest_buffer),
@@ -103,8 +144,10 @@ evas_buffer_outbuf_buf_setup_fb(int w, int h, Outbuf_Depth depth, void *dest, in
evas_buffer_outbuf_buf_update_fb(buf,
w,
h,
+ rot,
depth,
dest,
+ rdest,
dest_row_bytes,
use_color_key,
color_key,
@@ -122,6 +165,11 @@ evas_buffer_outbuf_buf_new_region_for_update(Outbuf *buf, int x, int y, int w, i
{
RGBA_Image *im;
+ if (buf->priv.render_buf)
+ {
+ *cx = x; *cy = y; *cw = w; *ch = h;
+ return buf->priv.render_buf;
+ }
if (buf->priv.back_buf)
{
*cx = x; *cy = y; *cw = w; *ch = h;
@@ -158,7 +206,7 @@ evas_buffer_outbuf_buf_new_region_for_update(Outbuf *buf, int x, int y, int w, i
void
evas_buffer_outbuf_buf_free_region_for_update(Outbuf *buf, RGBA_Image *update)
{
- if (update != buf->priv.back_buf)
+ if ((update != buf->priv.back_buf) && (update != buf->priv.render_buf))
{
#ifdef EVAS_CSERVE2
if (evas_cserve2_use_get())
@@ -175,6 +223,7 @@ evas_buffer_outbuf_buf_switch_buffer(Outbuf *buf, Tilebuf_Rect *surface_damage E
if (buf->func.switch_buffer)
{
buf->dest = buf->func.switch_buffer(buf->switch_data, buf->dest);
+
if (buf->priv.back_buf)
{
#ifdef EVAS_CSERVE2
@@ -222,6 +271,39 @@ _update_24bpp_888_888(DATA8 *dst, DATA32 *src, int depth)
void
evas_buffer_outbuf_buf_push_updated_region(Outbuf *buf, RGBA_Image *update, int x, int y, int w, int h)
{
+ Eina_Rectangle r = {0}, pr;
+ int rx = 0, ry = 0;
+
+ if (buf->rotation == 0)
+ {
+ r.x = x;
+ r.y = y;
+ }
+ else if (buf->rotation == 90)
+ {
+ r.x = y;
+ r.y = buf->w - x - w;
+ }
+ else if (buf->rotation == 180)
+ {
+ r.x = buf->w - x - w;
+ r.y = buf->h - y - h;
+ }
+ else if (buf->rotation == 270)
+ {
+ r.x = buf->h - y - h;
+ r.y = x;
+ }
+ if ((buf->rotation == 0) || (buf->rotation == 180))
+ {
+ r.w = w;
+ r.h = h;
+ }
+ else if ((buf->rotation == 90) || (buf->rotation == 270))
+ {
+ r.w = h;
+ r.h = w;
+ }
/* copy update image to out buf & convert */
switch (buf->depth)
{
@@ -246,18 +328,32 @@ evas_buffer_outbuf_buf_push_updated_region(Outbuf *buf, RGBA_Image *update, int
dest = buf->func.new_update_region(x, y, w, h, &row_bytes);
}
if (!dest) break;
- for (yy = 0; yy < h; yy++)
+ for (yy = 0; yy < update->cache_entry.h; yy++)
{
- dst = dest + (yy * row_bytes);
- src = update->image.data + (yy * update->cache_entry.w);
- for (xx = 0; xx < update->cache_entry.w; xx++)
- {
- if ((!buf->use_color_key) || (A_VAL(src) > thresh))
- dst = _update_24bpp_888_888(dst, src, buf->depth);
- else
- dst = _update_24bpp_888_888(dst, &colorkey, buf->depth);
- src++;
- }
+ dst = dest + (yy * row_bytes);
+ src = update->image.data + (yy * update->cache_entry.w);
+ for (xx = 0; xx < update->cache_entry.w; xx++)
+ {
+ if ((!buf->use_color_key) || (A_VAL(src) > thresh))
+ dst = _update_24bpp_888_888(dst, src, buf->depth);
+ else
+ dst = _update_24bpp_888_888(dst, &colorkey, buf->depth);
+ src++;
+ }
+/* FIXME: finish these...
+ case 90:
+ dst = dest + ((update->cache_entry.h - yy - 1) * row_bytes);
+ src = update->image.data + yy;
+ for (xx = 0; xx < update->cache_entry.h; xx++)
+ {
+ if ((!buf->use_color_key) || (A_VAL(src) > thresh))
+ dst = _update_24bpp_888_888(dst, src, buf->depth);
+ else
+ dst = _update_24bpp_888_888(dst, &colorkey, buf->depth);
+ src += w;
+ }
+ break;
+*/
}
if (buf->func.free_update_region)
{
@@ -269,11 +365,12 @@ evas_buffer_outbuf_buf_push_updated_region(Outbuf *buf, RGBA_Image *update, int
case OUTBUF_DEPTH_RGB_32BPP_888_8888:
case OUTBUF_DEPTH_ARGB_32BPP_8888_8888:
{
- DATA32 *dest, *src, *dst;
+ DATA32 *dest, *src;
int yy, row_bytes;
row_bytes = buf->dest_row_bytes;
dest = (DATA32 *)((DATA8 *)(buf->dest) + (y * row_bytes) + (x * 4));
+ src = update->image.data;
if (buf->func.new_update_region)
{
dest = buf->func.new_update_region(x, y, w, h, &row_bytes);
@@ -286,14 +383,54 @@ evas_buffer_outbuf_buf_push_updated_region(Outbuf *buf, RGBA_Image *update, int
func = evas_common_draw_func_copy_get(w, 0);
if (func)
{
- for (yy = 0; yy < h; yy++)
+ for (yy = 0; yy < update->cache_entry.h; yy++)
{
+ DATA32 *dst;
src = update->image.data + (yy * update->cache_entry.w);
dst = (DATA32 *)((DATA8 *)(buf->dest) + ((y + yy) * row_bytes));
func(src, dst, w);
}
}
}
+ else if (buf->rotation)
+ {
+ Gfx_Func_Convert conv_func;
+ DATA8 *dst = buf->dest;
+
+ conv_func = evas_common_convert_func_get(0, buf->w, buf->h, 32,
+ 0x00ff0000, 0x0000ff00, 0x000000ff, 0, buf->rotation);
+ if (buf->rotation == 180)
+ {
+ pr = r;
+ RECTS_CLIP_TO_RECT(r.x, r.y, r.w, r.h, 0, 0, buf->w, buf->h);
+ rx = pr.w - r.w; ry = pr.h - r.h;
+ src += (update->cache_entry.w * ry) + rx;
+ w -= rx;
+ }
+ else if (buf->rotation == 90)
+ {
+ pr = r;
+ RECTS_CLIP_TO_RECT(r.x, r.y, r.w, r.h, 0, 0, buf->w, buf->h);
+ rx = pr.w - r.w; ry = pr.h - r.h;
+ src += ry;
+ w -= ry;
+ }
+ else if (buf->rotation == 270)
+ {
+ pr = r;
+ RECTS_CLIP_TO_RECT(r.x, r.y, r.w, r.h, 0, 0, buf->w, buf->h);
+ rx = pr.w - r.w; ry = pr.h - r.h;
+ src += (update->cache_entry.w * rx);
+ w -= ry;
+ }
+ if (conv_func)
+ conv_func(src, dst,
+ update->cache_entry.w - w,
+ (row_bytes / 4) - r.w,
+ r.w, r.h,
+ x + rx, y + ry,
+ NULL);
+ }
if (buf->func.free_update_region)
{
buf->func.free_update_region(x, y, w, h, dest);
@@ -314,11 +451,12 @@ evas_buffer_outbuf_buf_push_updated_region(Outbuf *buf, RGBA_Image *update, int
{
dest = buf->func.new_update_region(x, y, w, h, &row_bytes);
}
- for (yy = 0; yy < h; yy++)
+ /* FIXME: use evas convert functions with rotations */
+ for (yy = 0; yy < update->cache_entry.h; yy++)
{
dst = (DATA32 *)(dest + (yy * row_bytes));
src = update->image.data + (yy * update->cache_entry.w);
- for (xx = 0; xx < w; xx++)
+ for (xx = 0; xx < update->cache_entry.w; xx++)
{
A_VAL(dst) = B_VAL(src);
R_VAL(dst) = G_VAL(src);
@@ -340,9 +478,9 @@ evas_buffer_outbuf_buf_push_updated_region(Outbuf *buf, RGBA_Image *update, int
}
void
-evas_buffer_outbuf_reconfigure(Outbuf *ob, int w, int h, int rot EINA_UNUSED, Outbuf_Depth depth)
+evas_buffer_outbuf_reconfigure(Outbuf *ob, int w, int h, int rot, Outbuf_Depth depth)
{
- void *dest;
+ void *dest, *rdest;
int dest_row_bytes;
int alpha_level;
DATA32 color_key;
@@ -354,6 +492,7 @@ evas_buffer_outbuf_reconfigure(Outbuf *ob, int w, int h, int rot EINA_UNUSED, Ou
if (depth == OUTBUF_DEPTH_INHERIT) depth = ob->depth;
dest = ob->dest;
+ rdest = ob->rdest;
dest_row_bytes = ob->dest_row_bytes;
alpha_level = ob->alpha_level;
color_key = ob->color_key;
@@ -366,8 +505,10 @@ evas_buffer_outbuf_reconfigure(Outbuf *ob, int w, int h, int rot EINA_UNUSED, Ou
evas_buffer_outbuf_buf_update_fb(ob,
w,
h,
+ rot,
depth,
dest,
+ rdest,
dest_row_bytes,
use_color_key,
color_key,
@@ -386,8 +527,8 @@ evas_buffer_outbuf_buf_swap_mode_get(Outbuf *ob)
}
int
-evas_buffer_outbuf_buf_rot_get(Outbuf *buf EINA_UNUSED)
+evas_buffer_outbuf_buf_rot_get(Outbuf *buf)
{
- return 0;
+ return buf->rotation;
}