Call glamor_create_pixmap directly in glamor rendering path.

When glamor is rendering pixmaps, and needs to create some
temporary pixmap, it's better to use glamor version create
pixmap directly. As if goes to external DDX's create pixmap,
it may create a external DRM buffer which is not necessary.
All the case within glamor scope is to create a texture only
pixmap or a in memory pixmap.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
This commit is contained in:
Zhigang Gong 2011-12-12 06:56:36 +08:00 • committed by Eric Anholt
commit 36d424feae
8 changed files with 41 additions and 42 deletions

View file

@ -360,13 +360,13 @@ _glamor_copy_n_to_n(DrawablePtr src,
src_pixmap->drawable.width *
src_pixmap->drawable.height))) {
temp_pixmap = (*screen->CreatePixmap) (screen,
bound.x2 - bound.x1,
bound.y2 - bound.y1,
src_pixmap->
drawable.depth,
overlaped ? 0 :
GLAMOR_CREATE_PIXMAP_CPU);
temp_pixmap = glamor_create_pixmap(screen,
bound.x2 - bound.x1,
bound.y2 - bound.y1,
src_pixmap->
drawable.depth,
overlaped ? 0 :
GLAMOR_CREATE_PIXMAP_CPU);
if (!temp_pixmap)
goto fail;
glamor_transform_boxes(box, nbox, -bound.x1, -bound.y1);
@ -430,9 +430,8 @@ _glamor_copy_n_to_n(DrawablePtr src,
done:
glamor_clear_delayed_fallbacks(src->pScreen);
glamor_clear_delayed_fallbacks(dst->pScreen);
if (temp_src != src) {
(*screen->DestroyPixmap) (temp_pixmap);
}
if (temp_src != src)
glamor_destroy_pixmap(temp_pixmap);
return ret;
}