[Spice-devel] [PATCH 06/17] Only look for streams on primary surface

alexl at redhat.com alexl at redhat.com
Tue Sep 14 12:08:56 PDT 2010


From: Alexander Larsson <alexl at redhat.com>

We currently only support streams there anyway, and the code doesn't
work for offscreen surfaces as is since its only looking at the
destination rect.
---
 display/rop.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/display/rop.c b/display/rop.c
index 7160c32..48fc3ff 100644
--- a/display/rop.c
+++ b/display/rop.c
@@ -496,14 +496,16 @@ static BOOL DoOpaque(PDev *pdev, UINT32 surface_id, RECTL *area, CLIPOBJ *clip,
     return TRUE;
 }
 
-static BOOL StreamTest(PDev *pdev, SURFOBJ *src_surf, XLATEOBJ *color_trans, RECTL *src_rect,
-                       RECTL *dest)
+static BOOL StreamTest(PDev *pdev, UINT32 surface_id, SURFOBJ *src_surf, 
+		       XLATEOBJ *color_trans, RECTL *src_rect, RECTL *dest)
 {
     Ring *ring = &pdev->update_trace;
     UpdateTrace *trace = (UpdateTrace *)ring->next;
     LONG src_pixmap_pixels = src_surf->sizlBitmap.cx * src_surf->sizlBitmap.cy;
 
-    if (src_pixmap_pixels <= 128 * 128) {
+    if (src_pixmap_pixels <= 128 * 128 || 
+	/* Only handle streams on primary surface */
+	surface_id != 0) {
         return TRUE;
     }
 
@@ -669,7 +671,7 @@ static BOOL DoCopy(PDev *pdev, UINT32 surface_id, RECTL *area, CLIPOBJ *clip, SU
     if (mask) {
         use_cache = TRUE;
     } else {
-        use_cache = StreamTest(pdev, src, color_trans, src_rect, area);
+        use_cache = StreamTest(pdev, surface_id, src, color_trans, src_rect, area);
     }
 
     if (use_cache && TestSplitClips(pdev, src, src_rect, clip, mask) &&
-- 
1.7.2.2



More information about the Spice-devel mailing list