Scroom 0.14-49-gb7ae7a6d
Loading...
Searching...
No Matches
measure-framerate-tests.cc File Reference
#include "measure-framerate-tests.hh"
#include <ctime>
#include <memory>
#include <string>
#include <spdlog/spdlog.h>
#include <scroom/logger.hh>
#include "measure-framerate-callbacks.hh"
#include "measure-framerate-stubs.hh"
#include "test-helpers.hh"
Include dependency graph for measure-framerate-tests.cc:

Classes

class  Invalidator
 
class  BaseCounter
 
class  InvalidatingCounter
 

Namespaces

namespace  anonymous_namespace{measure-framerate-tests.cc}
 

Functions

static bool logSizes ()
 
void init_tests ()
 

Variables

Scroom::Logger anonymous_namespace{measure-framerate-tests.cc}::logger
 

Function Documentation

◆ init_tests()

void init_tests ( )
157{
158 const int width = 2 * 4096;
159 const int height = 2 * 4096;
160 const unsigned int testDuration = 15;
161 const unsigned int sleepDuration = 2;
162
163 functions.emplace_back(Sleeper(sleepDuration));
164 functions.emplace_back(logSizes);
165 functions.emplace_back(BaseCounter("Baseline (no invalidate)", testDuration));
166
167 functions.emplace_back(Invalidator(sleepDuration));
168 functions.emplace_back(InvalidatingCounter("Baseline (no redraw)", testDuration));
169
170 functions.emplace_back([] { return setupTest1bpp(-2, width, height); });
171 functions.emplace_back(wait);
172 functions.emplace_back(Invalidator(sleepDuration));
173 functions.emplace_back(InvalidatingCounter("1bpp, 1:4 zoom", testDuration));
174
175 functions.emplace_back([] { return setupTest1bpp(4, width, height); });
176 functions.emplace_back(wait);
177 functions.emplace_back(Invalidator(sleepDuration));
178 functions.emplace_back(InvalidatingCounter("1bpp, 16:1 zoom", testDuration));
179
180 functions.emplace_back([] { return setupTest4bpp(-2, width, height); });
181 functions.emplace_back(wait);
182 functions.emplace_back(Invalidator(sleepDuration));
183 functions.emplace_back(InvalidatingCounter("4bpp, 1:4 zoom, colormapped", testDuration));
184
185 functions.emplace_back([] { return setupTest4bpp(4, width, height); });
186 functions.emplace_back(wait);
187 functions.emplace_back(Invalidator(sleepDuration));
188 functions.emplace_back(InvalidatingCounter("4bpp, 16:1 zoom, colormapped", testDuration));
189
190 functions.emplace_back([] { return setupTest8bpp(-2, width, height); });
191 functions.emplace_back(wait);
192 functions.emplace_back(Invalidator(sleepDuration));
193 functions.emplace_back(InvalidatingCounter("8bpp, 1:4 zoom", testDuration));
194
195 functions.emplace_back([] { return setupTest8bpp(4, width, height); });
196 functions.emplace_back(wait);
197 functions.emplace_back(Invalidator(sleepDuration));
198 functions.emplace_back(InvalidatingCounter("8bpp, 16:1 zoom", testDuration));
199
200 functions.emplace_back([] { return setupTest8bppColormapped(-2, width, height); });
201 functions.emplace_back(wait);
202 functions.emplace_back(Invalidator(sleepDuration));
203 functions.emplace_back(InvalidatingCounter("8bpp, 1:4 zoom, colormapped", testDuration));
204
205 functions.emplace_back([] { return setupTest8bppColormapped(4, width, height); });
206 functions.emplace_back(wait);
207 functions.emplace_back(Invalidator(sleepDuration));
208 functions.emplace_back(InvalidatingCounter("8bpp, 16:1 zoom, colormapped", testDuration));
209
210 functions.emplace_back(reset);
211 functions.emplace_back(quit);
212}
provider reset()
Definition test-helpers.cc:131
Definition measure-framerate-tests.cc:43
Definition measure-framerate-tests.cc:60
Definition measure-framerate-tests.cc:30
Definition test-helpers.hh:90
std::vector< boost::function< bool()> > functions
Definition measure-framerate-callbacks.cc:14
static bool logSizes()
Definition measure-framerate-tests.cc:68
bool setupTest8bppColormapped(int zoom, int width, int height)
Definition test-helpers.cc:221
bool setupTest1bpp(int zoom, int width, int height)
Definition test-helpers.cc:150
bool setupTest4bpp(int zoom, int width, int height)
Definition test-helpers.cc:186
bool setupTest8bpp(int zoom, int width, int height)
Definition test-helpers.cc:204
bool wait()
Definition test-helpers.cc:138
bool quit()
Definition test-helpers.cc:124

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ logSizes()

static bool logSizes ( )
static
69{
70 logger->info("Canvas size: {}x{}", drawingAreaWidth, drawingAreaHeight);
71 return false;
72}
Scroom::Logger logger
Definition measure-framerate-tests.cc:24
int drawingAreaWidth
Definition test-helpers.cc:22
int drawingAreaHeight
Definition test-helpers.cc:23

Referenced by init_tests().

Here is the caller graph for this function: