wined3d: Move the swapchain cursor texture blit to wined3d_cs_exec_present().

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2020-05-26 20:40:10 +04:30 committed by Alexandre Julliard
parent 4bae47cf17
commit c1f09c2461
2 changed files with 26 additions and 27 deletions

View File

@ -521,7 +521,7 @@ static void wined3d_cs_exec_nop(struct wined3d_cs *cs, const void *data)
static void wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data)
{
struct wined3d_texture *logo_texture, *back_buffer;
struct wined3d_texture *logo_texture, *cursor_texture, *back_buffer;
const struct wined3d_cs_present *op = data;
struct wined3d_swapchain *swapchain;
unsigned int i;
@ -539,6 +539,31 @@ static void wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data)
&rect, WINED3D_BLT_SRC_CKEY, NULL, WINED3D_TEXF_POINT);
}
if ((cursor_texture = swapchain->device->cursor_texture)
&& swapchain->device->bCursorVisible && !swapchain->device->hardwareCursor)
{
RECT dst_rect =
{
swapchain->device->xScreenSpace - swapchain->device->xHotSpot,
swapchain->device->yScreenSpace - swapchain->device->yHotSpot,
swapchain->device->xScreenSpace + swapchain->device->cursorWidth - swapchain->device->xHotSpot,
swapchain->device->yScreenSpace + swapchain->device->cursorHeight - swapchain->device->yHotSpot,
};
RECT src_rect =
{
0, 0, cursor_texture->resource.width, cursor_texture->resource.height
};
const RECT clip_rect = {0, 0, back_buffer->resource.width, back_buffer->resource.height};
TRACE("Rendering the software cursor.\n");
if (swapchain->state.desc.windowed)
MapWindowPoints(NULL, swapchain->win_handle, (POINT *)&dst_rect, 2);
if (wined3d_clip_blit(&clip_rect, &dst_rect, &src_rect))
wined3d_texture_blt(back_buffer, 0, &dst_rect, cursor_texture, 0,
&src_rect, WINED3D_BLT_ALPHA_TEST, NULL, WINED3D_TEXF_POINT);
}
swapchain->swapchain_ops->swapchain_present(swapchain, &op->src_rect, &op->dst_rect, op->swap_interval, op->flags);
if (TRACE_ON(fps))

View File

@ -469,7 +469,6 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain,
struct wined3d_texture *back_buffer = swapchain->back_buffers[0];
const struct wined3d_fb_state *fb = &swapchain->device->cs->state.fb;
struct wined3d_rendertarget_view *dsv = fb->depth_stencil;
struct wined3d_texture *cursor_texture;
const struct wined3d_gl_info *gl_info;
struct wined3d_context_gl *context_gl;
struct wined3d_context *context;
@ -488,31 +487,6 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain,
swapchain_gl_set_swap_interval(swapchain, context_gl, swap_interval);
if ((cursor_texture = swapchain->device->cursor_texture)
&& swapchain->device->bCursorVisible && !swapchain->device->hardwareCursor)
{
RECT dst_rect =
{
swapchain->device->xScreenSpace - swapchain->device->xHotSpot,
swapchain->device->yScreenSpace - swapchain->device->yHotSpot,
swapchain->device->xScreenSpace + swapchain->device->cursorWidth - swapchain->device->xHotSpot,
swapchain->device->yScreenSpace + swapchain->device->cursorHeight - swapchain->device->yHotSpot,
};
RECT src_rect =
{
0, 0, cursor_texture->resource.width, cursor_texture->resource.height
};
const RECT clip_rect = {0, 0, back_buffer->resource.width, back_buffer->resource.height};
TRACE("Rendering the software cursor.\n");
if (desc->windowed)
MapWindowPoints(NULL, swapchain->win_handle, (POINT *)&dst_rect, 2);
if (wined3d_clip_blit(&clip_rect, &dst_rect, &src_rect))
wined3d_texture_blt(back_buffer, 0, &dst_rect, cursor_texture, 0,
&src_rect, WINED3D_BLT_ALPHA_TEST, NULL, WINED3D_TEXF_POINT);
}
TRACE("Presenting DC %p.\n", context_gl->dc);
if (!(render_to_fbo = swapchain->render_to_fbo)