Commit c1f09c24 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

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

parent 4bae47cf
...@@ -521,7 +521,7 @@ static void wined3d_cs_exec_nop(struct wined3d_cs *cs, const void *data) ...@@ -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) 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; const struct wined3d_cs_present *op = data;
struct wined3d_swapchain *swapchain; struct wined3d_swapchain *swapchain;
unsigned int i; unsigned int i;
...@@ -539,6 +539,31 @@ static void wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data) ...@@ -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); &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); swapchain->swapchain_ops->swapchain_present(swapchain, &op->src_rect, &op->dst_rect, op->swap_interval, op->flags);
if (TRACE_ON(fps)) if (TRACE_ON(fps))
......
...@@ -469,7 +469,6 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, ...@@ -469,7 +469,6 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain,
struct wined3d_texture *back_buffer = swapchain->back_buffers[0]; struct wined3d_texture *back_buffer = swapchain->back_buffers[0];
const struct wined3d_fb_state *fb = &swapchain->device->cs->state.fb; const struct wined3d_fb_state *fb = &swapchain->device->cs->state.fb;
struct wined3d_rendertarget_view *dsv = fb->depth_stencil; struct wined3d_rendertarget_view *dsv = fb->depth_stencil;
struct wined3d_texture *cursor_texture;
const struct wined3d_gl_info *gl_info; const struct wined3d_gl_info *gl_info;
struct wined3d_context_gl *context_gl; struct wined3d_context_gl *context_gl;
struct wined3d_context *context; struct wined3d_context *context;
...@@ -488,31 +487,6 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, ...@@ -488,31 +487,6 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain,
swapchain_gl_set_swap_interval(swapchain, context_gl, swap_interval); 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); TRACE("Presenting DC %p.\n", context_gl->dc);
if (!(render_to_fbo = swapchain->render_to_fbo) if (!(render_to_fbo = swapchain->render_to_fbo)
......
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