glamor: Make glamor_solid_boxes take a DrawablePtr
Instead of a PixmapPtr. Gives better results if the window depth doesn't match the backing pixmap depth. Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1565
This commit is contained in:
parent
2de50de563
commit
d4e11f4c92
|
@ -227,12 +227,10 @@ glamor_composite_rectangles(CARD8 op,
|
||||||
boxes = pixman_region_rectangles(®ion, &num_boxes);
|
boxes = pixman_region_rectangles(®ion, &num_boxes);
|
||||||
if (op == PictOpSrc || op == PictOpClear) {
|
if (op == PictOpSrc || op == PictOpClear) {
|
||||||
CARD32 pixel;
|
CARD32 pixel;
|
||||||
int dst_x, dst_y;
|
|
||||||
|
|
||||||
glamor_get_drawable_deltas(dst->pDrawable, pixmap, &dst_x, &dst_y);
|
pixman_region_translate(®ion, -dst->pDrawable->x, -dst->pDrawable->y);
|
||||||
pixman_region_translate(®ion, dst_x, dst_y);
|
|
||||||
|
|
||||||
DEBUGF("%s: pixmap +(%d, %d) extents (%d, %d),(%d, %d)\n",
|
DEBUGF("%s: drawable extents (%d, %d),(%d, %d)\n",
|
||||||
__FUNCTION__, dst_x, dst_y,
|
__FUNCTION__, dst_x, dst_y,
|
||||||
RegionExtents(®ion)->x1, RegionExtents(®ion)->y1,
|
RegionExtents(®ion)->x1, RegionExtents(®ion)->y1,
|
||||||
RegionExtents(®ion)->x2, RegionExtents(®ion)->y2);
|
RegionExtents(®ion)->x2, RegionExtents(®ion)->y2);
|
||||||
|
@ -241,7 +239,7 @@ glamor_composite_rectangles(CARD8 op,
|
||||||
pixel = 0;
|
pixel = 0;
|
||||||
else
|
else
|
||||||
miRenderColorToPixel(dst->pFormat, color, &pixel);
|
miRenderColorToPixel(dst->pFormat, color, &pixel);
|
||||||
glamor_solid_boxes(pixmap, boxes, num_boxes, pixel);
|
glamor_solid_boxes(dst->pDrawable, boxes, num_boxes, pixel);
|
||||||
|
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
|
@ -895,7 +895,7 @@ glamor_solid(PixmapPtr pixmap, int x, int y, int width, int height,
|
||||||
unsigned long fg_pixel);
|
unsigned long fg_pixel);
|
||||||
|
|
||||||
void
|
void
|
||||||
glamor_solid_boxes(PixmapPtr pixmap,
|
glamor_solid_boxes(DrawablePtr drawable,
|
||||||
BoxPtr box, int nbox, unsigned long fg_pixel);
|
BoxPtr box, int nbox, unsigned long fg_pixel);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -432,7 +432,6 @@ glamor_image_text(DrawablePtr drawable, GCPtr gc,
|
||||||
int c;
|
int c;
|
||||||
RegionRec region;
|
RegionRec region;
|
||||||
BoxRec box;
|
BoxRec box;
|
||||||
int off_x, off_y;
|
|
||||||
|
|
||||||
/* Check planemask before drawing background to
|
/* Check planemask before drawing background to
|
||||||
* bail early if it's not OK
|
* bail early if it's not OK
|
||||||
|
@ -443,8 +442,6 @@ glamor_image_text(DrawablePtr drawable, GCPtr gc,
|
||||||
if (charinfo[c])
|
if (charinfo[c])
|
||||||
width += charinfo[c]->metrics.characterWidth;
|
width += charinfo[c]->metrics.characterWidth;
|
||||||
|
|
||||||
glamor_get_drawable_deltas(drawable, pixmap, &off_x, &off_y);
|
|
||||||
|
|
||||||
if (width >= 0) {
|
if (width >= 0) {
|
||||||
box.x1 = drawable->x + x;
|
box.x1 = drawable->x + x;
|
||||||
box.x2 = drawable->x + x + width;
|
box.x2 = drawable->x + x + width;
|
||||||
|
@ -456,8 +453,8 @@ glamor_image_text(DrawablePtr drawable, GCPtr gc,
|
||||||
box.y2 = drawable->y + y + gc->font->info.fontDescent;
|
box.y2 = drawable->y + y + gc->font->info.fontDescent;
|
||||||
RegionInit(®ion, &box, 1);
|
RegionInit(®ion, &box, 1);
|
||||||
RegionIntersect(®ion, ®ion, gc->pCompositeClip);
|
RegionIntersect(®ion, ®ion, gc->pCompositeClip);
|
||||||
RegionTranslate(®ion, off_x, off_y);
|
RegionTranslate(®ion, -drawable->x, -drawable->y);
|
||||||
glamor_solid_boxes(pixmap, RegionRects(®ion), RegionNumRects(®ion), gc->bgPixel);
|
glamor_solid_boxes(drawable, RegionRects(®ion), RegionNumRects(®ion), gc->bgPixel);
|
||||||
RegionUninit(®ion);
|
RegionUninit(®ion);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,10 +23,9 @@
|
||||||
#include "glamor_priv.h"
|
#include "glamor_priv.h"
|
||||||
|
|
||||||
void
|
void
|
||||||
glamor_solid_boxes(PixmapPtr pixmap,
|
glamor_solid_boxes(DrawablePtr drawable,
|
||||||
BoxPtr box, int nbox, unsigned long fg_pixel)
|
BoxPtr box, int nbox, unsigned long fg_pixel)
|
||||||
{
|
{
|
||||||
DrawablePtr drawable = &pixmap->drawable;
|
|
||||||
GCPtr gc;
|
GCPtr gc;
|
||||||
xRectangle *rect;
|
xRectangle *rect;
|
||||||
int n;
|
int n;
|
||||||
|
|
Loading…
Reference in New Issue