diff options
Diffstat (limited to 'tests/perf')
-rw-r--r-- | tests/perf/CMakeLists.txt | 8 | ||||
-rw-r--r-- | tests/perf/decperf.cxx | 11 | ||||
-rw-r--r-- | tests/perf/encperf.cxx | 70 | ||||
-rw-r--r-- | tests/perf/fbperf.cxx | 12 |
4 files changed, 44 insertions, 57 deletions
diff --git a/tests/perf/CMakeLists.txt b/tests/perf/CMakeLists.txt index 13061b9b..54a1ad89 100644 --- a/tests/perf/CMakeLists.txt +++ b/tests/perf/CMakeLists.txt @@ -6,10 +6,10 @@ add_executable(convperf convperf.cxx) target_link_libraries(convperf test_util rfb) add_executable(decperf decperf.cxx) -target_link_libraries(decperf test_util rfb) +target_link_libraries(decperf test_util rdr rfb) add_executable(encperf encperf.cxx) -target_link_libraries(encperf test_util rfb) +target_link_libraries(encperf test_util core rdr rfb) if (BUILD_VIEWER) add_executable(fbperf @@ -27,8 +27,8 @@ if (BUILD_VIEWER) target_sources(fbperf PRIVATE ${CMAKE_SOURCE_DIR}/vncviewer/Surface_X11.cxx) endif() target_include_directories(fbperf SYSTEM PUBLIC ${FLTK_INCLUDE_DIR}) - target_include_directories(fbperf SYSTEM PUBLIC ${GETTEXT_INCLUDE_DIR}) - target_link_libraries(fbperf test_util rfb ${FLTK_LIBRARIES} ${GETTEXT_LIBRARIES}) + target_include_directories(fbperf SYSTEM PUBLIC ${Intl_INCLUDE_DIR}) + target_link_libraries(fbperf test_util core rfb ${FLTK_LIBRARIES} ${Intl_LIBRARIES}) if(WIN32) target_link_libraries(fbperf msimg32) endif() diff --git a/tests/perf/decperf.cxx b/tests/perf/decperf.cxx index 46f42fa2..2c7efa3b 100644 --- a/tests/perf/decperf.cxx +++ b/tests/perf/decperf.cxx @@ -33,7 +33,6 @@ #include <math.h> #include <sys/time.h> -#include <rdr/Exception.h> #include <rdr/FileInStream.h> #include <rdr/OutStream.h> @@ -68,8 +67,6 @@ public: ~CConn(); void initDone() override; - void setCursor(int, int, const rfb::Point&, const uint8_t*) override; - void setCursorPos(const rfb::Point&) override; void framebufferUpdateStart() override; void framebufferUpdateEnd() override; void setColourMapEntries(int, int, uint16_t*) override; @@ -141,14 +138,6 @@ void CConn::initDone() server.height())); } -void CConn::setCursor(int, int, const rfb::Point&, const uint8_t*) -{ -} - -void CConn::setCursorPos(const rfb::Point&) -{ -} - void CConn::framebufferUpdateStart() { CConnection::framebufferUpdateStart(); 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]); diff --git a/tests/perf/fbperf.cxx b/tests/perf/fbperf.cxx index e4d0febf..1a5b5ba7 100644 --- a/tests/perf/fbperf.cxx +++ b/tests/perf/fbperf.cxx @@ -28,8 +28,8 @@ #include <FL/fl_draw.H> #include <FL/x.H> -#include <rdr/Exception.h> -#include <rfb/util.h> +#include <core/string.h> +#include <core/time.h> #include "../vncviewer/PlatformPixelBuffer.h" @@ -155,7 +155,7 @@ void TestWindow::flush() void TestWindow::update() { - rfb::Rect r; + core::Rect r; startTimeCounter(); @@ -194,7 +194,7 @@ void TestWindow::timer(void* data) void PartialTestWindow::changefb() { - rfb::Rect r; + core::Rect r; uint32_t pixel; r = fb->getRect(); @@ -300,7 +300,7 @@ static void dosubtest(TestWindow* win, int width, int height, win->start(width, height); gettimeofday(&start, nullptr); - while (rfb::msSince(&start) < 3000) + while (core::msSince(&start) < 3000) Fl::wait(); win->stop(); @@ -370,7 +370,7 @@ static void dotest(TestWindow* win) fprintf(stderr, "Rendering delay: %g ms/frame\n", delay * 1000.0); fprintf(stderr, "Rendering rate: %s\n", (rate == 0.0) ? "N/A pixels/s" : - rfb::siPrefix(1.0 / rate, "pixels/s").c_str()); + core::siPrefix(1.0 / rate, "pixels/s").c_str()); fprintf(stderr, "Maximum FPS: %g fps @ 1920x1080\n", 1.0 / (delay + rate * 1920 * 1080)); } |