Allow conditional dependencies between rects when decoding
Some encodings only cause dependencies between rects some of the
time. Make sure we can allow parallel decoding of those rect that
aren't dependent on each other.
diff --git a/common/rfb/DecodeManager.cxx b/common/rfb/DecodeManager.cxx
index 3c1ddb4..ba2b2d2 100644
--- a/common/rfb/DecodeManager.cxx
+++ b/common/rfb/DecodeManager.cxx
@@ -268,6 +268,23 @@
}
}
+ // For a partially ordered decoder we must ask the decoder for each
+ // pair of rectangles.
+ if (entry->decoder->flags & DecoderPartiallyOrdered) {
+ for (iter2 = manager->workQueue.begin(); iter2 != iter; ++iter2) {
+ if (entry->encoding != (*iter2)->encoding)
+ continue;
+ if (entry->decoder->doRectsConflict(entry->rect,
+ entry->bufferStream->data(),
+ entry->bufferStream->length(),
+ (*iter2)->rect,
+ (*iter2)->bufferStream->data(),
+ (*iter2)->bufferStream->length(),
+ *entry->cp))
+ goto next;
+ }
+ }
+
// Check overlap with earlier rectangles
if (!lockedRegion.intersect(entry->affectedRegion).is_empty())
goto next;