The Tight encoder uses the pixel buffer as a scratch pad, which doesn't
work so well with the new optimisation to feed it the raw frame buffer.
Reorganise and clean up the code to handle this, and make the raw frame
buffer pointer const so that we might avoid such bugs in the future.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4841 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/common/rfb/TransImageGetter.cxx b/common/rfb/TransImageGetter.cxx
index bf26b44..c1add1c 100644
--- a/common/rfb/TransImageGetter.cxx
+++ b/common/rfb/TransImageGetter.cxx
@@ -56,12 +56,12 @@
PixelTransformer::setColourMapEntries(firstCol, nCols);
}
-rdr::U8 *TransImageGetter::getRawPixelsRW(const Rect &r, int *stride)
+const rdr::U8 *TransImageGetter::getRawPixelsR(const Rect &r, int *stride)
{
if (!offset.equals(Point(0, 0)))
- return pb->getPixelsRW(r.translate(offset.negate()), stride);
+ return pb->getPixelsR(r.translate(offset.negate()), stride);
else
- return pb->getPixelsRW(r, stride);
+ return pb->getPixelsR(r, stride);
}
void TransImageGetter::getImage(void* outPtr, const Rect& r, int outStride)