glamor: glamor_prep_pixmap_box → glamor_prep_drawable_box
Pass the DrawablePtr directly to glamor_download_boxes. This will allow for better results if the window depth doesn't match the backing pixmap depth.
This commit is contained in:
parent
ff27ffa1c1
commit
78e0bb500e
|
@ -25,19 +25,21 @@
|
||||||
#include "glamor_transfer.h"
|
#include "glamor_transfer.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Make a pixmap ready to draw with fb by
|
* Make a drawable ready to draw with fb by
|
||||||
* creating a PBO large enough for the whole object
|
* creating a PBO large enough for the whole object
|
||||||
* and downloading all of the FBOs into it.
|
* and downloading all of the FBOs into it.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
glamor_prep_pixmap_box(PixmapPtr pixmap, glamor_access_t access, BoxPtr box)
|
glamor_prep_drawable_box(DrawablePtr drawable, glamor_access_t access, BoxPtr box)
|
||||||
{
|
{
|
||||||
ScreenPtr screen = pixmap->drawable.pScreen;
|
ScreenPtr screen = drawable->pScreen;
|
||||||
glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
|
glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
|
||||||
|
PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable);
|
||||||
glamor_pixmap_private *priv = glamor_get_pixmap_private(pixmap);
|
glamor_pixmap_private *priv = glamor_get_pixmap_private(pixmap);
|
||||||
int gl_access, gl_usage;
|
int gl_access, gl_usage;
|
||||||
RegionRec region;
|
RegionRec region;
|
||||||
|
int off_x, off_y;
|
||||||
|
|
||||||
if (priv->type == GLAMOR_DRM_ONLY)
|
if (priv->type == GLAMOR_DRM_ONLY)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -47,6 +49,11 @@ glamor_prep_pixmap_box(PixmapPtr pixmap, glamor_access_t access, BoxPtr box)
|
||||||
|
|
||||||
glamor_make_current(glamor_priv);
|
glamor_make_current(glamor_priv);
|
||||||
|
|
||||||
|
glamor_get_drawable_deltas(drawable, pixmap, &off_x, &off_y);
|
||||||
|
box->x1 += off_x;
|
||||||
|
box->x2 += off_x;
|
||||||
|
box->y1 += off_y;
|
||||||
|
box->y2 += off_y;
|
||||||
RegionInit(®ion, box, 1);
|
RegionInit(®ion, box, 1);
|
||||||
|
|
||||||
/* See if it's already mapped */
|
/* See if it's already mapped */
|
||||||
|
@ -119,7 +126,7 @@ glamor_prep_pixmap_box(PixmapPtr pixmap, glamor_access_t access, BoxPtr box)
|
||||||
priv->map_access = access;
|
priv->map_access = access;
|
||||||
}
|
}
|
||||||
|
|
||||||
glamor_download_boxes(&pixmap->drawable, RegionRects(®ion), RegionNumRects(®ion),
|
glamor_download_boxes(drawable, RegionRects(®ion), RegionNumRects(®ion),
|
||||||
0, 0, 0, 0, pixmap->devPrivate.ptr, pixmap->devKind);
|
0, 0, 0, 0, pixmap->devPrivate.ptr, pixmap->devKind);
|
||||||
|
|
||||||
RegionUninit(®ion);
|
RegionUninit(®ion);
|
||||||
|
@ -185,33 +192,26 @@ glamor_finish_access(DrawablePtr drawable)
|
||||||
Bool
|
Bool
|
||||||
glamor_prepare_access(DrawablePtr drawable, glamor_access_t access)
|
glamor_prepare_access(DrawablePtr drawable, glamor_access_t access)
|
||||||
{
|
{
|
||||||
PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable);
|
|
||||||
BoxRec box;
|
BoxRec box;
|
||||||
int off_x, off_y;
|
|
||||||
|
|
||||||
glamor_get_drawable_deltas(drawable, pixmap, &off_x, &off_y);
|
box.x1 = drawable->x;
|
||||||
|
|
||||||
box.x1 = drawable->x + off_x;
|
|
||||||
box.x2 = box.x1 + drawable->width;
|
box.x2 = box.x1 + drawable->width;
|
||||||
box.y1 = drawable->y + off_y;
|
box.y1 = drawable->y;
|
||||||
box.y2 = box.y1 + drawable->height;
|
box.y2 = box.y1 + drawable->height;
|
||||||
return glamor_prep_pixmap_box(pixmap, access, &box);
|
return glamor_prep_drawable_box(drawable, access, &box);
|
||||||
}
|
}
|
||||||
|
|
||||||
Bool
|
Bool
|
||||||
glamor_prepare_access_box(DrawablePtr drawable, glamor_access_t access,
|
glamor_prepare_access_box(DrawablePtr drawable, glamor_access_t access,
|
||||||
int x, int y, int w, int h)
|
int x, int y, int w, int h)
|
||||||
{
|
{
|
||||||
PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable);
|
|
||||||
BoxRec box;
|
BoxRec box;
|
||||||
int off_x, off_y;
|
|
||||||
|
|
||||||
glamor_get_drawable_deltas(drawable, pixmap, &off_x, &off_y);
|
box.x1 = drawable->x + x;
|
||||||
box.x1 = drawable->x + x + off_x;
|
|
||||||
box.x2 = box.x1 + w;
|
box.x2 = box.x1 + w;
|
||||||
box.y1 = drawable->y + y + off_y;
|
box.y1 = drawable->y + y;
|
||||||
box.y2 = box.y1 + h;
|
box.y2 = box.y1 + h;
|
||||||
return glamor_prep_pixmap_box(pixmap, access, &box);
|
return glamor_prep_drawable_box(drawable, access, &box);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue