Commit 1cf70d1d authored by Laurent Aimar's avatar Laurent Aimar Committed by Jean-Baptiste Kempf

Fixed rendering of subpictures with non 0 offset in direct3d.

It is needed for DVD menu support.
(cherry picked from commit 1772a146c2a2b9a76af44e1226765aa8368f3b0e)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 2b743128
......@@ -1254,10 +1254,12 @@ static void Direct3DImportSubpicture(vout_display_t *vd,
D3DLOCKED_RECT lock;
hr = IDirect3DTexture9_LockRect(d3dr->texture, 0, &lock, NULL, 0);
if (SUCCEEDED(hr)) {
uint8_t *dst_data = lock.pBits;
int dst_pitch = lock.Pitch;
uint8_t *src_data = r->p_picture->p->p_pixels;
int src_pitch = r->p_picture->p->i_pitch;
uint8_t *dst_data = lock.pBits;
int dst_pitch = lock.Pitch;
const int src_offset = r->fmt.i_y_offset * r->p_picture->p->i_pitch +
r->fmt.i_x_offset * r->p_picture->p->i_pixel_pitch;
uint8_t *src_data = &r->p_picture->p->p_pixels[src_offset];
int src_pitch = r->p_picture->p->i_pitch;
for (unsigned y = 0; y < r->fmt.i_visible_height; y++) {
int copy_pitch = __MIN(dst_pitch, r->p_picture->p->i_visible_pitch);
if (d3dr->format == D3DFMT_A8B8G8R8) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment