diff options
author | Pierre Ossman <ossman@cendio.se> | 2014-01-31 12:37:32 +0100 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2014-07-07 14:50:28 +0200 |
commit | 668468b3d43d5ea1562ebc0be8de0c98c5601a60 (patch) | |
tree | 80bbb90fb5f00335a7e85c297eadd40b0780dc92 /common/rfb/TightEncoder.cxx | |
parent | fdba3fe884d5b43e07d7d49033c83f2f11bf524c (diff) | |
download | tigervnc-668468b3d43d5ea1562ebc0be8de0c98c5601a60.tar.gz tigervnc-668468b3d43d5ea1562ebc0be8de0c98c5601a60.zip |
Encoders/decoders should track the connection object
The connection object is a much more appropriate object for the
decoders and encoders to keep track of. Besides the streams, it also
contains state like connection parameters.
Diffstat (limited to 'common/rfb/TightEncoder.cxx')
-rw-r--r-- | common/rfb/TightEncoder.cxx | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/common/rfb/TightEncoder.cxx b/common/rfb/TightEncoder.cxx index 800d3316..c3f87dab 100644 --- a/common/rfb/TightEncoder.cxx +++ b/common/rfb/TightEncoder.cxx @@ -22,6 +22,7 @@ #include <rfb/encodings.h> #include <rfb/ConnParams.h> #include <rfb/SMsgWriter.h> +#include <rfb/SConnection.h> #include <rfb/TightEncoder.h> using namespace rfb; @@ -93,7 +94,7 @@ const int TightEncoder::defaultCompressLevel = 2; #include <rfb/tightEncode.h> #undef BPP -TightEncoder::TightEncoder(SMsgWriter* writer) : Encoder(writer) +TightEncoder::TightEncoder(SConnection* conn) : Encoder(conn) { setCompressLevel(defaultCompressLevel); setQualityLevel(-1); @@ -226,7 +227,7 @@ void TightEncoder::extendSolidArea(const Rect& r, rdr::U32 colorValue, int TightEncoder::getNumRects(const Rect &r) { - ConnParams* cp = writer->getConnParams(); + ConnParams* cp = &conn->cp; const unsigned int w = r.width(); const unsigned int h = r.height(); @@ -290,7 +291,7 @@ void TightEncoder::writeRect(const Rect& _r, TransImageGetter* _ig) { ig = _ig; serverpf = ig->getPixelBuffer()->getPF(); - ConnParams* cp = writer->getConnParams(); + ConnParams* cp = &conn->cp; clientpf = cp->pf(); // Shortcuts to rectangle coordinates and dimensions. @@ -405,10 +406,10 @@ void TightEncoder::writeSubrect(const Rect& r, bool forceSolid) tightEncode32(r, &mos, forceSolid); break; } - writer->startRect(r, encodingTight); - rdr::OutStream* os = writer->getOutStream(); + conn->writer()->startRect(r, encodingTight); + rdr::OutStream* os = conn->getOutStream(); os->writeBytes(mos.data(), mos.length()); - writer->endRect(); + conn->writer()->endRect(); } void TightEncoder::writeCompact(rdr::OutStream* os, rdr::U32 value) |