diff options
author | Zhigang Gong <zhigang.gong@linux.intel.com> | 2012-04-15 19:43:44 +0800 |
---|---|---|
committer | Zhigang Gong <zhigang.gong@linux.intel.com> | 2012-04-27 15:53:37 +0800 |
commit | 6d25a3b8233867df22b01c4dbc9a6d97a477e4a2 (patch) | |
tree | f21c85efa1a187e16ebbc90effe6f578863d0bc9 | |
parent | e51a23d3d21b524979e4de5690042e36560e72ca (diff) |
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>
-rw-r--r-- | src/glamor_pixmap.c | 34 | ||||
-rw-r--r-- | src/glamor_putimage.c | 7 |
2 files changed, 25 insertions, 16 deletions
diff --git a/src/glamor_pixmap.c b/src/glamor_pixmap.c index db1b163..e9e42c5 100644 --- a/src/glamor_pixmap.c +++ b/src/glamor_pixmap.c @@ -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); 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) data = NULL; else { @@ -1207,19 +1212,20 @@ glamor_get_sub_pixmap(PixmapPtr pixmap, int x, int y, int w, int h, glamor_acces PixmapPtr 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; - int dx, dy; - box.x1 = x; - box.y1 = y; - box.x2 = x + w; - box.y2 = y + h; - - dx = -(x); - dy = -(y); - - glamor_copy_n_to_n(&sub_pixmap->drawable, - &pixmap->drawable, - NULL, &box, 1, dx, dy, - 0, 0, 0, NULL); + void *bits; + int pbo; + glamor_pixmap_private *sub_pixmap_priv; + + sub_pixmap_priv = glamor_get_pixmap_private(sub_pixmap); + if (sub_pixmap_priv + && sub_pixmap_priv->fbo + && sub_pixmap_priv->fbo->pbo_valid) { + bits = NULL; + pbo = sub_pixmap_priv->fbo->pbo; + } 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); } diff --git a/src/glamor_putimage.c b/src/glamor_putimage.c index 45c8550..cf8bf99 100644 --- a/src/glamor_putimage.c +++ b/src/glamor_putimage.c @@ -295,8 +295,11 @@ _glamor_put_image(DrawablePtr drawable, GCPtr gc, int depth, int x, int y, goto fail; 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, pixmap->devKind, bits, 0); |