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/Decoder.h b/common/rfb/Decoder.h
index 9a03eb3..3840b3f 100644
--- a/common/rfb/Decoder.h
+++ b/common/rfb/Decoder.h
@@ -35,6 +35,9 @@
DecoderPlain = 0,
// All rects for this decoder must be handled in order
DecoderOrdered = 1 << 0,
+ // Only some of the rects must be handled in order,
+ // see doesRectsConflict()
+ DecoderPartiallyOrdered = 1 << 1,
};
class Decoder {
@@ -62,6 +65,17 @@
size_t buflen, const ConnParams& cp,
Region* region);
+ // doesRectsConflict() determines if two rectangles must be decoded
+ // in the order they were received. This will only be called if the
+ // DecoderPartiallyOrdered flag has been set.
+ virtual bool doRectsConflict(const Rect& rectA,
+ const void* bufferA,
+ size_t buflenA,
+ const Rect& rectB,
+ const void* bufferB,
+ size_t buflenB,
+ const ConnParams& cp);
+
// decodeRect() decodes the given rectangle with data from the
// given buffer, onto the ModifiablePixelBuffer. The PixelFormat of
// the PixelBuffer might not match the ConnParams and it is up to