aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2011-11-03 13:20:32 +0000
committerPierre Ossman <ossman@cendio.se>2011-11-03 13:20:32 +0000
commit4eb7420e410592d6753ee4dcdcb3834baad61f09 (patch)
tree60e4f19fd515ae65d7f9840882cbf55102de2f6f
parentfa6cda7b1d486019d51a06acfbb836d1d6256c77 (diff)
downloadtigervnc-4eb7420e410592d6753ee4dcdcb3834baad61f09.tar.gz
tigervnc-4eb7420e410592d6753ee4dcdcb3834baad61f09.zip
Rename and document TransImageGetter::getPixelsRW() to make it more obvious
that it bypasses the normal conversion logic. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4754 3789f03b-4d11-0410-bbf8-ca57d06f2519
-rw-r--r--common/rfb/TransImageGetter.cxx2
-rw-r--r--common/rfb/TransImageGetter.h6
-rw-r--r--common/rfb/tightEncode.h4
3 files changed, 8 insertions, 4 deletions
diff --git a/common/rfb/TransImageGetter.cxx b/common/rfb/TransImageGetter.cxx
index e0c60a40..bf26b44d 100644
--- a/common/rfb/TransImageGetter.cxx
+++ b/common/rfb/TransImageGetter.cxx
@@ -56,7 +56,7 @@ void TransImageGetter::setColourMapEntries(int firstCol, int nCols)
PixelTransformer::setColourMapEntries(firstCol, nCols);
}
-rdr::U8 *TransImageGetter::getPixelsRW(const Rect &r, int *stride)
+rdr::U8 *TransImageGetter::getRawPixelsRW(const Rect &r, int *stride)
{
if (!offset.equals(Point(0, 0)))
return pb->getPixelsRW(r.translate(offset.negate()), stride);
diff --git a/common/rfb/TransImageGetter.h b/common/rfb/TransImageGetter.h
index 8fde743b..1ad49b7c 100644
--- a/common/rfb/TransImageGetter.h
+++ b/common/rfb/TransImageGetter.h
@@ -72,7 +72,11 @@ namespace rfb {
// padding will be outStride-r.width() pixels).
void getImage(void* outPtr, const Rect& r, int outStride=0);
- rdr::U8 *getPixelsRW(const Rect &r, int *stride);
+ // getRawPixelsRW() gets the given rectangle of data directly from the
+ // underlying PixelBuffer, bypassing the translation logic. Only use
+ // this when doing something that's independent of the client's pixel
+ // format.
+ rdr::U8 *getRawPixelsRW(const Rect &r, int *stride);
// setPixelBuffer() changes the pixel buffer to be used. The new pixel
// buffer MUST have the same pixel format as the old one - if not you
diff --git a/common/rfb/tightEncode.h b/common/rfb/tightEncode.h
index a6a82417..37c7ae76 100644
--- a/common/rfb/tightEncode.h
+++ b/common/rfb/tightEncode.h
@@ -191,7 +191,7 @@ void TIGHT_ENCODE (const Rect& r, rdr::OutStream *os, bool forceSolid)
{
int stride = r.width();
rdr::U32 solidColor;
- PIXEL_T *pixels = (PIXEL_T *)ig->getPixelsRW(r, &stride);
+ PIXEL_T *pixels = (PIXEL_T *)ig->getRawPixelsRW(r, &stride);
bool grayScaleJPEG = (jpegSubsampling == SUBSAMP_GRAY && jpegQuality != -1);
#if (BPP == 32)
@@ -640,7 +640,7 @@ bool CHECK_SOLID_TILE(Rect& r, rdr::U32 *colorPtr, bool needSameColor)
int w = r.width(), h = r.height();
int stride = w;
- buf = (PIXEL_T *)ig->getPixelsRW(r, &stride);
+ buf = (PIXEL_T *)ig->getRawPixelsRW(r, &stride);
colorValue = *buf;
if (needSameColor && (rdr::U32)colorValue != *colorPtr)