Commit 057f52a0 authored by Zhigang Gong's avatar Zhigang Gong Committed by Eric Anholt

Track all picture's drawable pict format.

Even if a picture's pixmap is a pure in memory pixmap, we still need
to track its format. The reason is we may need to upload this drawable
to texture thus we need to know its real picture format.

As to the MACRO to check whether a pixmap is a picture, we should
check whether the priv is non-NULL before we touch its field.
Signed-off-by: default avatarZhigang Gong <zhigang.gong@linux.intel.com>
parent 8a4758a3
......@@ -58,6 +58,14 @@ glamor_create_picture(PicturePtr picture)
glamor_get_screen_private(picture->pDrawable->pScreen);
pixmap = glamor_get_drawable_pixmap(picture->pDrawable);
pixmap_priv = glamor_get_pixmap_private(pixmap);
if (!pixmap_priv) {
/* We must create a pixmap priv to track the picture format even
* if the pixmap is a pure in memory pixmap. The reason is that
* we may need to upload this pixmap to a texture on the fly. During
* the uploading, we need to know the picture format. */
glamor_set_pixmap_type(pixmap, GLAMOR_MEMORY);
pixmap_priv = glamor_get_pixmap_private(pixmap);
}
if (pixmap_priv) {
pixmap_priv->is_picture = 1;
......
......@@ -175,7 +175,7 @@ glamor_transform_boxes(BoxPtr boxes, int nbox, int dx, int dy)
|| _depth_ == 32)
#define GLAMOR_PIXMAP_PRIV_IS_PICTURE(pixmap_priv) (pixmap_priv->is_picture == 1)
#define GLAMOR_PIXMAP_PRIV_IS_PICTURE(pixmap_priv) (pixmap_priv && pixmap_priv->is_picture == 1)
#define GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv) (pixmap_priv && pixmap_priv->gl_fbo == 1)
#define GLAMOR_PIXMAP_PRIV_NEED_VALIDATE(pixmap_priv) \
......
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