diff --git a/src/backends/native/meta-cursor-renderer-native.c b/src/backends/native/meta-cursor-renderer-native.c index b400a8740..cda4262d3 100644 --- a/src/backends/native/meta-cursor-renderer-native.c +++ b/src/backends/native/meta-cursor-renderer-native.c @@ -1393,6 +1393,26 @@ realize_cursor_sprite_from_wl_buffer_for_gpu (MetaCursorRenderer *renderer, MetaMonitorTransform relative_transform; uint32_t gbm_format; + if (!get_common_crtc_sprite_scale_for_logical_monitors (renderer, + cursor_sprite, + &relative_scale)) + { + unset_can_preprocess (cursor_sprite); + return; + } + + if (!get_common_crtc_sprite_transform_for_logical_monitors (renderer, + cursor_sprite, + &relative_transform)) + { + unset_can_preprocess (cursor_sprite); + return; + } + + set_can_preprocess (cursor_sprite, + relative_scale, + relative_transform); + wl_shm_buffer_begin_access (shm_buffer); buffer_data = wl_shm_buffer_get_data (shm_buffer); @@ -1412,18 +1432,6 @@ realize_cursor_sprite_from_wl_buffer_for_gpu (MetaCursorRenderer *renderer, gbm_format = GBM_FORMAT_ARGB8888; } - get_common_crtc_sprite_scale_for_logical_monitors (renderer, - cursor_sprite, - &relative_scale); - - get_common_crtc_sprite_transform_for_logical_monitors (renderer, - cursor_sprite, - &relative_transform); - - set_can_preprocess (cursor_sprite, - relative_scale, - relative_transform); - load_scaled_and_transformed_cursor_sprite (native, gpu_kms, cursor_sprite, @@ -1502,20 +1510,28 @@ realize_cursor_sprite_from_xcursor_for_gpu (MetaCursorRenderer *renderer, is_cursor_scale_and_transform_valid (renderer, cursor_sprite)) return; - xc_image = meta_cursor_sprite_xcursor_get_current_image (sprite_xcursor); + if (!get_common_crtc_sprite_scale_for_logical_monitors (renderer, + cursor_sprite, + &relative_scale)) + { + unset_can_preprocess (cursor_sprite); + return; + } - get_common_crtc_sprite_scale_for_logical_monitors (renderer, - cursor_sprite, - &relative_scale); - - get_common_crtc_sprite_transform_for_logical_monitors (renderer, - cursor_sprite, - &relative_transform); + if (!get_common_crtc_sprite_transform_for_logical_monitors (renderer, + cursor_sprite, + &relative_transform)) + { + unset_can_preprocess (cursor_sprite); + return; + } set_can_preprocess (cursor_sprite, relative_scale, relative_transform); + xc_image = meta_cursor_sprite_xcursor_get_current_image (sprite_xcursor); + load_scaled_and_transformed_cursor_sprite (native, gpu_kms, cursor_sprite,