forked from enlightenment/efl
fix software_16_ddraw engine compilation
SVN revision: 37966
This commit is contained in:
parent
193eb2b92a
commit
7dfff8ac98
|
@ -38,17 +38,19 @@ evas_software_ddraw_output_buffer_new(HWND window,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
ddob->im.pixels = (DATA16 *)surface_desc.lpSurface;
|
||||
ddob->im.w = width;
|
||||
ddob->im.h = height;
|
||||
ddob->im.stride = width;
|
||||
ddob->im.references = 1;
|
||||
ddob->data = (DATA16 *)surface_desc.lpSurface;
|
||||
|
||||
if (FAILED(ddob->dd.surface_source->Unlock(NULL)))
|
||||
{
|
||||
free(ddob);
|
||||
return NULL;
|
||||
}
|
||||
if (ddob->im)
|
||||
evas_cache_image_drop(&ddob->im->cache_entry);
|
||||
|
||||
ddob->im = (Soft16_Image *) evas_cache_image_data(evas_common_soft16_image_cache_get(), width, height, (DATA32 *) ddob->data, 0, EVAS_COLORSPACE_RGB565_A5P);
|
||||
if (ddob->im)
|
||||
ddob->im->stride = ddob->pitch;
|
||||
|
||||
return ddob;
|
||||
}
|
||||
|
|
|
@ -67,13 +67,6 @@ eng_info_free(Evas *e, void *info)
|
|||
free(in);
|
||||
}
|
||||
|
||||
static void
|
||||
_tmp_out_free(Soft16_Image *tmp_out)
|
||||
{
|
||||
free(tmp_out->pixels);
|
||||
free(tmp_out);
|
||||
}
|
||||
|
||||
static void
|
||||
_tmp_out_alloc(Render_Engine *re)
|
||||
{
|
||||
|
@ -88,9 +81,9 @@ _tmp_out_alloc(Render_Engine *re)
|
|||
|
||||
if (re->tmp_out)
|
||||
{
|
||||
if ((re->tmp_out->w < w) || (re->tmp_out->h < h))
|
||||
if ((re->tmp_out->cache_entry.w < w) || (re->tmp_out->cache_entry.h < h))
|
||||
{
|
||||
_tmp_out_free(re->tmp_out);
|
||||
evas_cache_image_drop(&re->tmp_out->cache_entry);
|
||||
re->tmp_out = NULL;
|
||||
}
|
||||
}
|
||||
|
@ -99,14 +92,9 @@ _tmp_out_alloc(Render_Engine *re)
|
|||
{
|
||||
Soft16_Image *im;
|
||||
|
||||
im = calloc(1, sizeof(Soft16_Image));
|
||||
im->w = w;
|
||||
im->h = h;
|
||||
im->stride = w + ((w % 4) ? (4 - (w % 4)) : 0);
|
||||
im->have_alpha = 0;
|
||||
im->references = 1;
|
||||
im->free_pixels = 1;
|
||||
im->pixels = malloc(h * im->stride * sizeof(DATA16));
|
||||
im = (Soft16_Image *) evas_cache_image_empty(evas_common_soft16_image_cache_get());
|
||||
im->cache_entry.flags.alpha = 0;
|
||||
evas_cache_image_surface_alloc(&im->cache_entry, w, h);
|
||||
|
||||
re->tmp_out = im;
|
||||
}
|
||||
|
@ -184,7 +172,7 @@ eng_setup(Evas *e, void *in)
|
|||
evas_common_tilebuf_set_tile_size(re->tb, TILESIZE, TILESIZE);
|
||||
if (re->tmp_out)
|
||||
{
|
||||
_tmp_out_free(re->tmp_out);
|
||||
evas_cache_image_drop(&re->tmp_out->cache_entry);
|
||||
re->tmp_out = NULL;
|
||||
}
|
||||
}
|
||||
|
@ -205,7 +193,7 @@ eng_output_free(void *data)
|
|||
if (re->clip_rects) DeleteObject(re->clip_rects);
|
||||
if (re->tb) evas_common_tilebuf_free(re->tb);
|
||||
if (re->rects) evas_common_tilebuf_free_render_rects(re->rects);
|
||||
if (re->tmp_out) _tmp_out_free(re->tmp_out);
|
||||
if (re->tmp_out) evas_cache_image_drop(&re->tmp_out->cache_entry);
|
||||
free(re);
|
||||
|
||||
evas_common_font_shutdown();
|
||||
|
@ -243,7 +231,7 @@ eng_output_resize(void *data, int w, int h)
|
|||
}
|
||||
if (re->tmp_out)
|
||||
{
|
||||
_tmp_out_free(re->tmp_out);
|
||||
evas_cache_image_drop(&re->tmp_out->cache_entry);
|
||||
re->tmp_out = NULL;
|
||||
}
|
||||
}
|
||||
|
@ -461,7 +449,7 @@ _tmp_out_process(Render_Engine *re, int out_x, int out_y, int w, int h)
|
|||
d = &re->ddob->im;
|
||||
s = re->tmp_out;
|
||||
|
||||
if ((w < 1) || (h < 1) || (out_x >= d->w) || (out_y >= d->h))
|
||||
if ((w < 1) || (h < 1) || (out_x >= d->cache_entry.w) || (out_y >= d->cache_entry.h))
|
||||
return;
|
||||
|
||||
if (re->rotation == 90)
|
||||
|
@ -567,7 +555,7 @@ eng_output_idle_flush(void *data)
|
|||
}
|
||||
if (re->tmp_out)
|
||||
{
|
||||
_tmp_out_free(re->tmp_out);
|
||||
evas_cache_image_drop(&re->tmp_out->cache_entry);
|
||||
re->tmp_out = NULL;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ typedef struct _DDraw_Output_Buffer DDraw_Output_Buffer;
|
|||
|
||||
struct _DDraw_Output_Buffer
|
||||
{
|
||||
Soft16_Image im;
|
||||
Soft16_Image *im;
|
||||
struct {
|
||||
HWND window;
|
||||
LPDIRECTDRAW object;
|
||||
|
@ -19,6 +19,7 @@ struct _DDraw_Output_Buffer
|
|||
LPDIRECTDRAWSURFACE surface_back;
|
||||
LPDIRECTDRAWSURFACE surface_source;
|
||||
} dd;
|
||||
void *data;
|
||||
int x;
|
||||
int y;
|
||||
int width;
|
||||
|
|
Loading…
Reference in New Issue