3 #include "evas_engine.h"
6 Direct3D_Output_Buffer *
7 evas_direct3d_output_buffer_new(int depth,
12 Direct3D_Output_Buffer *d3dob;
14 d3dob = calloc(1, sizeof(Direct3D_Output_Buffer));
15 if (!d3dob) return NULL;
20 d3dob->height = height;
21 d3dob->pitch = width * (depth >> 3);
25 d3dob->image = malloc(d3dob->pitch * height);
37 evas_direct3d_output_buffer_free(Direct3D_Output_Buffer *d3dob)
39 if (d3dob->image) free(d3dob->image);
44 evas_direct3d_output_buffer_paste(Direct3D_Output_Buffer *d3dob,
58 if ((x >= d3d_width) || (y >= d3d_height))
61 /* compute the size of the data to copy on the back surface */
62 width = ((x + d3dob->width) > d3d_width)
65 height = ((y + d3dob->height) > d3d_height)
68 pitch = width * (d3dob->depth >> 3);
70 d3d_data += y * d3d_pitch + x * (d3dob->depth >> 3);
71 evas_data = (unsigned char *)d3dob->image;
72 for (j = 0; j < height; j++, evas_data += d3dob->pitch, d3d_data += d3d_pitch)
73 memcpy(d3d_data, evas_data, pitch);
77 evas_direct3d_output_buffer_data(Direct3D_Output_Buffer *d3dob,
78 int *bytes_per_line_ret)
80 if (bytes_per_line_ret) *bytes_per_line_ret = d3dob->pitch;
85 evas_direct3d_output_buffer_depth(Direct3D_Output_Buffer *d3dob)