1
0
Fork 0

cursor: Do less work if we don't have a connection to GBM at all

This commit is contained in:
Jasper St. Pierre 2014-03-31 17:59:14 -04:00
parent 59e064f610
commit f6a73bcf22

View file

@ -314,6 +314,8 @@ meta_cursor_image_load_from_buffer (MetaCursorTracker *tracker,
shm_buffer = wl_shm_buffer_get (buffer); shm_buffer = wl_shm_buffer_get (buffer);
if (shm_buffer) if (shm_buffer)
{
if (tracker->gbm)
{ {
int rowstride = wl_shm_buffer_get_stride (shm_buffer); int rowstride = wl_shm_buffer_get_stride (shm_buffer);
@ -339,13 +341,13 @@ meta_cursor_image_load_from_buffer (MetaCursorTracker *tracker,
gbm_format = GBM_FORMAT_ARGB8888; gbm_format = GBM_FORMAT_ARGB8888;
} }
if (tracker->gbm)
meta_cursor_image_load_gbm_buffer (tracker->gbm, meta_cursor_image_load_gbm_buffer (tracker->gbm,
image, image,
(uint8_t *) wl_shm_buffer_get_data (shm_buffer), (uint8_t *) wl_shm_buffer_get_data (shm_buffer),
width, height, rowstride, width, height, rowstride,
gbm_format); gbm_format);
} }
}
else else
{ {
/* HW cursors must be 64x64, but 64x64 is huge, and no cursor theme actually uses /* HW cursors must be 64x64, but 64x64 is huge, and no cursor theme actually uses