diff options
author | Keith Packard <keithp@keithp.com> | 2014-08-19 12:34:41 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2014-09-18 15:53:19 -0700 |
commit | 16e429f1f96f984b1ff575875a7a4d7d29b482e2 (patch) | |
tree | 78d8b511f6b4aced2476b8f4214fb48a0c6dd24e /glamor | |
parent | ea7357de90792cbceca6d8d9fdc144e7df8a0fba (diff) |
glamor: Change SET_PIXMAP_FBO_CURRENT from macro to static inline
This is the last function-like macro in glamor_priv.h; change to
static inline like all of the other functions there.
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'glamor')
-rw-r--r-- | glamor/glamor_largepixmap.c | 10 | ||||
-rw-r--r-- | glamor/glamor_pixmap.c | 2 | ||||
-rw-r--r-- | glamor/glamor_priv.h | 17 |
3 files changed, 15 insertions, 14 deletions
diff --git a/glamor/glamor_largepixmap.c b/glamor/glamor_largepixmap.c index 5a4bec571..4c82a8d41 100644 --- a/glamor/glamor_largepixmap.c +++ b/glamor/glamor_largepixmap.c @@ -970,7 +970,7 @@ _glamor_process_transformed_clipped_region(glamor_pixmap_private *priv, need_clean_fbo); } else { - SET_PIXMAP_FBO_CURRENT(priv, clipped_regions[0].block_idx); + glamor_set_pixmap_fbo_current(priv, clipped_regions[0].block_idx); if (repeat_type == RepeatReflect || repeat_type == RepeatNormal) { /* The required source areas are in one region, * we need to shift the corresponding box's coords to proper position, @@ -1140,7 +1140,7 @@ glamor_composite_largepixmap_region(CARD8 op, DEBUGF("dest region %d idx %d\n", i, clipped_dest_regions[i].block_idx); DEBUGRegionPrint(clipped_dest_regions[i].region); - SET_PIXMAP_FBO_CURRENT(dest_pixmap_priv, + glamor_set_pixmap_fbo_current(dest_pixmap_priv, clipped_dest_regions[i].block_idx); if (source_pixmap_priv && source_pixmap_priv->type == GLAMOR_TEXTURE_LARGE) { @@ -1180,7 +1180,7 @@ glamor_composite_largepixmap_region(CARD8 op, DEBUGF("source clipped result %d region: \n", n_source_regions); for (j = 0; j < n_source_regions; j++) { if (is_normal_source_fbo) - SET_PIXMAP_FBO_CURRENT(source_pixmap_priv, + glamor_set_pixmap_fbo_current(source_pixmap_priv, clipped_source_regions[j].block_idx); if (mask_pixmap_priv && @@ -1267,7 +1267,7 @@ glamor_composite_largepixmap_region(CARD8 op, clipped_mask_regions[k].block_idx); DEBUGRegionPrint(clipped_mask_regions[k].region); if (is_normal_mask_fbo) { - SET_PIXMAP_FBO_CURRENT(mask_pixmap_priv, + glamor_set_pixmap_fbo_current(mask_pixmap_priv, clipped_mask_regions[k]. block_idx); DEBUGF("mask fbo off %d %d \n", @@ -1378,7 +1378,7 @@ glamor_composite_largepixmap_region(CARD8 op, clipped_mask_regions[k].block_idx); DEBUGRegionPrint(clipped_mask_regions[k].region); if (is_normal_mask_fbo) { - SET_PIXMAP_FBO_CURRENT(mask_pixmap_priv, + glamor_set_pixmap_fbo_current(mask_pixmap_priv, clipped_mask_regions[k]. block_idx); RegionTranslate(clipped_mask_regions[k].region, diff --git a/glamor/glamor_pixmap.c b/glamor/glamor_pixmap.c index ccb49f3c6..11e9ebb00 100644 --- a/glamor/glamor_pixmap.c +++ b/glamor/glamor_pixmap.c @@ -985,7 +985,7 @@ glamor_upload_sub_pixmap_to_texture(PixmapPtr pixmap, int x, int y, int w, assert(pbo == 0); - SET_PIXMAP_FBO_CURRENT(pixmap_priv, clipped_regions[i].block_idx); + glamor_set_pixmap_fbo_current(pixmap_priv, clipped_regions[i].block_idx); boxes = RegionRects(clipped_regions[i].region); nbox = RegionNumRects(clipped_regions[i].region); diff --git a/glamor/glamor_priv.h b/glamor/glamor_priv.h index aa59e3bcd..51adeefaa 100644 --- a/glamor/glamor_priv.h +++ b/glamor/glamor_priv.h @@ -438,14 +438,6 @@ typedef struct glamor_pixmap_clipped_regions { RegionPtr region; } glamor_pixmap_clipped_regions; -#define SET_PIXMAP_FBO_CURRENT(priv, idx) \ - do { \ - if (priv->type == GLAMOR_TEXTURE_LARGE) { \ - (priv)->large.base.fbo = priv->large.fbo_array[idx]; \ - (priv)->large.box = priv->large.box_array[idx]; \ - } \ - } while(0) - typedef struct glamor_pixmap_private_base { glamor_pixmap_type_t type; enum glamor_fbo_state gl_fbo; @@ -518,6 +510,15 @@ typedef struct glamor_pixmap_private { }; } glamor_pixmap_private; +static inline void +glamor_set_pixmap_fbo_current(glamor_pixmap_private *priv, int idx) +{ + if (priv->type == GLAMOR_TEXTURE_LARGE) { + priv->large.base.fbo = priv->large.fbo_array[idx]; + priv->large.box = priv->large.box_array[idx]; + } +} + static inline glamor_pixmap_fbo * glamor_pixmap_fbo_at(glamor_pixmap_private *priv, int x, int y) { |