Reduce the double check of pixmap's private pointer.
As we now add the checking to the Macro, we don't need to check the pointer outside the Macro. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
This commit is contained in:
parent
e1789893e5
commit
a65e1c736a
|
@ -317,7 +317,7 @@ _glamor_copy_n_to_n(DrawablePtr src,
|
||||||
src_pixmap_priv = glamor_get_pixmap_private(src_pixmap);
|
src_pixmap_priv = glamor_get_pixmap_private(src_pixmap);
|
||||||
screen = dst_pixmap->drawable.pScreen;
|
screen = dst_pixmap->drawable.pScreen;
|
||||||
|
|
||||||
if (!dst_pixmap_priv || !GLAMOR_PIXMAP_PRIV_HAS_FBO(dst_pixmap_priv)) {
|
if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(dst_pixmap_priv)) {
|
||||||
glamor_fallback("dest pixmap %p has no fbo. \n",
|
glamor_fallback("dest pixmap %p has no fbo. \n",
|
||||||
dst_pixmap);
|
dst_pixmap);
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
|
@ -264,7 +264,7 @@ glamor_finish_access(DrawablePtr drawable, glamor_access_t access_mode)
|
||||||
glamor_get_screen_private(drawable->pScreen);
|
glamor_get_screen_private(drawable->pScreen);
|
||||||
glamor_gl_dispatch *dispatch = &glamor_priv->dispatch;
|
glamor_gl_dispatch *dispatch = &glamor_priv->dispatch;
|
||||||
|
|
||||||
if (!pixmap_priv || !GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv))
|
if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (access_mode != GLAMOR_ACCESS_RO) {
|
if (access_mode != GLAMOR_ACCESS_RO) {
|
||||||
|
|
|
@ -149,7 +149,7 @@ glamor_solid(PixmapPtr pixmap, int x, int y, int width, int height,
|
||||||
GLfloat color[4];
|
GLfloat color[4];
|
||||||
float vertices[8];
|
float vertices[8];
|
||||||
GLfloat xscale, yscale;
|
GLfloat xscale, yscale;
|
||||||
if (!pixmap_priv || !GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) {
|
if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) {
|
||||||
glamor_fallback("dest %p has no fbo.\n", pixmap);
|
glamor_fallback("dest %p has no fbo.\n", pixmap);
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,7 @@ _glamor_get_spans(DrawablePtr drawable,
|
||||||
uint8_t *readpixels_dst = (uint8_t *) dst;
|
uint8_t *readpixels_dst = (uint8_t *) dst;
|
||||||
int x_off, y_off;
|
int x_off, y_off;
|
||||||
|
|
||||||
if (!pixmap_priv || !GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) {
|
if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) {
|
||||||
glamor_fallback("pixmap has no fbo.\n");
|
glamor_fallback("pixmap has no fbo.\n");
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
|
@ -646,7 +646,7 @@ glamor_download_pixmap_to_cpu(PixmapPtr pixmap, glamor_access_t access)
|
||||||
glamor_gl_dispatch *dispatch = &glamor_priv->dispatch;
|
glamor_gl_dispatch *dispatch = &glamor_priv->dispatch;
|
||||||
|
|
||||||
screen = pixmap->drawable.pScreen;
|
screen = pixmap->drawable.pScreen;
|
||||||
if (!pixmap_priv || !GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv))
|
if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
if (glamor_get_tex_format_type_from_pixmap(pixmap,
|
if (glamor_get_tex_format_type_from_pixmap(pixmap,
|
||||||
&format,
|
&format,
|
||||||
|
|
|
@ -265,7 +265,7 @@ _glamor_put_image(DrawablePtr drawable, GCPtr gc, int depth, int x, int y,
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!pixmap_priv || !GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) {
|
if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) {
|
||||||
glamor_fallback("has no fbo.\n");
|
glamor_fallback("has no fbo.\n");
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
|
@ -754,7 +754,7 @@ glamor_composite_with_shader(CARD8 op,
|
||||||
GLfloat source_solid_color[4], mask_solid_color[4];
|
GLfloat source_solid_color[4], mask_solid_color[4];
|
||||||
dest_pixmap_priv = glamor_get_pixmap_private(dest_pixmap);
|
dest_pixmap_priv = glamor_get_pixmap_private(dest_pixmap);
|
||||||
|
|
||||||
if (!dest_pixmap_priv || !GLAMOR_PIXMAP_PRIV_HAS_FBO(dest_pixmap_priv)) {
|
if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(dest_pixmap_priv)) {
|
||||||
glamor_fallback("dest has no fbo.\n");
|
glamor_fallback("dest has no fbo.\n");
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
@ -1220,7 +1220,7 @@ _glamor_composite(CARD8 op,
|
||||||
|
|
||||||
dest_pixmap_priv = glamor_get_pixmap_private(dest_pixmap);
|
dest_pixmap_priv = glamor_get_pixmap_private(dest_pixmap);
|
||||||
/* Currently. Always fallback to cpu if destination is in CPU memory. */
|
/* Currently. Always fallback to cpu if destination is in CPU memory. */
|
||||||
if (!dest_pixmap_priv || !GLAMOR_PIXMAP_PRIV_HAS_FBO(dest_pixmap_priv)) {
|
if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(dest_pixmap_priv)) {
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue