Commit e1789893 authored by Zhigang Gong's avatar Zhigang Gong Committed by Eric Anholt

get_spans: Check whether have a valid fbo before check format.

If a pixmap is a pure in-memory pixmap, we do not need to
check its format. Format checking has more overhead than
checking FBO, so we change to check fbo firtly.
Signed-off-by: default avatarZhigang Gong <zhigang.gong@linux.intel.com>
parent 057f52a0
......@@ -37,6 +37,7 @@ _glamor_set_spans(DrawablePtr drawable, GCPtr gc, char *src,
Bool fallback)
{
PixmapPtr dest_pixmap = glamor_get_drawable_pixmap(drawable);
glamor_pixmap_private *dest_pixmap_priv;
glamor_screen_private *glamor_priv =
glamor_get_screen_private(drawable->pScreen);
glamor_gl_dispatch *dispatch = &glamor_priv->dispatch;
......@@ -47,6 +48,12 @@ _glamor_set_spans(DrawablePtr drawable, GCPtr gc, char *src,
BoxRec *pbox;
int x_off, y_off;
dest_pixmap_priv = glamor_get_pixmap_private(dest_pixmap);
if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(dest_pixmap_priv)) {
glamor_fallback("pixmap has no fbo.\n");
goto fail;
}
if (glamor_priv->gl_flavor == GLAMOR_GL_ES2) {
glamor_fallback("ES2 fallback.\n");
goto fail;
......@@ -61,9 +68,7 @@ _glamor_set_spans(DrawablePtr drawable, GCPtr gc, char *src,
}
if (glamor_set_destination_pixmap(dest_pixmap))
goto fail;
glamor_set_destination_pixmap_priv_nc(dest_pixmap_priv);
glamor_validate_pixmap(dest_pixmap);
if (!glamor_set_planemask(dest_pixmap, gc->planemask))
goto fail;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment