3 #include "evas_common.h"
4 #include "evas_engine.h"
8 evas_software_ddraw_output_buffer_new(int depth,
13 DD_Output_Buffer *ddob;
15 ddob = calloc(1, sizeof(DD_Output_Buffer));
16 if (!ddob) return NULL;
21 ddob->height = height;
22 ddob->pitch = width * depth / 8;
26 ddob->data = malloc(ddob->pitch * height);
38 evas_software_ddraw_output_buffer_free(DD_Output_Buffer *ddob)
40 if (ddob->data) free(ddob->data);
45 evas_software_ddraw_output_buffer_paste(DD_Output_Buffer *ddob,
61 if ((x >= ddraw_width) || (y >= ddraw_height))
64 /* compute the size of the data to copy on the back surface */
65 width = ((x + ddob->width) > ddraw_width)
68 height = ((y + ddob->height) > ddraw_height)
71 pitch = width * ddob->depth / 8;
73 dd_data = (DATA8 *)ddraw_data + y * ddraw_pitch + x * ddraw_depth;
74 evas_data = (unsigned char *)ddob->data;
75 for (j = 0; j < height; j++, evas_data += ddob->pitch, dd_data += ddraw_pitch)
76 memcpy(dd_data, evas_data, pitch);
80 evas_software_ddraw_output_buffer_data(DD_Output_Buffer *ddob,
81 int *bytes_per_line_ret)
83 if (bytes_per_line_ret) *bytes_per_line_ret = ddob->pitch;
88 evas_software_ddraw_output_buffer_depth(DD_Output_Buffer *ddob)