This is an idea suggested by izik, I just tested it a little so far.

Basically the test for alpha in QXLGetBitmap is done even when the target
is a primary surface (side note: our driver only supports a single monitor
right now, and hardcoding '0' there also sucks, it should basically be
0..num_monitors-1). So this adds a check explicitly. I haven't benchmarked
it yet (I plan on doing a little infrastructure to make benchmarking easier
with another ifdef - don't plan on pushing this upstream since it will make
the code much uglier - I want to decorate all the api functions to have
them output debug prints).

I haven't tried this on X driver either - don't even know where the X code is..

diff --git a/display/res.c b/display/res.c
index 62a8bb8..f99db7f 100644
--- a/display/res.c
+++ b/display/res.c
@@ -2029,7 +2029,7 @@ BOOL QXLGetBitmap(PDev *pdev, QXLDrawable *drawable, QXLPH
 
     high_bits_set = FALSE;
     if (surf->iBitmapFormat == BMF_32BPP) {
-        if (rgb32_data_has_alpha(width, height, surf->lDelta,
+        if (surf->id == 0 && rgb32_data_has_alpha(width, height, surf->lDelta,
                                  (UINT8 *)surf->pvScan0 + area->left * 4,
                                  &high_bits_set) &&
             !high_bits_set) {
_______________________________________________
Spice-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/spice-devel

Reply via email to