diff options
Diffstat (limited to 'tests/perf/encperf.cxx')
-rw-r--r-- | tests/perf/encperf.cxx | 70 |
1 files changed, 34 insertions, 36 deletions
diff --git a/tests/perf/encperf.cxx b/tests/perf/encperf.cxx index d761bbed..0da54603 100644 --- a/tests/perf/encperf.cxx +++ b/tests/perf/encperf.cxx @@ -37,34 +37,32 @@ #include <math.h> #include <sys/time.h> -#include <rdr/Exception.h> +#include <core/Configuration.h> + #include <rdr/OutStream.h> #include <rdr/FileInStream.h> #include <rfb/AccessRights.h> - #include <rfb/PixelFormat.h> - #include <rfb/CConnection.h> #include <rfb/CMsgReader.h> #include <rfb/CMsgWriter.h> #include <rfb/UpdateTracker.h> - #include <rfb/EncodeManager.h> #include <rfb/SConnection.h> #include <rfb/SMsgWriter.h> #include "util.h" -static rfb::IntParameter width("width", "Frame buffer width", 0); -static rfb::IntParameter height("height", "Frame buffer height", 0); -static rfb::IntParameter count("count", "Number of benchmark iterations", 9); +static core::IntParameter width("width", "Frame buffer width", 0); +static core::IntParameter height("height", "Frame buffer height", 0); +static core::IntParameter count("count", "Number of benchmark iterations", 9); -static rfb::StringParameter format("format", "Pixel format (e.g. bgr888)", ""); +static core::StringParameter format("format", "Pixel format (e.g. bgr888)", ""); -static rfb::BoolParameter translate("translate", - "Translate 8-bit and 16-bit datasets into 24-bit", - true); +static core::BoolParameter translate("translate", + "Translate 8-bit and 16-bit datasets into 24-bit", + true); // The frame buffer (and output) is always this format static const rfb::PixelFormat fbPF(32, 24, false, true, 255, 255, 255, 0, 8, 16); @@ -100,11 +98,9 @@ public: void initDone() override {}; void resizeFramebuffer() override; - void setCursor(int, int, const rfb::Point&, const uint8_t*) override; - void setCursorPos(const rfb::Point&) override; void framebufferUpdateStart() override; void framebufferUpdateEnd() override; - bool dataRect(const rfb::Rect&, int) override; + bool dataRect(const core::Rect&, int) override; void setColourMapEntries(int, int, uint16_t*) override; void bell() override; void serverCutText(const char*) override; @@ -143,6 +139,10 @@ public: void setDesktopSize(int fb_width, int fb_height, const rfb::ScreenSet& layout) override; + void keyEvent(uint32_t keysym, uint32_t keycode, bool down) override; + void pointerEvent(const core::Point& pos, + uint16_t buttonMask) override; + protected: DummyOutStream *out; Manager *manager; @@ -196,7 +196,7 @@ CConn::CConn(const char *filename) sc = new SConn(); sc->client.setPF((bool)translate ? fbPF : pf); - sc->setEncodings(sizeof(encodings) / sizeof(*encodings), encodings); + ((rfb::SMsgHandler*)sc)->setEncodings(sizeof(encodings) / sizeof(*encodings), encodings); } CConn::~CConn() @@ -221,14 +221,6 @@ void CConn::resizeFramebuffer() setFramebuffer(pb); } -void CConn::setCursor(int, int, const rfb::Point&, const uint8_t*) -{ -} - -void CConn::setCursorPos(const rfb::Point&) -{ -} - void CConn::framebufferUpdateStart() { CConnection::framebufferUpdateStart(); @@ -241,7 +233,7 @@ void CConn::framebufferUpdateEnd() { rfb::UpdateInfo ui; rfb::PixelBuffer* pb = getFramebuffer(); - rfb::Region clip(pb->getRect()); + core::Region clip(pb->getRect()); CConnection::framebufferUpdateEnd(); @@ -258,13 +250,13 @@ void CConn::framebufferUpdateEnd() encodeTime += getCpuCounter(); } -bool CConn::dataRect(const rfb::Rect &r, int encoding) +bool CConn::dataRect(const core::Rect& r, int encoding) { if (!CConnection::dataRect(r, encoding)) return false; if (encoding != rfb::encodingCopyRect) // FIXME - updates.add_changed(rfb::Region(r)); + updates.add_changed(r); return true; } @@ -351,6 +343,14 @@ void SConn::setDesktopSize(int, int, const rfb::ScreenSet&) { } +void SConn::keyEvent(uint32_t, uint32_t, bool) +{ +} + +void SConn::pointerEvent(const core::Point&, uint16_t) +{ +} + struct stats { double decodeTime; @@ -421,7 +421,7 @@ static void usage(const char *argv0) { fprintf(stderr, "Syntax: %s [options] <rfb file>\n", argv0); fprintf(stderr, "Options:\n"); - rfb::Configuration::listParams(79, 14); + core::Configuration::listParams(79, 14); exit(1); } @@ -433,18 +433,16 @@ int main(int argc, char **argv) fn = nullptr; for (i = 1; i < argc; i++) { - if (rfb::Configuration::setParam(argv[i])) + int ret; + + ret = core::Configuration::handleParamArg(argc, argv, i); + if (ret > 0) { + i += ret; continue; + } - if (argv[i][0] == '-') { - if (i + 1 < argc) { - if (rfb::Configuration::setParam(&argv[i][1], argv[i + 1])) { - i++; - continue; - } - } + if (argv[i][0] == '-') usage(argv[0]); - } if (fn != nullptr) usage(argv[0]); |