[Spice-devel] [PATCH qxl-win] display/surface: add QXL_SURFACE_HOOKS define

Alon Levy alevy at redhat.com
Mon Jun 20 03:59:49 PDT 2011


Cc: Yonit Halperin <yhalperi at redhat.com>
---
 display/surface.c |    9 +--------
 display/surface.h |   15 +++++++++++++++
 2 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/display/surface.c b/display/surface.c
index 436e76e..d24e751 100644
--- a/display/surface.c
+++ b/display/surface.c
@@ -111,14 +111,7 @@ HBITMAP CreateDeviceBitmap(PDev *pdev, SIZEL size, ULONG format, QXLPHYSICAL *ph
         goto out_error1;
     }
 
-    if (!EngAssociateSurface((HSURF)surf, pdev->eng,  HOOK_SYNCHRONIZE | HOOK_COPYBITS |
-                             HOOK_BITBLT | HOOK_TEXTOUT | HOOK_STROKEPATH | HOOK_STRETCHBLT |
-                             HOOK_STRETCHBLTROP | HOOK_TRANSPARENTBLT | HOOK_ALPHABLEND
-#ifdef CALL_TEST
-                             | HOOK_PLGBLT | HOOK_FILLPATH | HOOK_STROKEANDFILLPATH | HOOK_LINETO |
-                             HOOK_GRADIENTFILL 
-#endif
-                             )) {
+    if (!EngAssociateSurface((HSURF)surf, pdev->eng, QXL_SURFACE_HOOKS)) {
         DEBUG_PRINT((pdev, 0, "%s: EngAssociateSurface failed\n", __FUNCTION__));
         goto out_error2;
     }
diff --git a/display/surface.h b/display/surface.h
index 977fa91..00fd93c 100644
--- a/display/surface.h
+++ b/display/surface.h
@@ -3,6 +3,21 @@
 
 #include "qxldd.h"
 
+/* Hooks supported by our surfaces. */
+#ifdef CALL_TEST
+#define QXL_SURFACE_HOOKS_CALL_TEST \
+    (HOOK_PLGBLT | HOOK_FILLPATH | HOOK_STROKEANDFILLPATH | HOOK_LINETO |  \
+    HOOK_GRADIENTFILL)
+#else
+#define QXL_SURFACE_HOOKS_CALL_TEST (0)
+#endif
+
+#define QXL_SURFACE_HOOKS \
+    (HOOK_SYNCHRONIZE | HOOK_COPYBITS |                                 \
+    HOOK_BITBLT | HOOK_TEXTOUT | HOOK_STROKEPATH | HOOK_STRETCHBLT |    \
+    HOOK_STRETCHBLTROP | HOOK_TRANSPARENTBLT | HOOK_ALPHABLEND | QXL_SURFACE_HOOKS_CALL_TEST)
+
+
 static _inline UINT32 GetSurfaceIdFromInfo(SurfaceInfo *info)
 {
   PDev *pdev;
-- 
1.7.5.2



More information about the Spice-devel mailing list