summaryrefslogtreecommitdiff
path: root/exa
diff options
context:
space:
mode:
authorMaarten Maathuis <madman2003@gmail.com>2009-01-31 19:57:07 +0100
committerMaarten Maathuis <madman2003@gmail.com>2009-02-06 18:42:39 +0100
commitf06bde3d4bf9a0f245dfa6c65cd98f8e0c7dfdfc (patch)
treea5cf57807e832521b045465e13b7a0356aa3c749 /exa
parent258fc4b106dfd7b583999f97caf4d4a7a11569b6 (diff)
exa: create ExaCheckGetImage
Diffstat (limited to 'exa')
-rw-r--r--exa/exa_accel.c7
-rw-r--r--exa/exa_priv.h4
-rw-r--r--exa/exa_unaccel.c30
3 files changed, 35 insertions, 6 deletions
diff --git a/exa/exa_accel.c b/exa/exa_accel.c
index 10e791493..02858f1fc 100644
--- a/exa/exa_accel.c
+++ b/exa/exa_accel.c
@@ -1201,12 +1201,7 @@ exaGetImage (DrawablePtr pDrawable, int x, int y, int w, int h,
}
fallback:
- EXA_FALLBACK(("from %p (%c)\n", pDrawable,
- exaDrawableLocation(pDrawable)));
-
- exaPrepareAccessReg (pDrawable, EXA_PREPARE_SRC, &Reg);
- fbGetImage (pDrawable, x, y, w, h, format, planeMask, d);
- exaFinishAccess (pDrawable, EXA_PREPARE_SRC);
+ ExaCheckGetImage(pDrawable, x, y, w, h, format, planeMask, d);
out:
REGION_UNINIT(pScreen, &Reg);
diff --git a/exa/exa_priv.h b/exa/exa_priv.h
index a41e5fe00..6d7c1dd63 100644
--- a/exa/exa_priv.h
+++ b/exa/exa_priv.h
@@ -361,6 +361,10 @@ ExaCheckPushPixels (GCPtr pGC, PixmapPtr pBitmap,
int w, int h, int x, int y);
void
+ExaCheckGetImage(DrawablePtr pDrawable, int x, int y, int w, int h,
+ unsigned int format, unsigned long planeMask, char *d);
+
+void
ExaCheckGetSpans (DrawablePtr pDrawable,
int wMax,
DDXPointPtr ppt,
diff --git a/exa/exa_unaccel.c b/exa/exa_unaccel.c
index a5214976c..e0f2ae9a9 100644
--- a/exa/exa_unaccel.c
+++ b/exa/exa_unaccel.c
@@ -283,6 +283,36 @@ ExaCheckPushPixels (GCPtr pGC, PixmapPtr pBitmap,
}
void
+ExaCheckGetImage(DrawablePtr pDrawable, int x, int y, int w, int h,
+ unsigned int format, unsigned long planeMask, char *d)
+{
+ BoxRec Box;
+ RegionRec Reg;
+ int xoff, yoff;
+ ScreenPtr pScreen = pDrawable->pScreen;
+ PixmapPtr pPix = exaGetDrawablePixmap (pDrawable);
+ ExaScreenPriv(pScreen);
+
+ EXA_FALLBACK(("from %p (%c)\n", pDrawable,
+ exaDrawableLocation(pDrawable)));
+
+ exaGetDrawableDeltas(pDrawable, pPix, &xoff, &yoff);
+
+ Box.x1 = pDrawable->y + x + xoff;
+ Box.y1 = pDrawable->y + y + yoff;
+ Box.x2 = Box.x1 + w;
+ Box.y2 = Box.y1 + h;
+
+ REGION_INIT(pScreen, &Reg, &Box, 1);
+
+ exaPrepareAccessReg (pDrawable, EXA_PREPARE_SRC, &Reg);
+ swap(pExaScr, pScreen, GetImage);
+ pScreen->GetImage (pDrawable, x, y, w, h, format, planeMask, d);
+ swap(pExaScr, pScreen, GetImage);
+ exaFinishAccess (pDrawable, EXA_PREPARE_SRC);
+}
+
+void
ExaCheckGetSpans (DrawablePtr pDrawable,
int wMax,
DDXPointPtr ppt,