[PATCH 7/9] exa: create ExaCheckGetImage

Maarten Maathuis madman2003 at gmail.com
Tue Feb 3 11:06:29 PST 2009


---
 exa/exa_accel.c   |    7 +------
 exa/exa_priv.h    |    4 ++++
 exa/exa_unaccel.c |   30 ++++++++++++++++++++++++++++++
 3 files changed, 35 insertions(+), 6 deletions(-)

diff --git a/exa/exa_accel.c b/exa/exa_accel.c
index 10e7914..02858f1 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 a41e5fe..6d7c1dd 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 a521497..e0f2ae9 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,
-- 
1.6.1.1




More information about the xorg mailing list