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>
This commit is contained in:
Keith Packard 2014-08-19 12:34:41 -07:00
parent ea7357de90
commit 16e429f1f9
3 changed files with 15 additions and 14 deletions

View File

@ -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,

View File

@ -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);

View File

@ -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)
{