diff options
author | Axel Davy <[email protected]> | 2015-03-21 22:21:14 +0100 |
---|---|---|
committer | Axel Davy <[email protected]> | 2015-08-21 22:21:45 +0200 |
commit | 1b20eaff67fba9ac6310511c79d6de8851c39145 (patch) | |
tree | 9219c4e0e77cae57b9af3971079051458c926532 /src/gallium/state_trackers/nine/device9.c | |
parent | 34708783833bb99e9e42cd40a745fed1354317f2 (diff) |
st/nine: Hide hardware cursor when we don't use it
We have either hardware cursor or software cursor.
When we use software cursor, we should hide the hardware
cursor.
Signed-off-by: Axel Davy <[email protected]>
Reviewed-by: David Heidelberg <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/nine/device9.c')
-rw-r--r-- | src/gallium/state_trackers/nine/device9.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/gallium/state_trackers/nine/device9.c b/src/gallium/state_trackers/nine/device9.c index 55948cbb67f..fce19b2630d 100644 --- a/src/gallium/state_trackers/nine/device9.c +++ b/src/gallium/state_trackers/nine/device9.c @@ -599,11 +599,11 @@ NineDevice9_SetCursorProperties( struct NineDevice9 *This, UINT YHotSpot, IDirect3DSurface9 *pCursorBitmap ) { - /* TODO: hardware cursor */ struct NineSurface9 *surf = NineSurface9(pCursorBitmap); struct pipe_context *pipe = This->pipe; struct pipe_box box; struct pipe_transfer *transfer; + BOOL hw_cursor; void *ptr; DBG_FLAG(DBG_SWAPCHAIN, "This=%p XHotSpot=%u YHotSpot=%u " @@ -613,6 +613,7 @@ NineDevice9_SetCursorProperties( struct NineDevice9 *This, This->cursor.w = MIN2(surf->desc.Width, This->cursor.image->width0); This->cursor.h = MIN2(surf->desc.Height, This->cursor.image->height0); + hw_cursor = This->cursor.w == 32 && This->cursor.h == 32; u_box_origin_2d(This->cursor.w, This->cursor.h, &box); @@ -643,16 +644,21 @@ NineDevice9_SetCursorProperties( struct NineDevice9 *This, lock.pBits, lock.Pitch, This->cursor.w, This->cursor.h); - if (!This->cursor.software && - This->cursor.w == 32 && This->cursor.h == 32) - ID3DPresent_SetCursor(This->swapchains[0]->present, - lock.pBits, &This->cursor.hotspot, - This->cursor.visible); + if (hw_cursor) + hw_cursor = ID3DPresent_SetCursor(This->swapchains[0]->present, + lock.pBits, + &This->cursor.hotspot, + This->cursor.visible) == D3D_OK; NineSurface9_UnlockRect(surf); } pipe->transfer_unmap(pipe, transfer); + /* hide cursor if we emulate it */ + if (!hw_cursor) + ID3DPresent_SetCursor(This->swapchains[0]->present, NULL, NULL, FALSE); + This->cursor.software = !hw_cursor; + return D3D_OK; } |