glamor_put_sub_pixmap: Change to use glamor_upload_sub_pixmap.
As the pixmap may be attached to a picture, we need to use glamor_upload_sub_pixmap to process it. glamor_copy_n_to_n will not consider the picture case. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
This commit is contained in:
parent
ff3d2c7963
commit
e38eb67532
|
@ -1170,6 +1170,11 @@ glamor_get_sub_pixmap(PixmapPtr pixmap, int x, int y, int w, int h, glamor_acces
|
||||||
sub_pixmap_priv = glamor_get_pixmap_private(sub_pixmap);
|
sub_pixmap_priv = glamor_get_pixmap_private(sub_pixmap);
|
||||||
pbo = sub_pixmap_priv ? (sub_pixmap_priv->fbo ? sub_pixmap_priv->fbo->pbo : 0): 0;
|
pbo = sub_pixmap_priv ? (sub_pixmap_priv->fbo ? sub_pixmap_priv->fbo->pbo : 0): 0;
|
||||||
|
|
||||||
|
if (pixmap_priv->is_picture) {
|
||||||
|
sub_pixmap_priv->pict_format = pixmap_priv->pict_format;
|
||||||
|
sub_pixmap_priv->is_picture = pixmap_priv->is_picture;
|
||||||
|
}
|
||||||
|
|
||||||
if (pbo)
|
if (pbo)
|
||||||
data = NULL;
|
data = NULL;
|
||||||
else {
|
else {
|
||||||
|
@ -1207,19 +1212,20 @@ glamor_get_sub_pixmap(PixmapPtr pixmap, int x, int y, int w, int h, glamor_acces
|
||||||
PixmapPtr
|
PixmapPtr
|
||||||
glamor_put_sub_pixmap(PixmapPtr sub_pixmap, PixmapPtr pixmap, int x, int y, int w, int h, glamor_access_t access)
|
glamor_put_sub_pixmap(PixmapPtr sub_pixmap, PixmapPtr pixmap, int x, int y, int w, int h, glamor_access_t access)
|
||||||
{
|
{
|
||||||
struct pixman_box16 box;
|
void *bits;
|
||||||
int dx, dy;
|
int pbo;
|
||||||
box.x1 = x;
|
glamor_pixmap_private *sub_pixmap_priv;
|
||||||
box.y1 = y;
|
|
||||||
box.x2 = x + w;
|
|
||||||
box.y2 = y + h;
|
|
||||||
|
|
||||||
dx = -(x);
|
sub_pixmap_priv = glamor_get_pixmap_private(sub_pixmap);
|
||||||
dy = -(y);
|
if (sub_pixmap_priv
|
||||||
|
&& sub_pixmap_priv->fbo
|
||||||
glamor_copy_n_to_n(&sub_pixmap->drawable,
|
&& sub_pixmap_priv->fbo->pbo_valid) {
|
||||||
&pixmap->drawable,
|
bits = NULL;
|
||||||
NULL, &box, 1, dx, dy,
|
pbo = sub_pixmap_priv->fbo->pbo;
|
||||||
0, 0, 0, NULL);
|
} else {
|
||||||
|
bits = sub_pixmap->devPrivate.ptr;
|
||||||
|
pbo = 0;
|
||||||
|
}
|
||||||
|
glamor_upload_sub_pixmap_to_texture(pixmap, x, y, w, h, sub_pixmap->devKind, bits, pbo);
|
||||||
glamor_destroy_pixmap(sub_pixmap);
|
glamor_destroy_pixmap(sub_pixmap);
|
||||||
}
|
}
|
||||||
|
|
|
@ -295,8 +295,11 @@ _glamor_put_image(DrawablePtr drawable, GCPtr gc, int depth, int x, int y,
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
temp_pixmap_priv = glamor_get_pixmap_private(temp_pixmap);
|
temp_pixmap_priv = glamor_get_pixmap_private(temp_pixmap);
|
||||||
temp_pixmap_priv->pict_format = pixmap_priv->pict_format;
|
|
||||||
temp_pixmap_priv->is_picture = pixmap_priv->is_picture;
|
if (pixmap_priv->is_picture) {
|
||||||
|
temp_pixmap_priv->pict_format = pixmap_priv->pict_format;
|
||||||
|
temp_pixmap_priv->is_picture = pixmap_priv->is_picture;
|
||||||
|
}
|
||||||
|
|
||||||
glamor_upload_sub_pixmap_to_texture(temp_pixmap, 0, 0, w, h,
|
glamor_upload_sub_pixmap_to_texture(temp_pixmap, 0, 0, w, h,
|
||||||
pixmap->devKind, bits, 0);
|
pixmap->devKind, bits, 0);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user