summaryrefslogtreecommitdiff
path: root/exa
diff options
context:
space:
mode:
authorEric Anholt <anholt@freebsd.org>2006-04-01 22:35:16 +0000
committerEric Anholt <anholt@freebsd.org>2006-04-01 22:35:16 +0000
commit5f95146fcfcae60cc29265799ba3b851647105d6 (patch)
treeccd5d066288f09e37d08ea894d8474d394ee743a /exa
parentc720ffe875e4b2038746ff9b4767f8b90db0a307 (diff)
Export exaPrepare/FinishGC to the rest of EXA, and use it in the ImageGlyph
implementation to avoid unprepared access to the tile. Also, relocate the fbGetDrawable to avoid using a stale dest pointer after exaSolidBoxClipped() may have migrated it. Revealed by xtest.
Diffstat (limited to 'exa')
-rw-r--r--exa/exa_accel.c7
-rw-r--r--exa/exa_priv.h6
-rw-r--r--exa/exa_unaccel.c4
3 files changed, 13 insertions, 4 deletions
diff --git a/exa/exa_accel.c b/exa/exa_accel.c
index c51312126..1978852b6 100644
--- a/exa/exa_accel.c
+++ b/exa/exa_accel.c
@@ -695,8 +695,7 @@ exaImageGlyphBlt (DrawablePtr pDrawable,
return;
}
glyph = NULL;
- fbGetDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff);
- switch (dstBpp) {
+ switch (pDrawable->bitsPerPixel) {
case 8: glyph = fbGlyph8; break;
case 16: glyph = fbGlyph16; break;
case 24: glyph = fbGlyph24; break;
@@ -742,6 +741,9 @@ exaImageGlyphBlt (DrawablePtr pDrawable,
EXA_FALLBACK(("to 0x%lx\n", (long)pDrawable));
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
+ exaPrepareAccessGC (pGC);
+
+ fbGetDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff);
ppci = ppciInit;
while (nglyph--)
@@ -787,6 +789,7 @@ exaImageGlyphBlt (DrawablePtr pDrawable,
}
x += pci->metrics.characterWidth;
}
+ exaFinishAccessGC (pGC);
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
}
diff --git a/exa/exa_priv.h b/exa/exa_priv.h
index 3c09560c2..18550eec0 100644
--- a/exa/exa_priv.h
+++ b/exa/exa_priv.h
@@ -189,6 +189,12 @@ void exaDDXDriverInit (ScreenPtr pScreen);
/* exa_unaccel.c */
void
+exaPrepareAccessGC(GCPtr pGC);
+
+void
+exaFinishAccessGC(GCPtr pGC);
+
+void
ExaCheckFillSpans (DrawablePtr pDrawable, GCPtr pGC, int nspans,
DDXPointPtr ppt, int *pwidth, int fSorted);
diff --git a/exa/exa_unaccel.c b/exa/exa_unaccel.c
index fcce67b91..b28c5a5b0 100644
--- a/exa/exa_unaccel.c
+++ b/exa/exa_unaccel.c
@@ -36,7 +36,7 @@
* Solid doesn't use an extra pixmap source, and Stippled/OpaqueStippled are
* 1bpp and never in fb, so we don't worry about them.
*/
-static void
+void
exaPrepareAccessGC(GCPtr pGC)
{
if (pGC->fillStyle == FillTiled)
@@ -46,7 +46,7 @@ exaPrepareAccessGC(GCPtr pGC)
/**
* Finishes access to the tile in the GC, if used.
*/
-static void
+void
exaFinishAccessGC(GCPtr pGC)
{
if (pGC->fillStyle == FillTiled)