[mutter] cursor: Clean up code flow slightly
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] cursor: Clean up code flow slightly
- Date: Wed, 15 Oct 2014 17:41:21 +0000 (UTC)
commit 60ab11ecbfa0d30f7a750af48782b48c686375f1
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Wed Oct 15 10:36:42 2014 -0700
cursor: Clean up code flow slightly
Reverse the set of expressions so testing for gbm is at the top.
src/backends/meta-cursor.c | 12 ++++--------
1 files changed, 4 insertions(+), 8 deletions(-)
---
diff --git a/src/backends/meta-cursor.c b/src/backends/meta-cursor.c
index 3695d81..8e6738b 100644
--- a/src/backends/meta-cursor.c
+++ b/src/backends/meta-cursor.c
@@ -281,7 +281,6 @@ meta_cursor_image_load_from_buffer (MetaCursorImage *image,
ClutterBackend *backend;
CoglContext *cogl_context;
- struct wl_shm_buffer *shm_buffer;
uint32_t gbm_format;
uint64_t cursor_width, cursor_height;
uint width, height;
@@ -297,10 +296,10 @@ meta_cursor_image_load_from_buffer (MetaCursorImage *image,
width = cogl_texture_get_width (COGL_TEXTURE (image->texture));
height = cogl_texture_get_height (COGL_TEXTURE (image->texture));
- shm_buffer = wl_shm_buffer_get (buffer);
- if (shm_buffer)
+ if (gbm)
{
- if (gbm)
+ struct wl_shm_buffer *shm_buffer = wl_shm_buffer_get (buffer);
+ if (shm_buffer)
{
int rowstride = wl_shm_buffer_get_stride (shm_buffer);
@@ -332,10 +331,7 @@ meta_cursor_image_load_from_buffer (MetaCursorImage *image,
width, height, rowstride,
gbm_format);
}
- }
- else
- {
- if (gbm)
+ else
{
/* HW cursors have a predefined size (at least 64x64), which usually is bigger than cursor theme
size, so themed cursors must be padded with transparent pixels to fill the
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]