Since fillRect() operates directly on the framebuffer, optimize it and remove the separate version in TightDecoder.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4762 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/common/rfb/tightDecode.h b/common/rfb/tightDecode.h
index 4ea18a9..32bb4f1 100644
--- a/common/rfb/tightDecode.h
+++ b/common/rfb/tightDecode.h
@@ -46,7 +46,6 @@
#define TIGHT_DECODE TightDecoder::CONCAT2E(tightDecode,BPP)
#define DECOMPRESS_JPEG_RECT TightDecoder::CONCAT2E(DecompressJpegRect,BPP)
#define FILTER_GRADIENT TightDecoder::CONCAT2E(FilterGradient,BPP)
-#define DIRECT_FILL_RECT TightDecoder::CONCAT2E(directFillRect,BPP)
#define TIGHT_MIN_TO_COMPRESS 12
@@ -81,8 +80,7 @@
} else {
pix = is->READ_PIXEL();
}
- if (directDecode) DIRECT_FILL_RECT(r, pix);
- else FILL_RECT(r, pix);
+ FILL_RECT(r, pix);
return;
}
@@ -377,37 +375,7 @@
delete [] netbuf;
}
-void
-DIRECT_FILL_RECT(const Rect& r, Pixel pix) {
-
- int stride;
- PIXEL_T *buf = (PIXEL_T *)handler->getRawPixelsRW(r, &stride);
-
- int w = r.width(), h = r.height();
- PIXEL_T *ptr = buf;
-#if BPP != 8
- int pad = stride - w;
-#endif
-
- while (h > 0) {
-#if BPP == 8
- memset(ptr, pix, w);
- ptr += stride;
-#else
- PIXEL_T *endOfRow = ptr + w;
- while (ptr < endOfRow) {
- *ptr++ = pix;
- }
- ptr += pad;
-#endif
- h--;
- }
-
- handler->releaseRawPixels(r);
-}
-
#undef TIGHT_MIN_TO_COMPRESS
-#undef DIRECT_FILL_RECT
#undef FILTER_GRADIENT
#undef DECOMPRESS_JPEG_RECT
#undef TIGHT_DECODE