glamor: Simplify some temp pixmap extents calculations.
Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
parent
bfb6a290af
commit
47b868492c
|
@ -755,7 +755,6 @@ glamor_merge_clipped_regions(PixmapPtr pixmap,
|
||||||
glamor_pixmap_clipped_regions *clipped_regions,
|
glamor_pixmap_clipped_regions *clipped_regions,
|
||||||
int *n_regions, int *need_clean_fbo)
|
int *n_regions, int *need_clean_fbo)
|
||||||
{
|
{
|
||||||
BoxPtr temp_extent;
|
|
||||||
BoxRec temp_box, copy_box;
|
BoxRec temp_box, copy_box;
|
||||||
RegionPtr temp_region;
|
RegionPtr temp_region;
|
||||||
glamor_pixmap_private *temp_priv;
|
glamor_pixmap_private *temp_priv;
|
||||||
|
@ -779,9 +778,8 @@ glamor_merge_clipped_regions(PixmapPtr pixmap,
|
||||||
RegionValidate(temp_region, &overlap);
|
RegionValidate(temp_region, &overlap);
|
||||||
DEBUGF("temp region: \n");
|
DEBUGF("temp region: \n");
|
||||||
DEBUGRegionPrint(temp_region);
|
DEBUGRegionPrint(temp_region);
|
||||||
temp_extent = RegionExtents(temp_region);
|
|
||||||
|
|
||||||
temp_box = *temp_extent;
|
temp_box = *RegionExtents(temp_region);
|
||||||
|
|
||||||
DEBUGF("need copy region: \n");
|
DEBUGF("need copy region: \n");
|
||||||
DEBUGF("%d %d %d %d \n", temp_box.x1, temp_box.y1, temp_box.x2,
|
DEBUGF("%d %d %d %d \n", temp_box.x1, temp_box.y1, temp_box.x2,
|
||||||
|
@ -801,16 +799,16 @@ glamor_merge_clipped_regions(PixmapPtr pixmap,
|
||||||
assert(glamor_pixmap_priv_is_small(temp_priv));
|
assert(glamor_pixmap_priv_is_small(temp_priv));
|
||||||
|
|
||||||
priv->box = temp_box;
|
priv->box = temp_box;
|
||||||
if (temp_extent->x1 >= 0 && temp_extent->x2 <= pixmap_width
|
if (temp_box.x1 >= 0 && temp_box.x2 <= pixmap_width
|
||||||
&& temp_extent->y1 >= 0 && temp_extent->y2 <= pixmap_height) {
|
&& temp_box.y1 >= 0 && temp_box.y2 <= pixmap_height) {
|
||||||
int dx, dy;
|
int dx, dy;
|
||||||
|
|
||||||
copy_box.x1 = 0;
|
copy_box.x1 = 0;
|
||||||
copy_box.y1 = 0;
|
copy_box.y1 = 0;
|
||||||
copy_box.x2 = temp_extent->x2 - temp_extent->x1;
|
copy_box.x2 = temp_box.x2 - temp_box.x1;
|
||||||
copy_box.y2 = temp_extent->y2 - temp_extent->y1;
|
copy_box.y2 = temp_box.y2 - temp_box.y1;
|
||||||
dx = temp_extent->x1;
|
dx = temp_box.x1;
|
||||||
dy = temp_extent->y1;
|
dy = temp_box.y1;
|
||||||
glamor_copy(&pixmap->drawable,
|
glamor_copy(&pixmap->drawable,
|
||||||
&temp_pixmap->drawable,
|
&temp_pixmap->drawable,
|
||||||
NULL, ©_box, 1, dx, dy, 0, 0, 0, NULL);
|
NULL, ©_box, 1, dx, dy, 0, 0, 0, NULL);
|
||||||
|
|
Loading…
Reference in New Issue