summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSøren Sandmann <ssp@redhat.com>2010-06-22 00:12:27 -0400
committerSøren Sandmann Pedersen <ssp@redhat.com>2011-01-26 08:08:33 -0500
commit8f05e9149da590f4374557e8a41e8b9e35fa007f (patch)
tree7759df564df9b713e48e426086252dd64aa197de
parent1f9bf097d5e983afbc38b60dc44e9386c8e226e7 (diff)
Make the fetched regions much tighter for core text
-rw-r--r--src/qxl_driver.c42
-rw-r--r--src/uxa/uxa-damage.c3
-rw-r--r--src/uxa/uxa-unaccel.c17
3 files changed, 38 insertions, 24 deletions
diff --git a/src/qxl_driver.c b/src/qxl_driver.c
index 0394588..18af0e6 100644
--- a/src/qxl_driver.c
+++ b/src/qxl_driver.c
@@ -518,24 +518,6 @@ submit_copy (qxl_screen_t *qxl, const struct qxl_rect *rect)
}
static void
-print_region (const char *header, RegionPtr pRegion)
-{
- int nbox = REGION_NUM_RECTS (pRegion);
- BoxPtr pbox = REGION_RECTS (pRegion);
-
- ErrorF ("%s \n", header);
-
- while (nbox--)
- {
- ErrorF (" %d %d %d %d (size: %d %d)\n",
- pbox->x1, pbox->y1, pbox->x2, pbox->y2,
- pbox->x2 - pbox->x1, pbox->y2 - pbox->y1);
-
- pbox++;
- }
-}
-
-static void
paint_shadow (qxl_screen_t *qxl)
{
struct qxl_rect qrect;
@@ -877,6 +859,24 @@ download_box (qxl_screen_t *qxl, uint8_t *host,
}
}
+static void
+print_region (const char *header, RegionPtr pRegion)
+{
+ int nbox = REGION_NUM_RECTS (pRegion);
+ BoxPtr pbox = REGION_RECTS (pRegion);
+
+ ErrorF ("%s \n", header);
+
+ while (nbox--)
+ {
+ ErrorF (" %d %d %d %d (size: %d %d)\n",
+ pbox->x1, pbox->y1, pbox->x2, pbox->y2,
+ pbox->x2 - pbox->x1, pbox->y2 - pbox->y1);
+
+ pbox++;
+ }
+}
+
static Bool
qxl_prepare_access(PixmapPtr pixmap, RegionPtr region, uxa_access_t access)
{
@@ -934,11 +934,10 @@ qxl_finish_access (PixmapPtr pixmap)
int w = pixmap->drawable.width;
int h = pixmap->drawable.height;
int stride = pixmap->devKind;
- struct qxl_rect rect;
int n_boxes;
BoxPtr boxes;
- ErrorF ("Finishing access to %p (stride: %d)\n", pixmap, stride);
+ print_region ("Finishing access", &qxl->u.access_region);
n_boxes = REGION_NUM_RECTS (&qxl->u.access_region);
boxes = REGION_RECTS (&qxl->u.access_region);
@@ -961,9 +960,12 @@ qxl_finish_access (PixmapPtr pixmap)
/* Paint a green flash before uploading */
submit_fill (qxl, &rect, 0xff00ff00);
+
+ usleep (50000);
drawable = make_drawable (qxl, QXL_DRAW_COPY, &rect);
drawable->u.copy.src_area = rect;
+ translate_rect (&drawable->u.copy.src_area);
drawable->u.copy.rop_descriptor = ROPD_OP_PUT;
drawable->u.copy.scale_mode = 0;
drawable->u.copy.mask.flags = 0;
diff --git a/src/uxa/uxa-damage.c b/src/uxa/uxa-damage.c
index 8b4794a..63ad0ea 100644
--- a/src/uxa/uxa-damage.c
+++ b/src/uxa/uxa-damage.c
@@ -91,7 +91,6 @@ trim_region (RegionPtr pRegion,
DrawablePtr pDrawable,
int subWindowMode)
{
- RegionPtr pDamageRegion;
RegionRec pixClip;
int draw_x, draw_y;
#ifdef COMPOSITE
@@ -153,7 +152,7 @@ trim_region (RegionPtr pRegion,
box.y2 = draw_y + pDrawable->height;
REGION_INIT(pScreen, &pixClip, &box, 1);
- REGION_INTERSECT (pScreen, pDamageRegion, pRegion, &pixClip);
+ REGION_INTERSECT (pScreen, pRegion, pRegion, &pixClip);
REGION_UNINIT(pScreen, &pixClip);
}
diff --git a/src/uxa/uxa-unaccel.c b/src/uxa/uxa-unaccel.c
index df5fbed..f980e94 100644
--- a/src/uxa/uxa-unaccel.c
+++ b/src/uxa/uxa-unaccel.c
@@ -22,6 +22,7 @@
*/
#include "uxa-priv.h"
+#include "uxa-damage.h"
#ifdef RENDER
#include "mipict.h"
@@ -278,10 +279,14 @@ uxa_check_image_glyph_blt(DrawablePtr pDrawable, GCPtr pGC,
CharInfoPtr * ppci, pointer pglyphBase)
{
ScreenPtr screen = pDrawable->pScreen;
+ RegionRec region;
+
+ REGION_INIT (screen, &region, (BoxPtr)NULL, 0);
+ uxa_damage_image_glyph_blt (&region, pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
UXA_FALLBACK(("to %p (%c)\n", pDrawable,
uxa_drawable_location(pDrawable)));
- if (uxa_prepare_access(pDrawable, NULL, UXA_ACCESS_RW)) {
+ if (uxa_prepare_access(pDrawable, &region, UXA_ACCESS_RW)) {
if (uxa_prepare_access_gc(pGC)) {
fbImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci,
pglyphBase);
@@ -289,6 +294,8 @@ uxa_check_image_glyph_blt(DrawablePtr pDrawable, GCPtr pGC,
}
uxa_finish_access(pDrawable);
}
+
+ REGION_UNINIT (screen, &region);
}
void
@@ -297,11 +304,15 @@ uxa_check_poly_glyph_blt(DrawablePtr pDrawable, GCPtr pGC,
CharInfoPtr * ppci, pointer pglyphBase)
{
ScreenPtr screen = pDrawable->pScreen;
+ RegionRec region;
+
+ REGION_INIT (screen, &region, (BoxPtr)NULL, 0);
+ uxa_damage_poly_glyph_blt (&region, pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
UXA_FALLBACK(("to %p (%c), style %d alu %d\n", pDrawable,
uxa_drawable_location(pDrawable), pGC->fillStyle,
pGC->alu));
- if (uxa_prepare_access(pDrawable, NULL, UXA_ACCESS_RW)) {
+ if (uxa_prepare_access(pDrawable, &region, UXA_ACCESS_RW)) {
if (uxa_prepare_access_gc(pGC)) {
fbPolyGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci,
pglyphBase);
@@ -309,6 +320,8 @@ uxa_check_poly_glyph_blt(DrawablePtr pDrawable, GCPtr pGC,
}
uxa_finish_access(pDrawable);
}
+
+ REGION_UNINIT (screen, &region);
}
void